comparison hggit/git_handler.py @ 1009:e810b2e186f3

githandler: replace ref with bookmark Mercurial users are using bookmarks to represent git refs, so when we are unable to push a git ref to remote, we need to tell the hg user to add a bookmark (something they understand), instead of mentioning a ref (which is a foreign concept to them).
author timeless@gmail.com
date Tue, 01 Nov 2016 22:20:03 +0000
parents 4fa1812d1f24
children a4f4f861fc5e
comparison
equal deleted inserted replaced
1008:4fa1812d1f24 1009:e810b2e186f3
1030 else: 1030 else:
1031 exportable = {} 1031 exportable = {}
1032 for rev in (hex(r) for r in revs): 1032 for rev in (hex(r) for r in revs):
1033 if rev not in all_exportable: 1033 if rev not in all_exportable:
1034 raise hgutil.Abort("revision %s cannot be pushed since" 1034 raise hgutil.Abort("revision %s cannot be pushed since"
1035 " it doesn't have a ref" % 1035 " it doesn't have a bookmark" %
1036 self.repo[rev]) 1036 self.repo[rev])
1037 exportable[rev] = all_exportable[rev] 1037 exportable[rev] = all_exportable[rev]
1038 return self.get_changed_refs(refs, exportable, force) 1038 return self.get_changed_refs(refs, exportable, force)
1039 1039
1040 def genpack(have, want): 1040 def genpack(have, want):
1118 unfiltered = self.repo.unfiltered() 1118 unfiltered = self.repo.unfiltered()
1119 for rev, rev_refs in exportable.iteritems(): 1119 for rev, rev_refs in exportable.iteritems():
1120 ctx = self.repo[rev] 1120 ctx = self.repo[rev]
1121 if not rev_refs: 1121 if not rev_refs:
1122 raise hgutil.Abort("revision %s cannot be pushed since" 1122 raise hgutil.Abort("revision %s cannot be pushed since"
1123 " it doesn't have a ref" % ctx) 1123 " it doesn't have a bookmark" % ctx)
1124 1124
1125 # Check if the tags the server is advertising are annotated tags, 1125 # Check if the tags the server is advertising are annotated tags,
1126 # by attempting to retrieve it from the our git repo, and building 1126 # by attempting to retrieve it from the our git repo, and building
1127 # a list of these tags. 1127 # a list of these tags.
1128 # 1128 #