hgext/convert/git.py
changeset 4768 f52bfe566583
parent 4767 2d0a823cbba5
child 4807 15a3cbfc6568
equal deleted inserted replaced
4767:2d0a823cbba5 4768:f52bfe566583
    18         self.ui = ui
    18         self.ui = ui
    19         self.rev = rev
    19         self.rev = rev
    20         self.encoding = 'utf-8'
    20         self.encoding = 'utf-8'
    21 
    21 
    22     def getheads(self):
    22     def getheads(self):
    23         rev = self.rev or 'HEAD'
    23         if not self.rev:
    24         fh = self.gitcmd("git-rev-parse --verify %s" % rev)
    24             return self.gitcmd('git-rev-parse --branches').read().splitlines()
    25         return [fh.read()[:-1]]
    25         else:
       
    26             fh = self.gitcmd("git-rev-parse --verify %s" % self.rev)
       
    27             return [fh.read()[:-1]]
    26 
    28 
    27     def catfile(self, rev, type):
    29     def catfile(self, rev, type):
    28         if rev == "0" * 40: raise IOError()
    30         if rev == "0" * 40: raise IOError()
    29         fh = self.gitcmd("git-cat-file %s %s 2>/dev/null" % (type, rev))
    31         fh = self.gitcmd("git-cat-file %s %s 2>/dev/null" % (type, rev))
    30         return fh.read()
    32         return fh.read()