D6601: copies: remove most early returns from pathcopies() and _forwardcopies()
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Wed Jul 10 15:39:22 EDT 2019
Closed by commit rHGa48f6f18dc6d: copies: remove most early returns from pathcopies() and _forwardcopies() (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D6601?vs=15745&id=15873
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D6601/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D6601
AFFECTED FILES
mercurial/copies.py
CHANGE DETAILS
diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -326,8 +326,10 @@
if b.rev() is None:
cm = _committedforwardcopies(a, b.p1(), match)
# combine copies from dirstate if necessary
- return _chainandfilter(a, b, cm, _dirstatecopies(b._repo, match))
- return _committedforwardcopies(a, b, match)
+ copies = _chainandfilter(a, b, cm, _dirstatecopies(b._repo, match))
+ else:
+ copies = _committedforwardcopies(a, b, match)
+ return copies
def _backwardrenames(a, b, match):
if a._repo.ui.config('experimental', 'copytrace') == 'off':
@@ -366,15 +368,17 @@
if y.rev() is None and x == y.p1():
# short-circuit to avoid issues with merge states
return _dirstatecopies(repo, match)
- return _forwardcopies(x, y, match=match)
- if a == y:
+ copies = _forwardcopies(x, y, match=match)
+ elif a == y:
if debug:
repo.ui.debug('debug.copies: search mode: backward\n')
- return _backwardrenames(x, y, match=match)
- if debug:
- repo.ui.debug('debug.copies: search mode: combined\n')
- return _chainandfilter(x, y, _backwardrenames(x, a, match=match),
- _forwardcopies(a, y, match=match))
+ copies = _backwardrenames(x, y, match=match)
+ else:
+ if debug:
+ repo.ui.debug('debug.copies: search mode: combined\n')
+ copies = _chainandfilter(x, y, _backwardrenames(x, a, match=match),
+ _forwardcopies(a, y, match=match))
+ return copies
def mergecopies(repo, c1, c2, base):
"""
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list