annotate tests/test-git-export.t @ 50330:eb07591825fa stable

rhg: show a bug in the rust implementation of path_encode introduced recently In commit 96d31efd21f7 I did a refactoring where I dropped a chunk of code by accident, thus introducing a bug. This commit adds a test demonstrating that bug.
author Arseniy Alekseyev <aalekseyev@janestreet.com>
date Fri, 24 Mar 2023 19:01:03 +0000
parents 55c6ebd11cb9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 46548
diff changeset
1 $ hg init repo
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 46548
diff changeset
2 $ cd repo
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
3 $ echo start > start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
4 $ hg ci -Amstart
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
5 adding start
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
6
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
7 New file:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
8
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
9 $ mkdir dir1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
10 $ echo new > dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
11 $ hg ci -Amnew
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
12 adding dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
13 $ 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
14 diff --git a/dir1/new b/dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
15 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
16 --- /dev/null
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
17 +++ b/dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
18 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
19 +new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
20
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
21 Copy:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
22
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
23 $ mkdir dir2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
24 $ 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
25 $ echo copy1 >> dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
26 $ 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
27 $ echo copy2 >> dir2/copy
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
28 $ hg ci -mcopy
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
29 $ 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
30 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
31 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
32 copy to dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
33 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
34 +++ b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
35 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
36 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
37 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
38 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
39 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
40 copy to dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
41 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
42 +++ b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
43 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
44 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
45 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
46
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
47 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
48
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
49 $ hg diff --git --root .. -r 1:tip
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 46548
diff changeset
50 abort: .. not under root '$TESTTMP/repo'
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
51 [255]
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
52 $ hg diff --git --root doesnotexist -r 1:tip
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
53 $ 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
54 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
55 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
56 copy to dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
57 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
58 +++ b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
59 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
60 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
61 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
62 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
63 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
64 copy to dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
65 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
66 +++ b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
67 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
68 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
69 +copy2
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
70 $ 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
71 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
72 copy from new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
73 copy to copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
74 --- a/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
75 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
76 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
77 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
78 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
79
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
80 $ 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
81 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
82 new file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
83 --- /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
84 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
85 @@ -0,0 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
86 +new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
87 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
88
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
89 $ 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
90 diff --git a/new b/copy
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
91 copy from new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
92 copy to copy
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
93 --- a/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
94 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
95 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
96 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
97 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
98
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
99 $ 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
100 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
101
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
102 $ 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
103 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
104
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
105 $ cd dir1
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
106 $ 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
107 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
108 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
109 copy to dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
110 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
111 +++ b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
112 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
113 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
114 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
115 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
116 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
117 copy to dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
118 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
119 +++ b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
120 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
121 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
122 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
123
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
124 $ hg diff --git --root ../.. -r 1:tip
49621
55c6ebd11cb9 tests: run many tests in $TESTTMP/repo instead of $TESTTMP
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents: 46548
diff changeset
125 abort: ../.. not under root '$TESTTMP/repo'
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
126 [255]
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
127 $ hg diff --git --root ../doesnotexist -r 1:tip
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
128 $ 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
129 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
130 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
131 copy to dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
132 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
133 +++ b/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
134 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
135 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
136 +copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
137 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
138 copy from dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
139 copy to dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
140 --- a/dir1/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
141 +++ b/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
142 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
143 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
144 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
145
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
146 $ 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
147 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
148 copy from new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
149 copy to copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
150 --- a/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
151 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
152 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
153 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
154 +copy1
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
155 $ 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
156 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
157 copy from new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
158 copy to copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
159 --- a/new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
160 +++ b/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
161 @@ -1,1 +1,2 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
162 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
163 +copy1
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
164 $ 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
165 warning: ../dir2 not inside relative root .
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
166 $ 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
167 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
168 $ cd ..
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
169
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
170 Rename:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
171
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
172 $ 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
173 $ echo rename1 >> dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
174 $ 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
175 $ echo rename2 >> dir1/rename2
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
176 $ hg ci -mrename
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
177 $ 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
178 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
179 rename from dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
180 rename to dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
181 --- a/dir1/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
182 +++ b/dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
183 @@ -1,2 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
184 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
185 copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
186 +rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
187 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
188 rename from dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
189 rename to dir1/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
190 --- a/dir2/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
191 +++ b/dir1/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
192 @@ -1,2 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
193 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
194 copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
195 +rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
196
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
197 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
198
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
199 $ 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
200 diff --git a/copy b/rename1
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
201 rename from copy
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
202 rename to rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
203 --- a/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
204 +++ b/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
205 @@ -1,2 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
206 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
207 copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
208 +rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
209 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
210 new file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
211 --- /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
212 +++ b/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
213 @@ -0,0 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
214 +new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
215 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
216 +rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
217
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
218 $ 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
219 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
220 deleted file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
221 --- a/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
222 +++ /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
223 @@ -1,2 +0,0 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
224 -new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
225 -copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
226
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
227 $ 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
228 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
229 deleted file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
230 --- a/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
231 +++ /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
232 @@ -1,2 +0,0 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
233 -new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
234 -copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
235
24455
16961d43dc89 diff: rename --relative option to --root
Sean Farley <sean@farley.io>
parents: 24432
diff changeset
236 $ 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
237 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
238 copy from copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
239 copy to rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
240 --- a/copy
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
241 +++ b/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
242 @@ -1,2 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
243 new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
244 copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
245 +rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
246 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
247 new file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
248 --- /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
249 +++ b/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
250 @@ -0,0 +1,3 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
251 +new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
252 +copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
253 +rename2
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
254
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
255 Delete:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
256
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
257 $ hg rm dir1/*
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
258 $ hg ci -mdelete
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
259 $ 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
260 diff --git a/dir1/new b/dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
261 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
262 --- a/dir1/new
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
263 +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
264 @@ -1,1 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
265 -new
24432
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
266 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
267 deleted file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
268 --- a/dir1/rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
269 +++ /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
270 @@ -1,3 +0,0 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
271 -new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
272 -copy1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
273 -rename1
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
274 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
275 deleted file mode 100644
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
276 --- a/dir1/rename2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
277 +++ /dev/null
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
278 @@ -1,3 +0,0 @@
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
279 -new
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
280 -copy2
e22248f6d257 commands.diff: add support for diffs relative to a subdirectory
Siddharth Agarwal <sid0@fb.com>
parents: 19973
diff changeset
281 -rename2
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
282
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
283 $ cat > src <<EOF
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
284 > 1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
285 > 2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
286 > 3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
287 > 4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
288 > 5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
289 > EOF
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
290 $ hg ci -Amsrc
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
291 adding src
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
292
16899
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
293 #if execbit
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
294
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
295 chmod 644:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
296
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
297 $ chmod +x src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
298 $ hg ci -munexec
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
299 $ hg diff --git -r 5:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
300 diff --git a/src b/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
301 old mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
302 new mode 100755
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
303
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
304 Rename+mod+chmod:
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
305
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
306 $ hg mv src dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
307 $ chmod -x dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
308 $ echo a >> dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
309 $ hg ci -mrenamemod
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
310 $ hg diff --git -r 6:tip
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
311 diff --git a/src b/dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
312 old mode 100755
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
313 new mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
314 rename from src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
315 rename to dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
316 --- a/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
317 +++ b/dst
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
318 @@ -3,3 +3,4 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
319 3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
320 4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
321 5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
322 +a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
323
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
324 Nonexistent in tip+chmod:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
325
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
326 $ hg diff --git -r 5:6
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
327 diff --git a/src b/src
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
328 old mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
329 new mode 100755
2907
8b02af865990 Add diff --git option
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
330
16899
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
331 #else
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
332
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
333 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
334
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
335 $ echo change >> src
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
336 $ hg ci -munexec
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
337 $ hg mv src dst
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
338 $ hg ci -mrenamemod
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
339
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
340 #endif
8149ff405c78 tests: convert some 'hghave execbit' to #if
Mads Kiilerich <mads@kiilerich.com>
parents: 16350
diff changeset
341
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
342 Binary diff:
3066
035fd2029575 git --diff: fix traceback when getting mode change
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 2935
diff changeset
343
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15442
diff changeset
344 $ cp "$TESTDIR/binfile.bin" .
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
345 $ hg add binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
346 $ hg diff --git > b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
347 $ cat b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
348 diff --git a/binfile.bin b/binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
349 new file mode 100644
46548
0492002560f3 tests: accept output changes by 33350debb480
Sushil khanchi <sushilkhanchi97@gmail.com>
parents: 35393
diff changeset
350 index 0000000000000000000000000000000000000000..37ba3d1c6f17137d9c5f5776fa040caf5fe73ff9
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
351 GIT binary patch
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
352 literal 593
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
353 zc$@)I0<QguP)<h;3K|Lk000e1NJLTq000mG000mO0ssI2kdbIM00009a7bBm000XU
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
354 z000XU0RWnu7ytkO2XskIMF-Uh9TW;VpMjwv0005-Nkl<ZD9@FWPs=e;7{<>W$NUkd
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
355 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
356 z*IoDB)sG^CfNuoBmqLTVU^<;@nwHP!1wrWd`{(mHo6VNXWtyh{alzqmsH*yYzpvLT
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
357 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
358 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
359 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
360 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
361 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
362 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
363 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
364 fQItJW-{SoTm)8|5##k|m00000NkvXXu0mjf{mKw4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
365
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
366
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
367 Import binary diff:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
368
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
369 $ hg revert binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
370 $ rm binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
371 $ hg import -mfoo b.diff
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
372 applying b.diff
16350
4f795f5fbb0b tests: make tests work if directory contains special characters
Thomas Arendsen Hein <thomas@intevation.de>
parents: 15442
diff changeset
373 $ cmp binfile.bin "$TESTDIR/binfile.bin"
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
374
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
375 Rename binary file:
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
376
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
377 $ hg mv binfile.bin renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
378 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
379 diff --git a/binfile.bin b/renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
380 rename from binfile.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
381 rename to renamed.bin
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
382
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
383 Diff across many revisions:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
384
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
385 $ hg mv dst dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
386 $ hg ci -m 'mv dst dst2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
387
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
388 $ echo >> start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
389 $ hg ci -m 'change start'
3368
751df21dad72 Add test for git binary diff support
Brendan Cully <brendan@kublai.com>
parents: 3199
diff changeset
390
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
391 $ hg revert -r -2 start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
392 $ hg mv dst2 dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
393 $ hg ci -m 'mv dst2 dst3; revert start'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
394
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
395 $ hg diff --git -r 9:11
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
396 diff --git a/dst2 b/dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
397 rename from dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
398 rename to dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
399
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
400 Reversed:
4092
4ced663bebf0 git patches: handle renames of binary files
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3702
diff changeset
401
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
402 $ hg diff --git -r 11:9
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
403 diff --git a/dst3 b/dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
404 rename from dst3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
405 rename to dst2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
406
3693
454b3a8cdf28 diff: improve detection of renames when diffing across many revisions
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3368
diff changeset
407
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
408 $ echo a >> foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
409 $ hg add foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
410 $ hg ci -m 'add foo'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
411 $ echo b >> foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
412 $ hg ci -m 'change foo'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
413 $ hg mv foo bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
414 $ hg ci -m 'mv foo bar'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
415 $ echo c >> bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
416 $ 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
417
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
418 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
419
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
420 $ hg diff --git -r -3:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
421 diff --git a/foo b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
422 rename from foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
423 rename to bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
424 --- a/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
425 +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
426 @@ -1,2 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
427 a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
428 b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
429 +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
430
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
431 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
432
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
433 $ hg diff --git -r -1:-3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
434 diff --git a/bar b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
435 rename from bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
436 rename to foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
437 --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
438 +++ b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
439 @@ -1,3 +1,2 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
440 a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
441 b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
442 -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
443
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
444 File created in r1 and renamed before r2:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
445
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
446 $ hg diff --git -r -4:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
447 diff --git a/foo b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
448 rename from foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
449 rename to bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
450 --- a/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
451 +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
452 @@ -1,1 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
453 a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
454 +b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
455 +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
456
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
457 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
458
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
459 $ hg diff --git -r -1:-4
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
460 diff --git a/bar b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
461 rename from bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
462 rename to foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
463 --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
464 +++ b/foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
465 @@ -1,3 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
466 a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
467 -b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
468 -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
469
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
470 File created after r1 and renamed before r2:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
471
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
472 $ hg diff --git -r -5:-1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
473 diff --git a/bar b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
474 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
475 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
476 +++ b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
477 @@ -0,0 +1,3 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
478 +a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
479 +b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
480 +c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
481
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
482 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
483
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
484 $ hg diff --git -r -1:-5
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
485 diff --git a/bar b/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
486 deleted file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
487 --- a/bar
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
488 +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
489 @@ -1,3 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
490 -a
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
491 -b
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
492 -c
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
493
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
494
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
495 Comparing with the working dir:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
496
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
497 $ echo >> start
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
498 $ hg ci -m 'change start again'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
499
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
500 $ echo > created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
501 $ hg add created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
502 $ hg ci -m 'add created'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
503
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
504 $ hg mv created created2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
505 $ hg ci -m 'mv created created2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
506
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
507 $ hg mv created2 created3
3695
3a2fc90d27d6 fix typo in mercurial/patch.py
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3694
diff changeset
508
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
509 There's a copy in the working dir:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
510
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
511 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
512 diff --git a/created2 b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
513 rename from created2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
514 rename to created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
515
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
516 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
517
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
518 $ hg diff --git -r -2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
519 diff --git a/created b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
520 rename from created
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
521 rename to created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
522
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
523 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
524
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
525 $ hg diff --git -r -3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
526 diff --git a/created3 b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
527 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
528 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
529 +++ b/created3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
530 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
531 +
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
532 $ hg ci -m 'mv created2 created3'
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
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
535 $ echo > brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
536 $ hg add brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
537 $ hg ci -m 'add brand-new'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
538 $ hg mv brand-new brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
539
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
540 Created in parent of wd; renamed in the wd:
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
541
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
542 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
543 diff --git a/brand-new b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
544 rename from brand-new
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
545 rename to brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
546
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
547 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
548
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
549 $ hg diff --git -r -2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
550 diff --git a/brand-new2 b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
551 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
552 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
553 +++ b/brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
554 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
555 +
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
556 $ hg ci -m 'mv brand-new brand-new2'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
557
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
558 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
559
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
560 $ hg cp brand-new2 brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
561 $ hg mv brand-new2 brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
562 $ hg ci -m 'multiple renames/copies'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
563 $ hg diff --git -r -2 -r -1
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
564 diff --git a/brand-new2 b/brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
565 rename from brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
566 rename to brand-new3
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
567 diff --git a/brand-new2 b/brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
568 copy from brand-new2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
569 copy to brand-new3-2
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
570
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
571 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
572
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
573 $ 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
574 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
575 rename from brand-new3-2
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
576 rename to brand-new2
18355
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
577 diff --git a/brand-new3 b/brand-new3
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
578 deleted file mode 100644
18355
2330d97e7707 copies: make the loss in _backwardcopies more stable
Mads Kiilerich <mads@kiilerich.com>
parents: 16899
diff changeset
579 --- a/brand-new3
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
580 +++ /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
581 @@ -1,1 +0,0 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
582 -
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
583
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
584 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
585
12193
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
586 $ echo foo > 'with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
587 $ hg add 'with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
588 $ hg diff --git
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
589 diff --git a/with spaces b/with spaces
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
590 new file mode 100644
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
591 --- /dev/null
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
592 +++ b/with spaces
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
593 @@ -0,0 +1,1 @@
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
594 +foo
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
595 $ hg ci -m 'add filename with spaces'
927e1a677267 tests: unify test-git-*
Adrian Buehlmann <adrian@cadifra.com>
parents: 8167
diff changeset
596
19973
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
597 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
598
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
599 $ 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
600 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
601 $ 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
602 $ 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
603 $ 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
604 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
605 $ 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
606 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
607 $ hg merge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
608 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
609 (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
610 $ 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
611 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
612 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
613 --- /dev/null
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
614 +++ b/inmerge
1184edaead7a patch: ensure valid git diffs if source/destination file is missing (issue4046)
Johan Bjork <jbjoerk@gmail.com>
parents: 19875
diff changeset
615 @@ -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
616 +New File