Mercurial > evolve
comparison hgext/evolve.py @ 1536:9afe9e0191a1
evolve: evolve --divergent failed when merge had nothing to do (issue4950)
Before this patch, if the divergence resolution lead to an empty commit, the
transaction would be rolled back and the divergence not resolved.
This patch allows empty commits in that case. It is legitimate to end up with
an empty commit in that case, for example when divergent commits differ over
their commit messages.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Tue, 17 Nov 2015 17:06:07 -0800 |
parents | 48547b4c77de |
children | 425c0700aabd |
comparison
equal
deleted
inserted
replaced
1535:f6d10432499d | 1536:9afe9e0191a1 |
---|---|
2006 /!\ * hg revert --all -r X | 2006 /!\ * hg revert --all -r X |
2007 /!\ * hg ci -m "same message as the amended changeset" => new cset Y | 2007 /!\ * hg ci -m "same message as the amended changeset" => new cset Y |
2008 /!\ * hg kill -n Y W Z | 2008 /!\ * hg kill -n Y W Z |
2009 """) | 2009 """) |
2010 if progresscb: progresscb() | 2010 if progresscb: progresscb() |
2011 emtpycommitallowed = repo.ui.backupconfig('ui', 'allowemptycommit') | |
2011 tr = repo.transaction('stabilize-divergent') | 2012 tr = repo.transaction('stabilize-divergent') |
2012 try: | 2013 try: |
2014 repo.ui.setconfig('ui', 'allowemptycommit', True) | |
2013 repo.dirstate.beginparentchange() | 2015 repo.dirstate.beginparentchange() |
2014 repo.dirstate.setparents(divergent.node(), node.nullid) | 2016 repo.dirstate.setparents(divergent.node(), node.nullid) |
2015 repo.dirstate.endparentchange() | 2017 repo.dirstate.endparentchange() |
2016 oldlen = len(repo) | 2018 oldlen = len(repo) |
2017 amend(ui, repo, message='', logfile='') | 2019 amend(ui, repo, message='', logfile='') |
2022 new = repo['.'] | 2024 new = repo['.'] |
2023 obsolete.createmarkers(repo, [(other, (new,))]) | 2025 obsolete.createmarkers(repo, [(other, (new,))]) |
2024 phases.retractboundary(repo, tr, other.phase(), [new.node()]) | 2026 phases.retractboundary(repo, tr, other.phase(), [new.node()]) |
2025 tr.close() | 2027 tr.close() |
2026 finally: | 2028 finally: |
2029 repo.ui.restoreconfig(emtpycommitallowed) | |
2027 tr.release() | 2030 tr.release() |
2028 | 2031 |
2029 def divergentdata(ctx): | 2032 def divergentdata(ctx): |
2030 """return base, other part of a conflict | 2033 """return base, other part of a conflict |
2031 | 2034 |