codeinn / vcs

Various version Control System management abstraction layer for python.
http://pypi.python.org/pypi/vcs
MIT License
67 stars 20 forks source link

Repository's .revisions, __getslice__, __getitem__ and .get_changesets methods changes #44

Closed lukaszb closed 13 years ago

lukaszb commented 13 years ago

As a general idea, in git when You iterate the log, it shows You only log for current (e.g. master) branch. This is much different than what mercurial is showing.

My proposal is to add, 'getiterator(branch=None)' function that will generate iterator function for mercurial repository and will iterate only on revision for passed branch parameter. That would be a nice addition to next/prev functions of changeset.


Reference: https://bitbucket.org/marcinkuzminski/vcs/issues/44/

lukaszb commented 13 years ago

revisions

get_changesets

Synpisis:

get_changesets(start=None, end=None, start_date=None, end_date=None,
                     branch_name=None, reversed=False)

getslice

getitem

marcinkuzminski commented 13 years ago

From what i have read here:http://mercurial.selenic.com/wiki/ChangeSetID short_id(12 hex) should not be considered a valid long term identifier,so i'm proposing to forbid passing short_id as for getting changesets eg. get_changeset, or slicing. It might explode one day...

That should be left just for human readable representation

marcinkuzminski commented 13 years ago

On the other hand, after a talk with mercurial crew I'll make an algorithm that will lookup raw id based in short id since it;s unlikely to have such collision just in one repo.

lukaszb commented 13 years ago

Done at both hg and git backends, all tests passes.