Mercurial > evolve
comparison hgext3rd/topic/__init__.py @ 3095:7a5941d91fc0 stable
compat: work around the lack of configoverride in mercurial 4.0
The phase preservation will stay broken on 4.0 and below
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 20 Oct 2017 20:58:35 +0200 |
parents | e11e018e8338 |
children | c458c0856ee5 |
comparison
equal
deleted
inserted
replaced
3094:e11e018e8338 | 3095:7a5941d91fc0 |
---|---|
767 date=c.date(), | 767 date=c.date(), |
768 extra=fixedextra) | 768 extra=fixedextra) |
769 | 769 |
770 # phase handling | 770 # phase handling |
771 commitphase = c.phase() | 771 commitphase = c.phase() |
772 overrides = {('phases', 'new-commit'): commitphase} | 772 if util.safehasattr(repo.ui, 'configoverride'): |
773 with repo.ui.configoverride(overrides, 'changetopic'): | 773 overrides = {('phases', 'new-commit'): commitphase} |
774 with repo.ui.configoverride(overrides, 'changetopic'): | |
775 newnode = repo.commitctx(mc) | |
776 else: # do not attempt to preserver phase (hg <= 4.0) | |
774 newnode = repo.commitctx(mc) | 777 newnode = repo.commitctx(mc) |
775 | 778 |
776 successors[c.node()] = (newnode,) | 779 successors[c.node()] = (newnode,) |
777 ui.debug('new node id is %s\n' % node.hex(newnode)) | 780 ui.debug('new node id is %s\n' % node.hex(newnode)) |
778 rewrote += 1 | 781 rewrote += 1 |