mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
da0b66a8ec
Summary: This solves an issue vipannalla saw that the heuristics logic behaves incorrectly when running `hg up -C c4a88583; hg graft 23001ead`. The file `great_persons_on_ex_civilization-inl.h` would be marked as "unresolved" and removed from the working copy potentially due to other mergedriver actions, while it should be merged cleanly and do not appear in mergestate at all. After debugging, the file was only renamed on one side, and not changed on the other side. In the heuristics code path, the file was reported as copied and confused the callsite. Reviewed By: singhsrb Differential Revision: D14195031 fbshipit-source-id: 0602fd56b75219f851c0175debfe72c4d49d652d
54 lines
1.1 KiB
Perl
54 lines
1.1 KiB
Perl
With copied file using the heuristics copytracing:
|
|
|
|
$ enable mergedriver
|
|
|
|
$ newrepo
|
|
$ enable copytrace amend
|
|
$ setconfig copytrace.draftusefullcopytrace=0 experimental.copytrace=off copytrace.fastcopytrace=1 experimental.mergedriver=python:$TESTTMP/m.py
|
|
|
|
$ drawdag << 'EOS'
|
|
> B C
|
|
> |/
|
|
> A
|
|
> |
|
|
> Z
|
|
> EOS
|
|
|
|
$ cat > $TESTTMP/m.py << EOF
|
|
> def preprocess(ui, repo, hooktype, mergestate, wctx, labels):
|
|
> ui.write("unresolved: %r\n" % (sorted(mergestate.unresolved())))
|
|
> def conclude(ui, repo, hooktype, mergestate, wctx, labels):
|
|
> pass
|
|
> EOF
|
|
|
|
$ hg up -q $B
|
|
(trigger amend copytrace code path)
|
|
$ hg cp A D
|
|
$ hg cp A E
|
|
$ hg amend -m B2 -d '0 0'
|
|
$ hg bookmark -i book-B
|
|
|
|
Do the merge:
|
|
|
|
$ hg up -q $C
|
|
$ hg graft book-B
|
|
grafting 4:b55db8435dc2 "B2" (tip book-B)
|
|
|
|
$ hg status
|
|
$ hg log -r . -T '{desc}\n' --stat
|
|
B2
|
|
B | 1 +
|
|
D | 1 +
|
|
E | 1 +
|
|
3 files changed, 3 insertions(+), 0 deletions(-)
|
|
|
|
|
|
Run again with heuristics copytrace disabled:
|
|
|
|
$ setconfig extensions.copytrace=! experimental.copytrace=on copytrace.fastcopytrace=0
|
|
|
|
$ hg up -q $C
|
|
$ hg graft book-B
|
|
grafting 4:b55db8435dc2 "B2" (book-B)
|
|
|