Mercurial > hg
comparison tests/test-mv-cp-st-diff.t @ 18136:f23dea2b296e
copies: do not track backward copies, only renames (issue3739)
The inverse of a rename is a rename, but the inverse of a copy is not a copy.
Presenting it as such -- in particular, stuffing it into the same dict as real
copies -- causes bugs because other code starts believing the inverse copies
are real.
The only test whose output changes is test-mv-cp-st-diff.t. When a backwards
status -C command is run where a copy is involved, the inverse copy (which was
hitherto presented as a real copy) is no longer displayed.
Keeping track of inverse copies is useful in some situations -- composability
of diffs, for example, since adding "a" followed by an inverse copy "b" to "a"
is equivalent to a rename "b" to "a". However, representing them would require
a more complex data structure than the same dict in which real copies are also
stored.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Wed, 26 Dec 2012 15:04:07 -0800 |
parents | bc694d78d843 |
children | 243ea5ffdf31 |
comparison
equal
deleted
inserted
replaced
18135:a6fe1b9cc68f | 18136:f23dea2b296e |
---|---|
668 | 668 |
669 # parent to root: | 669 # parent to root: |
670 | 670 |
671 % hg st -C --rev . --rev 0 | 671 % hg st -C --rev . --rev 0 |
672 M a | 672 M a |
673 b | |
674 R b | 673 R b |
675 | 674 |
676 % hg diff --git --rev . --rev 0 | 675 % hg diff --git --rev . --rev 0 |
677 diff --git a/a b/a | 676 diff --git a/a b/a |
678 --- a/a | 677 --- a/a |
726 | 725 |
727 # parent to branch: | 726 # parent to branch: |
728 | 727 |
729 % hg st -C --rev . --rev 2 | 728 % hg st -C --rev . --rev 2 |
730 M a | 729 M a |
731 b | |
732 A x/y | 730 A x/y |
733 R b | 731 R b |
734 | 732 |
735 % hg diff --git --rev . --rev 2 | 733 % hg diff --git --rev . --rev 2 |
736 diff --git a/a b/a | 734 diff --git a/a b/a |
1070 | 1068 |
1071 # parent to root: | 1069 # parent to root: |
1072 | 1070 |
1073 % hg st -C --rev . --rev 0 | 1071 % hg st -C --rev . --rev 0 |
1074 M a | 1072 M a |
1075 b | |
1076 R b | 1073 R b |
1077 R c | 1074 R c |
1078 | 1075 |
1079 % hg diff --git --rev . --rev 0 | 1076 % hg diff --git --rev . --rev 0 |
1080 diff --git a/a b/a | 1077 diff --git a/a b/a |
1146 | 1143 |
1147 # parent to branch: | 1144 # parent to branch: |
1148 | 1145 |
1149 % hg st -C --rev . --rev 2 | 1146 % hg st -C --rev . --rev 2 |
1150 M a | 1147 M a |
1151 b | |
1152 A x/y | 1148 A x/y |
1153 R b | 1149 R b |
1154 R c | 1150 R c |
1155 | 1151 |
1156 % hg diff --git --rev . --rev 2 | 1152 % hg diff --git --rev . --rev 2 |