summaryrefslogtreecommitdiff
path: root/lib/git/objects
Commit message (Collapse)AuthorAgeFilesLines
...
* GitCmdStreamReader: fixed terrible bug which only kicked in if the stream ↵Sebastian Thiel2010-06-241-1/+2
| | | | | | was actually empty. This is a rare case that can happen during stream testing. Theoretically there shouldn't be any empty streams of course, but practically they do exist sometimes ;); fixed stream.seek implementation, which previously used seek on standard output Improved GitCmd error handling
* fixed critical bug in traverse_trees_recursive, implemented IndexFile.new ↵Sebastian Thiel2010-06-231-1/+1
| | | | including simple test, it may be simple as the methods it uses are throroughly tested
* Initial frame for implementing read_tree using pure python. As git-read-tree ↵Sebastian Thiel2010-06-221-0/+118
| | | | | | | can do much more than we can ( and faster assumably ), the .new method is used to create new index instances from up to 3 trees. Implemented multi-tree traversal to facilitate building a stage list more efficiently ( although I am not sure whether it could be faster to use a dictionary together with some intensive lookup ), including test Added performance to learn how fast certain operations are, and whether one should be preferred over another
* index.write_tree: initial version implemented, although its not yet working ↵Sebastian Thiel2010-06-223-93/+95
| | | | | | | 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
* index: Entries are now using flags internally, instead of reducing the flag ↵Sebastian Thiel2010-06-211-1/+1
| | | | information to just the stage ( just to be closer to the git-original )
* Moved small types that had their own module into the utils moduleSebastian Thiel2010-06-143-7/+65
|
* tree: added TreeModifier, allowing to adjust existing trees safely and or ↵Sebastian Thiel2010-06-144-11/+94
| | | | fast, while staying compatible with serialization which requires it to be sorted
* tree now uses less memory for its cache as it stores the bare deserialized ↵Sebastian Thiel2010-06-141-55/+63
| | | | information - this also speeds up later serialization after changes. its clear though that retrieving actual objects is slower currently as these are not cached anymore. Its worth thinking about moving these encoding, decoding routines to gitdb
* Implemented initial version of tree serialization which appears to work ↵Sebastian Thiel2010-06-142-235/+281
| | | | | | | according to a simple test ( presort still needs implementation ) submodule: added stub to allow the tree to return something, its not implemented though
* Removed odb from project, it is now used as a submodule named gitdb, which ↵Sebastian Thiel2010-06-121-1/+1
| | | | | | was added instead Adjusted all imports to deal with the changed package names
* Fixed implementation after design change to deal with it - all tests run, ↵Sebastian Thiel2010-06-042-9/+12
| | | | but next there will have to be more through testing
* initial version of new odb design to facilitate a channel based ↵Sebastian Thiel2010-06-042-5/+5
| | | | 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-033-22/+49
| | | | | | 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: redesigned revlist and commit parsing, commits are always retrieved ↵Sebastian Thiel2010-06-021-58/+40
| | | | | | from their object information directly. This is faster, and resolves issues with the rev-list format and empty commit messages Adjusted many tests to go with the changes, as they were still mocked. The mock was removed if necessary and replaced by code that actually executes
* commit: refactored existing code to decode commits from streams - ↵Sebastian Thiel2010-06-024-275/+301
| | | | | | | 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-023-510/+679
| | | | objects if it could serialize itself
* IndexFile.add: Fixed incorrect path handling if path rewriting was desired ↵Sebastian Thiel2010-05-111-2/+2
| | | | | | | | and absolute paths were given Commit.create_from_tree: fixed critical bug that would cause it to create a branch named master by default, instead of the reference actually set ( which is master in many, but not all cases ) - in fact it could be detached as well, we would fail ungracefully although we could assume master then ... although we cant really make the decision Repo.is_dirty: improved its abiility to deal with empty repositories and a missing head. Weird thing is that the test always worked fine with the previous code, but it didn't work for me in a similar situation without this change at least
* TODO: Removed all entries but left a mesage about where to find the issuee ↵Sebastian Thiel2010-05-041-1/+1
| | | | | | | on lighthouse. README/intro.rst: added information about the new repository at github tree: added marker to indicate that submodules would have to be returned there
* Add support for time zone information in tags and commits.Rick Copeland2010-04-273-15/+31
| | | | | | | This commit includes - an update to git.objects.utils:parse_actor_and_date to parse the timezone offset - updates to the git.objects.Commit and git.objects.Tag objects to support *_tz_offset attributes - updates to tests in test.git.test_commit and test.git.test_refs to check for appropriate *_tz_offset attributes
* Converted all tabs to 4 space characters each to comply with pep8Sebastian Thiel2010-03-047-1016/+1016
|
* Commit.iter_items: Will not restrict comits to the ones containing changes ↵Sebastian Thiel2010-02-281-1/+6
| | | | | | to paths anymore as it will only append '--' if paths are actually given. Added unittest to verify this
* git.Tree: Fixed critical issue when reading trees from binary data. The ↵Sebastian Thiel2010-02-241-8/+6
| | | | previous version was making assumptions that would only be true for old git repositories it sesms. The new version of the algorithm deals with this gracefully.
* Commit.create: now handles empty repositories correctlySebastian Thiel2010-02-131-2/+15
|
* tree: implemented recursive paths in __div__ and __getitem__ method, ↵Sebastian Thiel2009-12-301-6/+27
| | | | allowing the keys to contain slashes; adjusted test to check for this
* repo: renamed directories to more descriptive identifiers and made them ↵Sebastian Thiel2009-12-031-1/+1
| | | | safer to use in case of bare repositories
* commit.create_from_tree: head will not be advanced anymore as it feels ↵Sebastian Thiel2009-12-011-1/+1
| | | | non-natural when using it
* Traversable.traverse: Added as_edge option allowing to receive the source of ↵Sebastian Thiel2009-11-271-11/+19
| | | | the item as well to enable predicates to do more proper checking
* Fixed issue with commit traversal due to missing visit_once in the traversal ↵Sebastian Thiel2009-11-272-0/+19
| | | | method, improved code performance by disabling the visit-once flag by default for trees, which by nature are not recursive
* ItemTraversal: Predicate and prune functions now provide depth information, ↵Sebastian Thiel2009-11-271-6/+6
| | | | allowing the callee to know more about its environment
* improved performance of item traversal, its nearly as fast as it was with ↵Sebastian Thiel2009-11-271-11/+2
| | | | the first very pure implementation
* tree: added traversal method, adjusted testsSebastian Thiel2009-11-263-41/+19
| | | | Fixed critical bug in object code: IndexObjects now use their path as hashkey, not the data\!
* objects.utils: Added Traversable base and implemented it for commits ↵Sebastian Thiel2009-11-263-1/+91
| | | | including a test
* 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
* commit: added create_from_tree method to untie commit creation from actually ↵Sebastian Thiel2009-11-241-0/+65
| | | | using the current index. This makes it more flexible. For convenience, the index.commit method is still available, it delgates all the work
* Fixed commit.count method which now handles the paths case properly. It ↵Sebastian Thiel2009-11-061-1/+7
| | | | appears git-rev-list uses empty paths in some way, which is quite hard to specify on a shell, but easy if the process is spawned directly
* Added utilities helping to create proper paths either with slashes or ↵Sebastian Thiel2009-11-052-4/+7
| | | | | | | backslashes depending on the operating system fixed test_refs and test_trees Many more issues remain though, this is just a first backup commit
* Improved cmd error handling in case an invalid revision is specified for an ↵Sebastian Thiel2009-11-041-1/+1
| | | | | | object repo.tree: improved to be less restricting
* IndexObject: assured that .path fields are relative to the repository ( ↵Sebastian Thiel2009-11-042-5/+22
| | | | | | 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
* tree: parsing would fail when symlinks where encountered. This has been fixedSebastian Thiel2009-11-041-1/+2
|
* object: renamed id attribute to sha as it in fact is always being rewritten ↵Sebastian Thiel2009-11-035-37/+37
| | | | as sha, even if the passed in id was a ref. This is done to assure objects are uniquely identified and will compare correctly
* Merge branch 'index' into improvementsSebastian Thiel2009-10-263-23/+35
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * index: index.add: Finished implemenation including through tests When parsing trees, we now store the originan type bits as well, previously we dropped it cmd.wait: AutoKill wrapped process will automatically raise on errors to unify error handling amongst clients using the process directly. It might be needed to add a flag allowing to easily override that added head kwarg to reset and commit method, allowing to automatically change the head to the given commit, which makes the methods more versatile refs.SymoblicRef: implemented direcft setting of the symbolic references commit, which possibly dereferences to the respective head index.commit: implemented initial version, but in fact some more changes are required to have a nice API. Tests are not yet fully done either actor: added __eq__, __ne__ and __hash__ methods including simple test index.remove implemented including throrough test Implemented index.reset method including test IndexEntry is now based on a 'minimal' version that is suitable to be fed into UpdateIndex. The Inode and device information is only needed to quickly compare the index against the working tree for changes, hence it should not be that dominant in the API either. More changes to come Added notes about git-update-ref Refs can now set the reference they are pointing to in a controlled fashion by writing their ref file directly Added TagRefernce creation and deletion including tests Implemented head methods: create, delete, rename, including tests refs: added create, delete and rename methods where appropriate. Tests are marked, implementation is needed for most of them Added frame for IndexFile add/remove/commit methods and respective test markers Added repo.index property including simple test, and additional ideas in the TODO list Renamed Index to IndexFile, adjusted tests, it will only operate on physical files, not on streams, as Indices are not streamed by any git command ( at least not in raw format )
| * When parsing trees, we now store the originan type bits as well, previously ↵Sebastian Thiel2009-10-261-8/+9
| | | | | | | | we dropped it
| * actor: added __eq__, __ne__ and __hash__ methods including simple testSebastian Thiel2009-10-241-15/+25
| | | | | | | | commit: Fixed long-standing issue during message parsing that would fail to parse properly in case we were created from data. Also it would strip white space from the messages although it shouldn't
| * index.remove implemented including throrough testSebastian Thiel2009-10-231-0/+1
| |
* | commit.name_rev property added for convenienceSebastian Thiel2009-10-231-0/+9
|/
* Index: Is now diffable and appears to properly implement diffing against ↵Sebastian Thiel2009-10-221-0/+1
| | | | | | | other items as well as the working tree Diff.Diffable: added callback allowing superclasses to preprocess diff arguments Diff.Diff: added eq, ne and hash methods, string methods would be nice
* Merge branch 'index' into improvementsSebastian Thiel2009-10-221-8/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * index: Removed index test marker for custom commits as this boils down to a good way to add files to the index/remove them and make commits which are possibly customized with custom parents index writing now creates a sha on the content making it possible to write valid indices after manually removing or altering entriesgst Implemented merge/resolve handling , but realized that index writing is not yet working properly as it is sha1 checked as well. This explains what my 20 byte 'extension_data' actually is ;) index: Added write_tree method including test index.iter_blobs method added including tests ( which have been improved generally for more coverage ) tree.traverse: Added prune functionality - previously the predciate did both, pruning and preventing to return items Improved testing of index against trees, tests succeed with next commit Initial version of merge including tests for one-way, two-way and tree-way merge index writing added including simple test, improved docs of IndexEntry improved IndexEntry type and added test for parsing of the stage Improved tuple access of EntryIndex class including test, stage and type access still needs to be decoded though Added initial version of the index reading from file - IndexEntry interface is to be improved though, writing needs to be implemented as well Added frame for index implementation and testing
| * tree.traverse: Added prune functionality - previously the predciate did ↵Sebastian Thiel2009-10-211-8/+12
| | | | | | | | both, pruning and preventing to return items