annotate tests/test-git-export.t @ 44574:5205b46bd887

fix: add a -s option to format a revision and its descendants `hg fix -r abc123` will format that commit but not its descendants. That seems expected given the option name (`-r`), but it's very rarely what the user wants to do. The problem is that any descendants of that commit will not be formatted, leaving them as orphans that are hard to evolve. They are hard to evolve because the new parent will have formatting changes that the orphan doesn't have. I talked to Danny Hooper (who wrote most of the fix extension) about the problem and we agreed that deprecating `-r` in favor of a new `-s` argument (mimicing rebase's `-s`) would be a good way of reducing the risk that users end up with these hard-to-evolve orphans. So that's what this patch implements. Differential Revision: https://phab.mercurial-scm.org/D8287
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 13 Mar 2020 12:16:00 -0700
parents 4441705b7111
children 0492002560f3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
1 $ hg init
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
2 $ echo start > start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
3 $ hg ci -Amstart
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
4 adding start
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
5
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
6 New file:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
7
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
8 $ mkdir dir1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
9 $ echo new > dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
10 $ hg ci -Amnew
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
11 adding dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
12 $ hg diff --git -r 0
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
13 diff --git a/dir1/new b/dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
14 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
15 --- /dev/null
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
16 +++ b/dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
17 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
18 +new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
19
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
20 Copy:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
21
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
22 $ mkdir dir2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
23 $ hg cp dir1/new dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
24 $ echo copy1 >> dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
25 $ hg cp dir1/new dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
26 $ echo copy2 >> dir2/copy
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
27 $ hg ci -mcopy
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
28 $ hg diff --git -r 1:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
29 diff --git a/dir1/new b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
30 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
31 copy to dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
32 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
33 +++ b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
34 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
35 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
36 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
37 diff --git a/dir1/new b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
38 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
39 copy to dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
40 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
41 +++ b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
42 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
43 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
44 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
45
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
46 Cross and same-directory copies with a relative root:
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
47
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
48 $ hg diff --git --root .. -r 1:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
49 abort: .. not under root '$TESTTMP'
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
50 [255]
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
51 $ hg diff --git --root doesnotexist -r 1:tip
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
52 $ hg diff --git --root . -r 1:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
53 diff --git a/dir1/new b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
54 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
55 copy to dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
56 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
57 +++ b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
58 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
59 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
60 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
61 diff --git a/dir1/new b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
62 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
63 copy to dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
64 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
65 +++ b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
66 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
67 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
68 +copy2
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
69 $ hg diff --git --root dir1 -r 1:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
70 diff --git a/new b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
71 copy from new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
72 copy to copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
73 --- a/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
74 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
75 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
76 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
77 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
78
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
79 $ hg diff --git --root dir2/ -r 1:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
80 diff --git a/copy b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
81 new file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
82 --- /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
83 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
84 @@ -0,0 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
85 +new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
86 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
87
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
88 $ hg diff --git --root dir1 -r 1:tip -I '**/copy'
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
89 diff --git a/new b/copy
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
90 copy from new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
91 copy to copy
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
92 --- a/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
93 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
94 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
95 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
96 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
97
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
98 $ hg diff --git --root dir1 -r 1:tip dir2
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
99 warning: dir2 not inside relative root dir1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
100
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
101 $ hg diff --git --root dir1 -r 1:tip 'dir2/{copy}'
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 24501
diff changeset
102 warning: dir2/{copy} not inside relative root dir1
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
103
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
104 $ cd dir1
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
105 $ hg diff --git --root .. -r 1:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
106 diff --git a/dir1/new b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
107 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
108 copy to dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
109 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
110 +++ b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
111 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
112 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
113 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
114 diff --git a/dir1/new b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
115 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
116 copy to dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
117 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
118 +++ b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
119 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
120 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
121 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
122
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
123 $ hg diff --git --root ../.. -r 1:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
124 abort: ../.. not under root '$TESTTMP'
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
125 [255]
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
126 $ hg diff --git --root ../doesnotexist -r 1:tip
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
127 $ hg diff --git --root .. -r 1:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
128 diff --git a/dir1/new b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
129 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
130 copy to dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
131 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
132 +++ b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
133 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
134 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
135 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
136 diff --git a/dir1/new b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
137 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
138 copy to dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
139 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
140 +++ b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
141 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
142 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
143 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
144
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
145 $ hg diff --git --root . -r 1:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
146 diff --git a/new b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
147 copy from new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
148 copy to copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
149 --- a/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
150 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
151 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
152 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
153 +copy1
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
154 $ hg diff --git --root . -r 1:tip copy
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
155 diff --git a/new b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
156 copy from new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
157 copy to copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
158 --- a/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
159 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
160 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
161 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
162 +copy1
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
163 $ hg diff --git --root . -r 1:tip ../dir2
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 24501
diff changeset
164 warning: ../dir2 not inside relative root .
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
165 $ hg diff --git --root . -r 1:tip '../dir2/*'
24501
8b51ec98a326 test-git-export: add globs the test runner wants on Windows
Matt Harbison <matt_harbison@yahoo.com>
parents: 24455
diff changeset
166 warning: ../dir2/* not inside relative root . (glob)
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
167 $ cd ..
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
168
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
169 Rename:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
170
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
171 $ hg mv dir1/copy dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
172 $ echo rename1 >> dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
173 $ hg mv dir2/copy dir1/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
174 $ echo rename2 >> dir1/rename2
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
175 $ hg ci -mrename
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
176 $ hg diff --git -r 2:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
177 diff --git a/dir1/copy b/dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
178 rename from dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
179 rename to dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
180 --- a/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
181 +++ b/dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
182 @@ -1,2 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
183 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
184 copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
185 +rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
186 diff --git a/dir2/copy b/dir1/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
187 rename from dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
188 rename to dir1/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
189 --- a/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
190 +++ b/dir1/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
191 @@ -1,2 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
192 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
193 copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
194 +rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
195
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
196 Cross and same-directory renames with a relative root:
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
197
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
198 $ hg diff --root dir1 --git -r 2:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
199 diff --git a/copy b/rename1
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
200 rename from copy
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
201 rename to rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
202 --- a/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
203 +++ b/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
204 @@ -1,2 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
205 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
206 copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
207 +rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
208 diff --git a/rename2 b/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
209 new file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
210 --- /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
211 +++ b/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
212 @@ -0,0 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
213 +new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
214 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
215 +rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
216
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
217 $ hg diff --root dir2 --git -r 2:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
218 diff --git a/copy b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
219 deleted file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
220 --- a/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
221 +++ /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
222 @@ -1,2 +0,0 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
223 -new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
224 -copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
225
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
226 $ hg diff --root dir1 --git -r 2:tip -I '**/copy'
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
227 diff --git a/copy b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
228 deleted file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
229 --- a/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
230 +++ /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
231 @@ -1,2 +0,0 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
232 -new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
233 -copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
234
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
235 $ hg diff --root dir1 --git -r 2:tip -I '**/rename*'
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
236 diff --git a/copy b/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
237 copy from copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
238 copy to rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
239 --- a/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
240 +++ b/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
241 @@ -1,2 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
242 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
243 copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
244 +rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
245 diff --git a/rename2 b/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
246 new file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
247 --- /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
248 +++ b/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
249 @@ -0,0 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
250 +new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
251 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
252 +rename2
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
253
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
254 Delete:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
255
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
256 $ hg rm dir1/*
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
257 $ hg ci -mdelete
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
258 $ hg diff --git -r 3:tip
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
259 diff --git a/dir1/new b/dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
260 deleted file mode 100644
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
261 --- a/dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
262 +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
263 @@ -1,1 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
264 -new
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
265 diff --git a/dir1/rename1 b/dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
266 deleted file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
267 --- a/dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
268 +++ /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
269 @@ -1,3 +0,0 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
270 -new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
271 -copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
272 -rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
273 diff --git a/dir1/rename2 b/dir1/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
274 deleted file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
275 --- a/dir1/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
276 +++ /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
277 @@ -1,3 +0,0 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
278 -new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
279 -copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
280 -rename2
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
281
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
282 $ cat > src <<EOF
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
283 > 1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
284 > 2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
285 > 3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
286 > 4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
287 > 5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
288 > EOF
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
289 $ hg ci -Amsrc
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
290 adding src
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
291
16899
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
292 #if execbit
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
293
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
294 chmod 644:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
295
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
296 $ chmod +x src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
297 $ hg ci -munexec
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
298 $ hg diff --git -r 5:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
299 diff --git a/src b/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
300 old mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
301 new mode 100755
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
302
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
303 Rename+mod+chmod:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
304
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
305 $ hg mv src dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
306 $ chmod -x dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
307 $ echo a >> dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
308 $ hg ci -mrenamemod
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
309 $ hg diff --git -r 6:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
310 diff --git a/src b/dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
311 old mode 100755
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
312 new mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
313 rename from src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
314 rename to dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
315 --- a/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
316 +++ b/dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
317 @@ -3,3 +3,4 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
318 3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
319 4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
320 5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
321 +a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
322
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
323 Nonexistent in tip+chmod:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
324
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
325 $ hg diff --git -r 5:6
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
326 diff --git a/src b/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
327 old mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
328 new mode 100755
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
329
16899
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
330 #else
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
331
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
332 Dummy changes when no exec bit, mocking the execbit commit structure
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
333
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
334 $ echo change >> src
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
335 $ hg ci -munexec
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
336 $ hg mv src dst
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
337 $ hg ci -mrenamemod
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
338
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
339 #endif
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
340
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
341 Binary diff:
3066
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
342
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15442
diff changeset
343 $ cp "$TESTDIR/binfile.bin" .
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
344 $ hg add binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
345 $ hg diff --git > b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
346 $ cat b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
347 diff --git a/binfile.bin b/binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
348 new file mode 100644
19875
c172660eee01 patch: Fix nullid for binary git diffs (issue4054)
Johan Bjork <jbjoerk@gmail.com>
parents: 18355
diff changeset
349 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
350 GIT binary patch
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
351 literal 593
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
352 zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
353 z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
354 zX$nnYLt$-$V!?uy+1V%`z&Eh=ah|duER<4|QWhju3gb^nF*8iYobxWG-qqXl=2~5M
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
355 z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
356 zLdY<T=ks|woh-`&01!ej#(xbV1f|pI*=%;d-%F*E*X#ZH`4I%6SS+$EJDE&ct=8po
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
357 ziN#{?_j|kD%Cd|oiqds`xm@;oJ-^?NG3Gdqrs?5u*zI;{nogxsx~^|Fn^Y?Gdc6<;
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
358 zfMJ+iF1J`LMx&A2?dEwNW8ClebzPTbIh{@$hS6*`kH@1d%Lo7fA#}N1)oN7`gm$~V
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
359 z+wDx#)OFqMcE{s!JN0-xhG8ItAjVkJwEcb`3WWlJfU2r?;Pd%dmR+q@mSri5q9_W-
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
360 zaR2~ECX?B2w+zELozC0s*6Z~|QG^f{3I#<`?)Q7U-JZ|q5W;9Q8i_=pBuSzunx=U;
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
361 z9C)5jBoYw9^?EHyQl(M}1OlQcCX>lXB*ODN003Z&P17_@)3Pi=i0wb04<W?v-u}7K
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
362 zXmmQA+wDgE!qR9o8jr`%=ab_&uh(l?R=r;Tjiqon91I2-hIu?57~@*4h7h9uORK#=
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
363 fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
364
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
365
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
366 Import binary diff:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
367
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
368 $ hg revert binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
369 $ rm binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
370 $ hg import -mfoo b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
371 applying b.diff
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15442
diff changeset
372 $ cmp binfile.bin "$TESTDIR/binfile.bin"
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
373
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
374 Rename binary file:
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
375
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
376 $ hg mv binfile.bin renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
377 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
378 diff --git a/binfile.bin b/renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
379 rename from binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
380 rename to renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
381
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
382 Diff across many revisions:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
383
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
384 $ hg mv dst dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
385 $ hg ci -m 'mv dst dst2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
386
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
387 $ echo >> start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
388 $ hg ci -m 'change start'
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
389
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
390 $ hg revert -r -2 start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
391 $ hg mv dst2 dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
392 $ hg ci -m 'mv dst2 dst3; revert start'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
393
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
394 $ hg diff --git -r 9:11
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
395 diff --git a/dst2 b/dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
396 rename from dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
397 rename to dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
398
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
399 Reversed:
4092
4ced663bebf0 git patches: handle renames of binary files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3702
diff changeset
400
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
401 $ hg diff --git -r 11:9
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
402 diff --git a/dst3 b/dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
403 rename from dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
404 rename to dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
405
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
406
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
407 $ echo a >> foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
408 $ hg add foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
409 $ hg ci -m 'add foo'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
410 $ echo b >> foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
411 $ hg ci -m 'change foo'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
412 $ hg mv foo bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
413 $ hg ci -m 'mv foo bar'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
414 $ echo c >> bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
415 $ hg ci -m 'change bar'
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
416
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
417 File created before r1 and renamed before r2:
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
418
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
419 $ hg diff --git -r -3:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
420 diff --git a/foo b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
421 rename from foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
422 rename to bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
423 --- a/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
424 +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
425 @@ -1,2 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
426 a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
427 b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
428 +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
429
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
430 Reversed:
3694
c0b1a0c72c7d renamedbetween: only return (file, node) pairs that exist in the original rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3693
diff changeset
431
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
432 $ hg diff --git -r -1:-3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
433 diff --git a/bar b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
434 rename from bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
435 rename to foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
436 --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
437 +++ b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
438 @@ -1,3 +1,2 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
439 a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
440 b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
441 -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
442
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
443 File created in r1 and renamed before r2:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
444
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
445 $ hg diff --git -r -4:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
446 diff --git a/foo b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
447 rename from foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
448 rename to bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
449 --- a/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
450 +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
451 @@ -1,1 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
452 a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
453 +b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
454 +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
455
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
456 Reversed:
3694
c0b1a0c72c7d renamedbetween: only return (file, node) pairs that exist in the original rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3693
diff changeset
457
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
458 $ hg diff --git -r -1:-4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
459 diff --git a/bar b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
460 rename from bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
461 rename to foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
462 --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
463 +++ b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
464 @@ -1,3 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
465 a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
466 -b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
467 -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
468
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
469 File created after r1 and renamed before r2:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
470
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
471 $ hg diff --git -r -5:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
472 diff --git a/bar b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
473 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
474 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
475 +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
476 @@ -0,0 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
477 +a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
478 +b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
479 +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
480
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
481 Reversed:
3694
c0b1a0c72c7d renamedbetween: only return (file, node) pairs that exist in the original rev
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3693
diff changeset
482
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
483 $ hg diff --git -r -1:-5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
484 diff --git a/bar b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
485 deleted file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
486 --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
487 +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
488 @@ -1,3 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
489 -a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
490 -b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
491 -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
492
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
493
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
494 Comparing with the working dir:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
495
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
496 $ echo >> start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
497 $ hg ci -m 'change start again'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
498
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
499 $ echo > created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
500 $ hg add created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
501 $ hg ci -m 'add created'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
502
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
503 $ hg mv created created2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
504 $ hg ci -m 'mv created created2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
505
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
506 $ hg mv created2 created3
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
507
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
508 There's a copy in the working dir:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
509
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
510 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
511 diff --git a/created2 b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
512 rename from created2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
513 rename to created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
514
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
515 There's another copy between the original rev and the wd:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
516
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
517 $ hg diff --git -r -2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
518 diff --git a/created b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
519 rename from created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
520 rename to created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
521
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
522 The source of the copy was created after the original rev:
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
523
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
524 $ hg diff --git -r -3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
525 diff --git a/created3 b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
526 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
527 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
528 +++ b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
529 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
530 +
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
531 $ hg ci -m 'mv created2 created3'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
532
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
533
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
534 $ echo > brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
535 $ hg add brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
536 $ hg ci -m 'add brand-new'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
537 $ hg mv brand-new brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
538
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
539 Created in parent of wd; renamed in the wd:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
540
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
541 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
542 diff --git a/brand-new b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
543 rename from brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
544 rename to brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
545
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
546 Created between r1 and parent of wd; renamed in the wd:
3696
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
547
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
548 $ hg diff --git -r -2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
549 diff --git a/brand-new2 b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
550 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
551 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
552 +++ b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
553 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
554 +
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
555 $ hg ci -m 'mv brand-new brand-new2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
556
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
557 One file is copied to many destinations and removed:
3696
562a65635bcb diff: better detection of renames when comparing with the working dir.
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3695
diff changeset
558
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
559 $ hg cp brand-new2 brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
560 $ hg mv brand-new2 brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
561 $ hg ci -m 'multiple renames/copies'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
562 $ hg diff --git -r -2 -r -1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
563 diff --git a/brand-new2 b/brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
564 rename from brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
565 rename to brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
566 diff --git a/brand-new2 b/brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
567 copy from brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
568 copy to brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
569
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
570 Reversed:
3702
70c3ee224c08 Don't generate git patches that rename a file to multiple destinations
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3696
diff changeset
571
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
572 $ hg diff --git -r -1 -r -2
18355
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
573 diff --git a/brand-new3-2 b/brand-new2
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
574 rename from brand-new3-2
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
575 rename to brand-new2
18355
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
576 diff --git a/brand-new3 b/brand-new3
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
577 deleted file mode 100644
18355
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
578 --- a/brand-new3
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
579 +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
580 @@ -1,1 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
581 -
3702
70c3ee224c08 Don't generate git patches that rename a file to multiple destinations
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3696
diff changeset
582
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
583 There should be a trailing TAB if there are spaces in the file name:
4679
826659bd8053 git patches: correct handling of filenames with spaces
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4096
diff changeset
584
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
585 $ echo foo > 'with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
586 $ hg add 'with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
587 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
588 diff --git a/with spaces b/with spaces
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
589 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
590 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
591 +++ b/with spaces
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
592 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
593 +foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
594 $ hg ci -m 'add filename with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
595
19973
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
596 Additions should be properly marked even in the middle of a merge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
597
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
598 $ hg up -r -2
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
599 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
600 $ echo "New File" >> inmerge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
601 $ hg add inmerge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
602 $ hg ci -m "file in merge"
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
603 created new head
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
604 $ hg up 23
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
605 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
606 $ hg merge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
607 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
608 (branch merge, don't forget to commit)
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
609 $ hg diff -g
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
610 diff --git a/inmerge b/inmerge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
611 new file mode 100644
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
612 --- /dev/null
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
613 +++ b/inmerge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
614 @@ -0,0 +1,1 @@
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
615 +New File