Commit bc3f54d5e62 by Georges Racinet

Merge from heptapod-0-7

Should have been in heptapod-0.8.0. The only issue
missing is heptapod#133

--HG--
branch : heptapod-0-8
Pipeline #2497 failed with stage
in 5 minutes 11 seconds
......@@ -40,6 +40,7 @@ d8654f5888efc276d507d22a67fbd4a858c85b3f heptapod-0.6.0
5b9cb9071024d7646981454c4396ee8a6ad3c6ee heptapod-0.6.1
68e1cb7f5d1d207f08d6d5476f6c12541f3c7c93 heptapod-0.6.2
eafaf29c48d1ad288fb63f1303e289be27db668a heptapod-0.7.0
0d8156d530bd27af047ab020c94ee1a5515f8480 heptapod-0.7.1
9a735c2eb935ab3414690fe5569de64c2c85fa2a heptapod-0.8.0rc1
6dbe7d60e6696b5057cd0f76ea9cd206524370f2 heptapod-0.8.0rc2
777b1524df15027ea8751fab061a351c628bd54c heptapod-0.8.0rc3
......
......@@ -95,6 +95,7 @@ CONFIG_DEFAULTS = {
'experimental': {
'hg-git.export-named-branches': False,
'hg-git.bookmarks-on-named-branches': False,
'hg-git.accept-slash-in-topic-name': False,
'hg-git.prune-newly-closed-branches': True,
'hg-git.prune-previously-closed-branches': True,
},
......
......@@ -1612,7 +1612,7 @@ class GitHandler(object):
if not ref.startswith('refs/heads/topic'):
continue
branch, topic = ref.split('/', 3)[3].split('/')
branch, topic = ref.split('/', 3)[3].rsplit('/', 1)
oldhgsha = self.map_hg_get(oldgitsha)
newgitsha = new_refs.get(ref)
if newgitsha is None:
......@@ -1865,7 +1865,21 @@ class GitHandler(object):
"""
topbranch = topbranch.replace(' ', '_')
if ':' in topbranch:
return 'topic/' + topbranch.replace(':', '/')
branch, topic = topbranch.split(':', 1)
if '/' in topic:
msg = "Invalid character '/' in topic name %r. " % topic
if self.ui.configbool('experimental',
'hg-git.accept-slash-in-topic-name'):
msg += ("Replacing with '-'. Rename before publishing or "
"you'll get serious problems.")
topic = topic.replace('/', '-')
self.ui.status(msg)
self.ui.warn(msg)
else:
self.ui.status(msg)
raise error.Abort(msg)
return '/'.join(('topic', branch, topic))
return 'branch/' + topbranch
def is_hg_specific_ref(self, ref):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment