Same reasoning as previous patch.
Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Same reasoning as previous patch.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/copies.py (23 lines) | |||
M | tests/test-graft.t (6 lines) | |||
M | tests/test-rebase-conflicts.t (4 lines) | |||
M | tests/test-up-local-change.t (2 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | Apr 13 2019, 12:41 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
if debug: | if debug: | ||||
repo.ui.debug('debug.copies: search mode: backward\n') | repo.ui.debug('debug.copies: search mode: backward\n') | ||||
return _backwardrenames(x, y, match=match) | return _backwardrenames(x, y, match=match) | ||||
if debug: | if debug: | ||||
repo.ui.debug('debug.copies: search mode: combined\n') | repo.ui.debug('debug.copies: search mode: combined\n') | ||||
return _chain(x, y, _backwardrenames(x, a, match=match), | return _chain(x, y, _backwardrenames(x, a, match=match), | ||||
_forwardcopies(a, y, match=match)) | _forwardcopies(a, y, match=match)) | ||||
def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, baselabel=''): | def _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, debug=True): | ||||
"""Computes, based on addedinm1 and addedinm2, the files exclusive to c1 | """Computes, based on addedinm1 and addedinm2, the files exclusive to c1 | ||||
and c2. This is its own function so extensions can easily wrap this call | and c2. This is its own function so extensions can easily wrap this call | ||||
to see what files mergecopies is about to process. | to see what files mergecopies is about to process. | ||||
Even though c1 and c2 are not used in this function, they are useful in | Even though c1 and c2 are not used in this function, they are useful in | ||||
other extensions for being able to read the file nodes of the changed files. | other extensions for being able to read the file nodes of the changed files. | ||||
"baselabel" can be passed to help distinguish the multiple computations | |||||
done in the graft case. | |||||
""" | """ | ||||
u1 = sorted(addedinm1 - addedinm2) | u1 = sorted(addedinm1 - addedinm2) | ||||
u2 = sorted(addedinm2 - addedinm1) | u2 = sorted(addedinm2 - addedinm1) | ||||
if debug: | |||||
header = " unmatched files in %s" | header = " unmatched files in %s" | ||||
if baselabel: | |||||
header += ' (from %s)' % baselabel | |||||
if u1: | if u1: | ||||
repo.ui.debug("%s:\n %s\n" % (header % 'local', "\n ".join(u1))) | repo.ui.debug("%s:\n %s\n" % (header % 'local', "\n ".join(u1))) | ||||
if u2: | if u2: | ||||
repo.ui.debug("%s:\n %s\n" % (header % 'other', "\n ".join(u2))) | repo.ui.debug("%s:\n %s\n" % (header % 'other', "\n ".join(u2))) | ||||
return u1, u2 | return u1, u2 | ||||
def _makegetfctx(ctx): | def _makegetfctx(ctx): | ||||
"""return a 'getfctx' function suitable for _checkcopies usage | """return a 'getfctx' function suitable for _checkcopies usage | ||||
We have to re-setup the function building 'filectx' for each | We have to re-setup the function building 'filectx' for each | ||||
'_checkcopies' to ensure the linkrev adjustment is properly setup for | '_checkcopies' to ensure the linkrev adjustment is properly setup for | ||||
addedinm2 = m2.filesnotin(mb, repo.narrowmatch()) | addedinm2 = m2.filesnotin(mb, repo.narrowmatch()) | ||||
bothnew = sorted(addedinm1 & addedinm2) | bothnew = sorted(addedinm1 & addedinm2) | ||||
if tca == base: | if tca == base: | ||||
# unmatched file from base | # unmatched file from base | ||||
u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2) | u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2) | ||||
u1u, u2u = u1r, u2r | u1u, u2u = u1r, u2r | ||||
else: | else: | ||||
# unmatched file from base (DAG rotation in the graft case) | # unmatched file from base (DAG rotation in the graft case) | ||||
u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2, | u1r, u2r = _computenonoverlap(repo, c1, c2, addedinm1, addedinm2) | ||||
baselabel='base') | |||||
# unmatched file from topological common ancestors (no DAG rotation) | # unmatched file from topological common ancestors (no DAG rotation) | ||||
# need to recompute this for directory move handling when grafting | # need to recompute this for directory move handling when grafting | ||||
mta = tca.manifest() | mta = tca.manifest() | ||||
u1u, u2u = _computenonoverlap(repo, c1, c2, | u1u, u2u = _computenonoverlap(repo, c1, c2, | ||||
m1.filesnotin(mta, repo.narrowmatch()), | m1.filesnotin(mta, repo.narrowmatch()), | ||||
m2.filesnotin(mta, repo.narrowmatch()), | m2.filesnotin(mta, repo.narrowmatch()), | ||||
baselabel='topological common ancestor') | debug=False) | ||||
for f in u1u: | for f in u1u: | ||||
_checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1) | _checkcopies(c1, c2, f, base, tca, dirtyc1, limit, data1) | ||||
for f in u2u: | for f in u2u: | ||||
_checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2) | _checkcopies(c2, c1, f, base, tca, dirtyc2, limit, data2) | ||||
copy = dict(data1['copy']) | copy = dict(data1['copy']) |
my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622 | my b@ef0ef43d49e7+ other a@5d205f8b35b6 ancestor a@68795b066622 | ||||
premerge successful | premerge successful | ||||
committing files: | committing files: | ||||
b | b | ||||
committing manifest | committing manifest | ||||
committing changelog | committing changelog | ||||
updating the branch cache | updating the branch cache | ||||
grafting 5:97f8bfe72746 "5" | grafting 5:97f8bfe72746 "5" | ||||
unmatched files in other (from topological common ancestor): | |||||
c | |||||
resolving manifests | resolving manifests | ||||
branchmerge: True, force: True, partial: False | branchmerge: True, force: True, partial: False | ||||
ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746 | ancestor: 4c60f11aa304, local: 6b9e5368ca4e+, remote: 97f8bfe72746 | ||||
e: remote is newer -> g | e: remote is newer -> g | ||||
getting e | getting e | ||||
committing files: | committing files: | ||||
e | e | ||||
committing manifest | committing manifest | ||||
committing changelog | committing changelog | ||||
updating the branch cache | updating the branch cache | ||||
$ HGEDITOR=cat hg graft 4 3 --log --debug | $ HGEDITOR=cat hg graft 4 3 --log --debug | ||||
scanning for duplicate grafts | scanning for duplicate grafts | ||||
grafting 4:9c233e8e184d "4" | grafting 4:9c233e8e184d "4" | ||||
unmatched files in other (from topological common ancestor): | |||||
c | |||||
resolving manifests | resolving manifests | ||||
branchmerge: True, force: True, partial: False | branchmerge: True, force: True, partial: False | ||||
ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d | ancestor: 4c60f11aa304, local: 1905859650ec+, remote: 9c233e8e184d | ||||
preserving e for resolve of e | preserving e for resolve of e | ||||
d: remote is newer -> g | d: remote is newer -> g | ||||
getting d | getting d | ||||
e: versions differ -> m (premerge) | e: versions differ -> m (premerge) | ||||
picked tool ':merge' for e (binary False symlink False changedelete False) | picked tool ':merge' for e (binary False symlink False changedelete False) | ||||
user: foo | user: foo | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: 2 | summary: 2 | ||||
... grafts of grafts unfortunately can't | ... grafts of grafts unfortunately can't | ||||
$ hg graft -q 13 --debug | $ hg graft -q 13 --debug | ||||
scanning for duplicate grafts | scanning for duplicate grafts | ||||
grafting 13:7a4785234d87 "2" | grafting 13:7a4785234d87 "2" | ||||
unmatched files in other (from topological common ancestor): | |||||
g | |||||
unmatched files new in both: | unmatched files new in both: | ||||
b | b | ||||
all copies found (* = to merge, ! = divergent, % = renamed and deleted): | all copies found (* = to merge, ! = divergent, % = renamed and deleted): | ||||
src: 'a' -> dst: 'b' * | src: 'a' -> dst: 'b' * | ||||
checking for directory renames | checking for directory renames | ||||
resolving manifests | resolving manifests | ||||
branchmerge: True, force: True, partial: False | branchmerge: True, force: True, partial: False | ||||
ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87 | ancestor: b592ea63bb0c, local: 7e61b508e709+, remote: 7a4785234d87 |
branchmerge: False, force: True, partial: False | branchmerge: False, force: True, partial: False | ||||
ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b | ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b | ||||
f2.txt: other deleted -> r | f2.txt: other deleted -> r | ||||
removing f2.txt | removing f2.txt | ||||
f1.txt: remote created -> g | f1.txt: remote created -> g | ||||
getting f1.txt | getting f1.txt | ||||
merge against 9:e31216eec445 | merge against 9:e31216eec445 | ||||
detach base 8:8e4e2c1a07ae | detach base 8:8e4e2c1a07ae | ||||
unmatched files in other (from topological common ancestor): | |||||
f2.txt | |||||
resolving manifests | resolving manifests | ||||
branchmerge: True, force: True, partial: False | branchmerge: True, force: True, partial: False | ||||
ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445 | ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445 | ||||
f1.txt: remote is newer -> g | f1.txt: remote is newer -> g | ||||
getting f1.txt | getting f1.txt | ||||
committing files: | committing files: | ||||
f1.txt | f1.txt | ||||
committing manifest | committing manifest | ||||
committing changelog | committing changelog | ||||
updating the branch cache | updating the branch cache | ||||
rebased as 19c888675e13 | rebased as 19c888675e13 | ||||
rebase status stored | rebase status stored | ||||
rebasing 10:2f2496ddf49d "merge" (tip) | rebasing 10:2f2496ddf49d "merge" (tip) | ||||
future parents are 11 and 7 | future parents are 11 and 7 | ||||
already in destination | already in destination | ||||
merge against 10:2f2496ddf49d | merge against 10:2f2496ddf49d | ||||
detach base 9:e31216eec445 | detach base 9:e31216eec445 | ||||
unmatched files in other (from topological common ancestor): | |||||
f2.txt | |||||
resolving manifests | resolving manifests | ||||
branchmerge: True, force: True, partial: False | branchmerge: True, force: True, partial: False | ||||
ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d | ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d | ||||
f1.txt: remote is newer -> g | f1.txt: remote is newer -> g | ||||
getting f1.txt | getting f1.txt | ||||
committing files: | committing files: | ||||
f1.txt | f1.txt | ||||
committing manifest | committing manifest |
changeset: 1:1e71731e6fbb | changeset: 1:1e71731e6fbb | ||||
tag: tip | tag: tip | ||||
user: test | user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: 2 | summary: 2 | ||||
$ hg --debug up 0 | $ hg --debug up 0 | ||||
starting 4 threads for background file closing (?) | starting 4 threads for background file closing (?) | ||||
unmatched files in local (from topological common ancestor): | |||||
b | |||||
resolving manifests | resolving manifests | ||||
branchmerge: False, force: False, partial: False | branchmerge: False, force: False, partial: False | ||||
ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a | ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a | ||||
preserving a for resolve of a | preserving a for resolve of a | ||||
b: other deleted -> r | b: other deleted -> r | ||||
removing b | removing b | ||||
starting 4 threads for background file closing (?) | starting 4 threads for background file closing (?) | ||||
a: versions differ -> m (premerge) | a: versions differ -> m (premerge) |