Mercurial > public > mercurial-scm > hg
comparison mercurial/subrepo.py @ 45556:03726f5b6092
merge: use merge.clean_update() when applicable
We have had this higher-level function (higher than `merge.update()`,
that is) for a while. Let's simply some callers by using it. I don't
know why I didn't do this when I introduced the function.
After this patch, there are no remaining callers that call
`hg.updaterepo()` with `overwrite=True`. We'll clean that up soon.
Differential Revision: https://phab.mercurial-scm.org/D9063
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Mon, 21 Sep 2020 10:09:39 -0700 |
parents | 8c466bcb0879 |
children | 5c8230ca37f2 |
comparison
equal
deleted
inserted
replaced
45555:feffeb18d412 | 45556:03726f5b6092 |
---|---|
23 encoding, | 23 encoding, |
24 error, | 24 error, |
25 exchange, | 25 exchange, |
26 logcmdutil, | 26 logcmdutil, |
27 match as matchmod, | 27 match as matchmod, |
28 merge as merge, | |
28 node, | 29 node, |
29 pathutil, | 30 pathutil, |
30 phases, | 31 phases, |
31 pycompat, | 32 pycompat, |
32 scmutil, | 33 scmutil, |
781 urepo.ui.warn( | 782 urepo.ui.warn( |
782 _(b'revision %s in subrepository "%s" is hidden\n') | 783 _(b'revision %s in subrepository "%s" is hidden\n') |
783 % (revision[0:12], self._path) | 784 % (revision[0:12], self._path) |
784 ) | 785 ) |
785 repo = urepo | 786 repo = urepo |
786 hg.updaterepo(repo, revision, overwrite) | 787 if overwrite: |
788 merge.clean_update(repo[revision]) | |
789 else: | |
790 hg.updaterepo(repo, revision, False) | |
787 | 791 |
788 @annotatesubrepoerror | 792 @annotatesubrepoerror |
789 def merge(self, state): | 793 def merge(self, state): |
790 self._get(state) | 794 self._get(state) |
791 cur = self._repo[b'.'] | 795 cur = self._repo[b'.'] |