changeset 376:b4f5f2729acb

git_handler: update ctx label handling for bookmarks in core
author Augie Fackler <durin42@gmail.com>
date Tue, 01 Mar 2011 08:23:09 -0600
parents 454fc525ac75
children 46d390f404da
files hggit/git_handler.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/git_handler.py
+++ b/hggit/git_handler.py
@@ -570,8 +570,12 @@
 
         for rev in revs:
             ctx = self.repo[rev]
-            heads = [t for t in ctx.tags() if t in self.local_heads()]
-            tags = [t for t in ctx.tags() if t in self.tags]
+            if getattr(ctx, 'bookmarks', None):
+                labels = lambda c: ctx.tags() + ctx.bookmarks()
+            else:
+                labels = lambda c: ctx.tags()
+            heads = [t for t in labels(ctx) if t in self.local_heads()]
+            tags = [t for t in labels(ctx) if t in self.tags]
 
             if not (heads or tags):
                 raise hgutil.Abort("revision %s cannot be pushed since"