Mercurial > hg
comparison hgext/shelve.py @ 37967:7932be8b0559
shelve: reduce scope of merge tool config override
The config override seems to have a much greater scope than it needed
to. I *think* it's only relevant in the while merging files. The
rebase step also cares about the merge tool, but we seem to be
explicitly passing it to rebase (around line 755).
Differential Revision: https://phab.mercurial-scm.org/D3517
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 07 May 2018 16:49:31 -0700 |
parents | 678d760c71ff |
children | 61e4cf1be5b2 |
comparison
equal
deleted
inserted
replaced
37966:f81a51d8fedf | 37967:7932be8b0559 |
---|---|
931 # where tmpwctx is an optional commit with the user's pending changes | 931 # where tmpwctx is an optional commit with the user's pending changes |
932 # and shelvectx is the unshelved changes. Then we merge it all down | 932 # and shelvectx is the unshelved changes. Then we merge it all down |
933 # to the original pctx. | 933 # to the original pctx. |
934 | 934 |
935 activebookmark = _backupactivebookmark(repo) | 935 activebookmark = _backupactivebookmark(repo) |
936 tmpwctx, addedbefore = _commitworkingcopychanges(ui, repo, opts, | |
937 tmpwctx) | |
938 repo, shelvectx = _unshelverestorecommit(ui, repo, basename) | |
939 _checkunshelveuntrackedproblems(ui, repo, shelvectx) | |
940 branchtorestore = '' | |
941 if shelvectx.branch() != shelvectx.p1().branch(): | |
942 branchtorestore = shelvectx.branch() | |
943 | |
944 shelvectx = _rebaserestoredcommit(ui, repo, opts, tr, oldtiprev, | |
945 basename, pctx, tmpwctx, | |
946 shelvectx, branchtorestore, | |
947 activebookmark) | |
936 overrides = {('ui', 'forcemerge'): opts.get('tool', '')} | 948 overrides = {('ui', 'forcemerge'): opts.get('tool', '')} |
937 with ui.configoverride(overrides, 'unshelve'): | 949 with ui.configoverride(overrides, 'unshelve'): |
938 tmpwctx, addedbefore = _commitworkingcopychanges(ui, repo, opts, | |
939 tmpwctx) | |
940 repo, shelvectx = _unshelverestorecommit(ui, repo, basename) | |
941 _checkunshelveuntrackedproblems(ui, repo, shelvectx) | |
942 branchtorestore = '' | |
943 if shelvectx.branch() != shelvectx.p1().branch(): | |
944 branchtorestore = shelvectx.branch() | |
945 | |
946 shelvectx = _rebaserestoredcommit(ui, repo, opts, tr, oldtiprev, | |
947 basename, pctx, tmpwctx, | |
948 shelvectx, branchtorestore, | |
949 activebookmark) | |
950 mergefiles(ui, repo, pctx, shelvectx) | 950 mergefiles(ui, repo, pctx, shelvectx) |
951 restorebranch(ui, repo, branchtorestore) | 951 restorebranch(ui, repo, branchtorestore) |
952 _forgetunknownfiles(repo, shelvectx, addedbefore) | 952 _forgetunknownfiles(repo, shelvectx, addedbefore) |
953 | 953 |
954 shelvedstate.clear(repo) | 954 shelvedstate.clear(repo) |
955 _finishunshelve(repo, oldtiprev, tr, activebookmark) | 955 _finishunshelve(repo, oldtiprev, tr, activebookmark) |
956 unshelvecleanup(ui, repo, basename, opts) | 956 unshelvecleanup(ui, repo, basename, opts) |
957 finally: | 957 finally: |
958 if tr: | 958 if tr: |
959 tr.release() | 959 tr.release() |
960 lockmod.release(lock) | 960 lockmod.release(lock) |
961 | 961 |