ShuffleBox / django-rcsfield

Automatically exported from code.google.com/p/django-rcsfield
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

GitBackend: get_revisions returns reivisions sorted incorrectly #9

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
http://code.google.com/p/django-rcsfield/source/browse/trunk/rcsfield/backends/g
itcore.py#78

I assume that get_revisions should return the latest commits - sorted by
date of commit (new commits first, old commits last) ... right now it's
sorting on commit id? For me this is unexpected... repo.log(path=key)
already returns the commits in sorted order...

Fix something like this:

def get_revisions(self, key):
    """
    returns a list with all revisions at which ``key`` was changed.
    Revision Numbers are integers starting at 1.

    """
    repo = Repo(self.repo_path)
    crevs = [r.id for r in repo.log(path=key)]
    # crevs.sort(reverse=True)
    return crevs[1:] # cut off the head revision-number

Original issue reported on code.google.com by bisha...@gmail.com on 17 Dec 2008 at 5:12

GoogleCodeExporter commented 9 years ago
Your assumption is correct. It should return commit-ids sorted with new commits 
first
and old commits last.
Thank you for reporting.

Original comment by a...@rcs4u.de on 17 Dec 2008 at 6:32

GoogleCodeExporter commented 9 years ago

Original comment by leidel on 17 Dec 2008 at 6:35

GoogleCodeExporter commented 9 years ago
Fixed in r71

Original comment by leidel on 4 Mar 2009 at 9:20