convert: import all branches from git repositories
authorBrendan Cully <brendan@kublai.com>
Sun, 01 Jul 2007 22:00:25 -0700
changeset 4768 f52bfe566583
parent 4767 2d0a823cbba5
child 4769 81b170c41986
convert: import all branches from git repositories
hgext/convert/git.py
--- a/hgext/convert/git.py	Sun Jul 01 21:09:08 2007 -0700
+++ b/hgext/convert/git.py	Sun Jul 01 22:00:25 2007 -0700
@@ -20,9 +20,11 @@
         self.encoding = 'utf-8'
 
     def getheads(self):
-        rev = self.rev or 'HEAD'
-        fh = self.gitcmd("git-rev-parse --verify %s" % rev)
-        return [fh.read()[:-1]]
+        if not self.rev:
+            return self.gitcmd('git-rev-parse --branches').read().splitlines()
+        else:
+            fh = self.gitcmd("git-rev-parse --verify %s" % self.rev)
+            return [fh.read()[:-1]]
 
     def catfile(self, rev, type):
         if rev == "0" * 40: raise IOError()