changeset 344:af48a5961432

Add just enough code to handle changes to cset discovery.
author Augie Fackler <durin42@gmail.com>
date Sat, 12 Jun 2010 21:49:14 -0500 (2010-06-13)
parents 56f55c7733db
children 843d4397dee8
files hggit/__init__.py hggit/gitrepo.py
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py
+++ b/hggit/__init__.py
@@ -103,6 +103,20 @@
     return ret
 extensions.wrapfunction(localrepo.localrepository, 'nodetags', sortednodetags)
 
+try:
+    from mercurial import discovery
+    def findoutgoing(orig, local, remote, base=None, heads=None, force=False):
+        if isinstance(remote, gitrepo.gitrepo):
+            git = GitHandler(local, local.ui)
+            base, heads = git.get_refs(remote.path)
+            r = orig(local, remote, base=base, heads=heads,
+                        force=force)
+            return [x[0] for x in r]
+        return orig(local, remote, base=base, heads=heads, force=force)
+    extensions.wrapfunction(discovery, 'findoutgoing', findoutgoing)
+except ImportError:
+    pass
+
 cmdtable = {
   "gimport":
         (gimport, [], _('hg gimport')),
--- a/hggit/gitrepo.py
+++ b/hggit/gitrepo.py
@@ -19,6 +19,8 @@
     def local(self):
         if not self.path:
             raise RepoError
+    def heads(self):
+        return []
 
 
 instance = gitrepo