summaryrefslogtreecommitdiff
path: root/lib/git/objects/base.py
Commit message (Collapse)AuthorAgeFilesLines
* moved all contents, incl. submodule gitdb, up to the root directorySebastian Thiel2010-11-211-168/+0
|
* Optimized test-decorators, by completely removing with_bare_rw_repo, which ↵Sebastian Thiel2010-11-151-1/+4
| | | | was mainly copy-paste from with_rw_repo, what a shame
* Objects: Constructor now manually checks and sets the input arguments to the ↵Sebastian Thiel2010-11-151-12/+4
| | | | | | local cache - previously a procedural approach was used, which was less code, but slower too. Especially in case of CommitObjects unrolling the loop manually makes a difference. Submodule: Implemented query methods and did a bit of testing. More is to come, but the test works for now. As special addition, the submodule implementation uses the section name as submodule ID even though it seems to be just the path. This allows to make renames easier
* Adjusted previous object creators to use the rev_parse method directly. ↵Sebastian Thiel2010-07-071-4/+1
| | | | rev_parse could be adjusted not to return Objects anymore, providing better performance for those who just want a sha only. On the other hand, the method is high-level and should be convenient to use as well, its a starting point for more usually, hence its unlikely to call it in tight loops
* Initial version of the rev-parse routine, which doesn't work too bad, but ↵Sebastian Thiel2010-07-061-0/+11
| | | | its still rather slow and many tests are not yet implemented
* Renamed modules utils to util, and errors to exc to be more conforming to ↵Sebastian Thiel2010-06-291-2/+2
| | | | the submodules's naming conventions
* Diff: fixed bug that caused a string to end up as a blob modeSebastian Thiel2010-06-291-0/+1
|
* Adjusted all files to (hopefully) deal with the fact that all objects now ↵Sebastian Thiel2010-06-251-128/+68
| | | | | | | use 20 byte sha's internally as it is closer to the GitDB implementation Switched all remaining files back to tabs Adjusted all remaining docstrings to suit the sphinx doc convention - its likely that there are many of docstring syntax errors though
* index.write_tree: initial version implemented, although its not yet working ↵Sebastian Thiel2010-06-221-0/+1
| | | | | | | correctly, a test to explicitly compare the git version with the python implementation is still missing Tree and Index internally use 20 byte shas, converting them only as needed to reduce memory footprint and processing time objects: started own 'fun' module containing the most important tree functions, more are likely to be added soon
* tree: added TreeModifier, allowing to adjust existing trees safely and or ↵Sebastian Thiel2010-06-141-1/+1
| | | | fast, while staying compatible with serialization which requires it to be sorted
* Fixed implementation after design change to deal with it - all tests run, ↵Sebastian Thiel2010-06-041-8/+9
| | | | but next there will have to be more through testing
* initial version of new odb design to facilitate a channel based ↵Sebastian Thiel2010-06-041-4/+4
| | | | multi-threading implementation of all odb functions
* db: implemented GitObjectDB using the git command to make sure we can lookup ↵Sebastian Thiel2010-06-041-19/+13
| | | | everything. Next is to implement pack-file reading, then alternates which should allow to resolve everything
* commit.create_from_tree now uses pure python implementation, fixed message ↵Sebastian Thiel2010-06-031-2/+2
| | | | | | parsing which truncated newlines although it was ilegitimate. Its up to the reader to truncate therse, nowhere in the git code I could find anyone adding newlines to commits where it is written Added performance tests for serialization, it does about 5k commits per second if writing to tmpfs
* odb: implemented loose object streaming, which is impossible to do ↵Sebastian Thiel2010-06-031-2/+2
| | | | efficiently considering that it copies string buffers all the time
* commit: refactored existing code to decode commits from streams - ↵Sebastian Thiel2010-06-021-209/+209
| | | | | | | performance is slightly better git.cmd: added method to provide access to the content stream directly. This is more efficient if large objects are handled, if it is actually used test.helpers: removed unnecessary code
* commit: initial version of commit_from_tree which could create commit ↵Sebastian Thiel2010-06-021-0/+1
| | | | objects if it could serialize itself
* Converted all tabs to 4 space characters each to comply with pep8Sebastian Thiel2010-03-041-208/+208
|
* repo: renamed directories to more descriptive identifiers and made them ↵Sebastian Thiel2009-12-031-1/+1
| | | | safer to use in case of bare repositories
* tree: added traversal method, adjusted testsSebastian Thiel2009-11-261-0/+8
| | | | Fixed critical bug in object code: IndexObjects now use their path as hashkey, not the data\!
* diff: added __str__ method to diff classSebastian Thiel2009-11-251-3/+5
| | | | IndexObject._mode_str_to_int: Now uses the 6 relevant bytes of the passed in octal string
* Added utilities helping to create proper paths either with slashes or ↵Sebastian Thiel2009-11-051-3/+5
| | | | | | | backslashes depending on the operating system fixed test_refs and test_trees Many more issues remain though, this is just a first backup commit
* IndexObject: assured that .path fields are relative to the repository ( ↵Sebastian Thiel2009-11-041-0/+17
| | | | | | previously it would just be a name ) added abspath property and name property to provide easy access to most common paths of an index object
* object: renamed id attribute to sha as it in fact is always being rewritten ↵Sebastian Thiel2009-11-031-17/+17
| | | | as sha, even if the passed in id was a ref. This is done to assure objects are uniquely identified and will compare correctly
* index.remove implemented including throrough testSebastian Thiel2009-10-231-0/+1
|
* Stream_data streams data to a given output stream most efficiently with a ↵Sebastian Thiel2009-10-221-0/+12
| | | | | | | | | | | low memory footprint. Still, the git-cat-file command keeps all data in an interal buffer instead of streaming it directly. This is a git design issue though, and will be hard to address without some proper git-hacking. Conflicts: lib/git/cmd.py
* added Object.data_stream property allowing to stream object data ↵Sebastian Thiel2009-10-221-0/+12
| | | | directly.Considering the implementation of the git commnd which temporarily keeps it in a cache, it doesnt make a huge diffence as the data is kept in memory while streaming. Only good thing is that it is in a different process so python will never see it if done properly
* resolved cyclic inclusion issue by moving the Diffable interface into the ↵Sebastian Thiel2009-10-181-75/+0
| | | | diff module, which probably is the right thing to do anyway
* implemented diff tests, but will have to move the diff module as it needs to ↵Sebastian Thiel2009-10-181-2/+5
| | | | create objects, whose import would create a dependency cycle
* added Diffable interface to objects.base, its used by Commit and Tree objects.Sebastian Thiel2009-10-161-0/+71
| | | | Diff class has been prepared to process raw input, but its not yet more than a frame
* Fixed object bug that would cause object ids not to be resolved to sha's as ↵Sebastian Thiel2009-10-161-12/+20
| | | | | | this was assumed - now there is a test for it as well repo: removed diff and commit_diff methods, added 'head' property returning the current head as Reference object
* Object can now create objects of the proper type in case one attempts to ↵Sebastian Thiel2009-10-151-0/+15
| | | | create an object directly - this feature is used in several places now, allowing for additional type-checking
* tree: now reads tress directly by parsing the binary data, allowing it to ↵Sebastian Thiel2009-10-141-3/+4
| | | | safe possibly hundreds of command calls
* persistent command signature changed to also return the hexsha from a ↵Sebastian Thiel2009-10-141-2/+2
| | | | possible input ref - the objects pointed to by refs are now baked on demand - perhaps it should change to always be re-retrieved using a property as it is relatively fast - this way refs can always be cached
* test_blob: removed many redundant tests that would fail now as the mock ↵Sebastian Thiel2009-10-141-2/+6
| | | | | | cannot handle the complexity of the command backend All objects but Tree now use the persistent command to read their object information - Trees get binary data and would need their own pretty-printing or they need to parse the data themselves which is my favorite
* test: Added time-consuming test which could also be a benchmark in fact - ↵Sebastian Thiel2009-10-141-1/+1
| | | | | | | currently it cause hundreds of command invocations which is slow Fixed issue with trees not properly initialized with their default mode _set_cache_: some objects checked whether the attribute was within their __slots__ although it should have been accessed through its class
* IndexObjects are now checking their slots to raise a proper error message in ↵Sebastian Thiel2009-10-121-1/+8
| | | | case someone tries to access an unset path or mode - this information cannot be retrieved afterwards as IndexObject information is kept in the object that pointed at them. To find this information, one would have to search all objects which is not feasible
* refs now take repo as first argument and derive from LazyMixin to allow them ↵Sebastian Thiel2009-10-121-24/+1
| | | | | | to dynamically retrieve their objects Improved way commits are returned by refs as they now use the path to be sure they always point to the ref even if it changes - previously it would use the sha intead so it would not update after being cached on the ref object
* Reorganized package structure and cleaned up importsSebastian Thiel2009-10-121-0/+162