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

Git backend seems to have trouble with the latest version of git-python? #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Looking at the fetch function in gitcore.py -

http://code.google.com/p/django-rcsfield/source/browse/trunk/rcsfield/backends/g
itcore.py#45

    def fetch(self, key, rev):
        """
        fetch revision ``rev`` of entity identified by ``key``.

        """
        repo = Repo(self.repo_path)
        try:
            return repo.tree/key.data
        except:
            ...

`Rev` is not used ... and this will hit the except clause everytime
returning '' ...

Here is a quick hack fix:

    def fetch(self, key, rev):
        """
        fetch revision ``rev`` of entity identified by ``key``.

        """
        repo = Repo(self.repo_path)
        try:
            bits = key.split('/')
            tree = repo.tree(rev)
            for bit in bits:
                tree = tree/bit
            else:
                return tree.data
        except:
            return ''

Original issue reported on code.google.com by bisha...@gmail.com on 16 Dec 2008 at 11:33

GoogleCodeExporter commented 9 years ago
Hi bishanty,

thanks for reporting this issue, we will have a look at it asap.

arne

Original comment by a...@rcs4u.de on 17 Dec 2008 at 4:10

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago
Fixed in r69

Original comment by leidel on 3 Mar 2009 at 9:46