Show More
@@ -1,424 +1,425 b'' | |||||
1 | #require pygit2 no-windows |
|
1 | #require pygit2 no-windows | |
2 |
|
2 | |||
3 | Setup: |
|
3 | Setup: | |
4 | $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME |
|
4 | $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME | |
5 | > GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL |
|
5 | > GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL | |
6 | > GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE |
|
6 | > GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE | |
7 | > GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME |
|
7 | > GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME | |
8 | > GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL |
|
8 | > GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL | |
9 | > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE |
|
9 | > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE | |
|
10 | > HGUSER="test <test@example.org>"; export HGUSER | |||
10 | > count=10 |
|
11 | > count=10 | |
11 | > gitcommit() { |
|
12 | > gitcommit() { | |
12 | > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"; |
|
13 | > GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000"; | |
13 | > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" |
|
14 | > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" | |
14 | > git commit "$@" >/dev/null 2>/dev/null || echo "git commit error" |
|
15 | > git commit "$@" >/dev/null 2>/dev/null || echo "git commit error" | |
15 | > count=`expr $count + 1` |
|
16 | > count=`expr $count + 1` | |
16 | > } |
|
17 | > } | |
17 | $ git config --global init.defaultBranch master |
|
18 | $ git config --global init.defaultBranch master | |
18 |
|
19 | |||
19 |
|
20 | |||
20 | $ hg version -v --config extensions.git= | grep '^[E ]' |
|
21 | $ hg version -v --config extensions.git= | grep '^[E ]' | |
21 | Enabled extensions: |
|
22 | Enabled extensions: | |
22 | git internal (pygit2 *) (glob) |
|
23 | git internal (pygit2 *) (glob) | |
23 |
|
24 | |||
24 | Test auto-loading extension works: |
|
25 | Test auto-loading extension works: | |
25 | $ mkdir nogit |
|
26 | $ mkdir nogit | |
26 | $ cd nogit |
|
27 | $ cd nogit | |
27 | $ mkdir .hg |
|
28 | $ mkdir .hg | |
28 | $ echo git >> .hg/requires |
|
29 | $ echo git >> .hg/requires | |
29 | $ hg status |
|
30 | $ hg status | |
30 | abort: repository specified git format in .hg/requires but has no .git directory |
|
31 | abort: repository specified git format in .hg/requires but has no .git directory | |
31 | [255] |
|
32 | [255] | |
32 | $ git config --global init.defaultBranch master |
|
33 | $ git config --global init.defaultBranch master | |
33 | $ git init |
|
34 | $ git init | |
34 | Initialized empty Git repository in $TESTTMP/nogit/.git/ |
|
35 | Initialized empty Git repository in $TESTTMP/nogit/.git/ | |
35 | This status invocation shows some hg gunk because we didn't use |
|
36 | This status invocation shows some hg gunk because we didn't use | |
36 | `hg init --git`, which fixes up .git/info/exclude for us. |
|
37 | `hg init --git`, which fixes up .git/info/exclude for us. | |
37 | $ hg status |
|
38 | $ hg status | |
38 | ? .hg/cache/git-commits.sqlite |
|
39 | ? .hg/cache/git-commits.sqlite | |
39 | ? .hg/cache/git-commits.sqlite-shm |
|
40 | ? .hg/cache/git-commits.sqlite-shm | |
40 | ? .hg/cache/git-commits.sqlite-wal |
|
41 | ? .hg/cache/git-commits.sqlite-wal | |
41 | ? .hg/requires |
|
42 | ? .hg/requires | |
42 | $ cd .. |
|
43 | $ cd .. | |
43 |
|
44 | |||
44 | Now globally enable extension for the rest of the test: |
|
45 | Now globally enable extension for the rest of the test: | |
45 | $ cat <<EOF >> $HGRCPATH |
|
46 | $ cat <<EOF >> $HGRCPATH | |
46 | > [extensions] |
|
47 | > [extensions] | |
47 | > git= |
|
48 | > git= | |
48 | > [git] |
|
49 | > [git] | |
49 | > log-index-cache-miss = yes |
|
50 | > log-index-cache-miss = yes | |
50 | > EOF |
|
51 | > EOF | |
51 |
|
52 | |||
52 | Test some edge cases around a commitless repo first |
|
53 | Test some edge cases around a commitless repo first | |
53 | $ mkdir empty |
|
54 | $ mkdir empty | |
54 | $ cd empty |
|
55 | $ cd empty | |
55 | $ git init |
|
56 | $ git init | |
56 | Initialized empty Git repository in $TESTTMP/empty/.git/ |
|
57 | Initialized empty Git repository in $TESTTMP/empty/.git/ | |
57 | $ hg init --git |
|
58 | $ hg init --git | |
58 | $ hg heads |
|
59 | $ hg heads | |
59 | [1] |
|
60 | [1] | |
60 | $ hg tip |
|
61 | $ hg tip | |
61 | changeset: -1:000000000000 |
|
62 | changeset: -1:000000000000 | |
62 | tag: tip |
|
63 | tag: tip | |
63 | user: |
|
64 | user: | |
64 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
65 | date: Thu Jan 01 00:00:00 1970 +0000 | |
65 |
|
66 | |||
66 | $ cd .. |
|
67 | $ cd .. | |
67 |
|
68 | |||
68 | Make a new repo with git: |
|
69 | Make a new repo with git: | |
69 | $ mkdir foo |
|
70 | $ mkdir foo | |
70 | $ cd foo |
|
71 | $ cd foo | |
71 | $ git init |
|
72 | $ git init | |
72 | Initialized empty Git repository in $TESTTMP/foo/.git/ |
|
73 | Initialized empty Git repository in $TESTTMP/foo/.git/ | |
73 | Ignore the .hg directory within git: |
|
74 | Ignore the .hg directory within git: | |
74 | $ echo .hg >> .git/info/exclude |
|
75 | $ echo .hg >> .git/info/exclude | |
75 | $ echo alpha > alpha |
|
76 | $ echo alpha > alpha | |
76 | $ git add alpha |
|
77 | $ git add alpha | |
77 | $ gitcommit -am 'Add alpha' |
|
78 | $ gitcommit -am 'Add alpha' | |
78 | $ echo beta > beta |
|
79 | $ echo beta > beta | |
79 | $ git add beta |
|
80 | $ git add beta | |
80 | $ gitcommit -am 'Add beta' |
|
81 | $ gitcommit -am 'Add beta' | |
81 | $ echo gamma > gamma |
|
82 | $ echo gamma > gamma | |
82 | $ git status |
|
83 | $ git status | |
83 | On branch master |
|
84 | On branch master | |
84 | Untracked files: |
|
85 | Untracked files: | |
85 | (use "git add <file>..." to include in what will be committed) |
|
86 | (use "git add <file>..." to include in what will be committed) | |
86 | (?) |
|
87 | (?) | |
87 | gamma |
|
88 | gamma | |
88 |
|
89 | |||
89 | nothing added to commit but untracked files present (use "git add" to track) |
|
90 | nothing added to commit but untracked files present (use "git add" to track) | |
90 |
|
91 | |||
91 | Without creating the .hg, hg status fails: |
|
92 | Without creating the .hg, hg status fails: | |
92 | $ hg status |
|
93 | $ hg status | |
93 | abort: no repository found in '$TESTTMP/foo' (.hg not found) |
|
94 | abort: no repository found in '$TESTTMP/foo' (.hg not found) | |
94 | [10] |
|
95 | [10] | |
95 | But if you run hg init --git, it works: |
|
96 | But if you run hg init --git, it works: | |
96 | $ hg init --git |
|
97 | $ hg init --git | |
97 | $ hg id --traceback |
|
98 | $ hg id --traceback | |
98 | heads mismatch, rebuilding dagcache |
|
99 | heads mismatch, rebuilding dagcache | |
99 | 3d9be8deba43 tip master |
|
100 | 3d9be8deba43 tip master | |
100 | $ hg status |
|
101 | $ hg status | |
101 | ? gamma |
|
102 | ? gamma | |
102 | Log works too: |
|
103 | Log works too: | |
103 | $ hg log |
|
104 | $ hg log | |
104 | changeset: 1:3d9be8deba43 |
|
105 | changeset: 1:3d9be8deba43 | |
105 | bookmark: master |
|
106 | bookmark: master | |
106 | tag: tip |
|
107 | tag: tip | |
107 | user: test <test@example.org> |
|
108 | user: test <test@example.org> | |
108 | date: Mon Jan 01 00:00:11 2007 +0000 |
|
109 | date: Mon Jan 01 00:00:11 2007 +0000 | |
109 | summary: Add beta |
|
110 | summary: Add beta | |
110 |
|
111 | |||
111 | changeset: 0:c5864c9d16fb |
|
112 | changeset: 0:c5864c9d16fb | |
112 | user: test <test@example.org> |
|
113 | user: test <test@example.org> | |
113 | date: Mon Jan 01 00:00:10 2007 +0000 |
|
114 | date: Mon Jan 01 00:00:10 2007 +0000 | |
114 | summary: Add alpha |
|
115 | summary: Add alpha | |
115 |
|
116 | |||
116 |
|
117 | |||
117 |
|
118 | |||
118 | and bookmarks: |
|
119 | and bookmarks: | |
119 | $ hg bookmarks |
|
120 | $ hg bookmarks | |
120 | * master 1:3d9be8deba43 |
|
121 | * master 1:3d9be8deba43 | |
121 |
|
122 | |||
122 | diff even works transparently in both systems: |
|
123 | diff even works transparently in both systems: | |
123 | $ echo blah >> alpha |
|
124 | $ echo blah >> alpha | |
124 | $ git diff |
|
125 | $ git diff | |
125 | diff --git a/alpha b/alpha |
|
126 | diff --git a/alpha b/alpha | |
126 | index 4a58007..faed1b7 100644 |
|
127 | index 4a58007..faed1b7 100644 | |
127 | --- a/alpha |
|
128 | --- a/alpha | |
128 | +++ b/alpha |
|
129 | +++ b/alpha | |
129 | @@ -1* +1,2 @@ (glob) |
|
130 | @@ -1* +1,2 @@ (glob) | |
130 | alpha |
|
131 | alpha | |
131 | +blah |
|
132 | +blah | |
132 | $ hg diff --git |
|
133 | $ hg diff --git | |
133 | diff --git a/alpha b/alpha |
|
134 | diff --git a/alpha b/alpha | |
134 | --- a/alpha |
|
135 | --- a/alpha | |
135 | +++ b/alpha |
|
136 | +++ b/alpha | |
136 | @@ -1,1 +1,2 @@ |
|
137 | @@ -1,1 +1,2 @@ | |
137 | alpha |
|
138 | alpha | |
138 | +blah |
|
139 | +blah | |
139 |
|
140 | |||
140 | Remove a file, it shows as such: |
|
141 | Remove a file, it shows as such: | |
141 | $ rm alpha |
|
142 | $ rm alpha | |
142 | $ hg status |
|
143 | $ hg status | |
143 | ! alpha |
|
144 | ! alpha | |
144 | ? gamma |
|
145 | ? gamma | |
145 |
|
146 | |||
146 | Revert works: |
|
147 | Revert works: | |
147 | $ hg revert alpha --traceback |
|
148 | $ hg revert alpha --traceback | |
148 | $ hg status |
|
149 | $ hg status | |
149 | ? gamma |
|
150 | ? gamma | |
150 | $ git status |
|
151 | $ git status | |
151 | On branch master |
|
152 | On branch master | |
152 | Untracked files: |
|
153 | Untracked files: | |
153 | (use "git add <file>..." to include in what will be committed) |
|
154 | (use "git add <file>..." to include in what will be committed) | |
154 | (?) |
|
155 | (?) | |
155 | gamma |
|
156 | gamma | |
156 |
|
157 | |||
157 | nothing added to commit but untracked files present (use "git add" to track) |
|
158 | nothing added to commit but untracked files present (use "git add" to track) | |
158 |
|
159 | |||
159 | Add shows sanely in both: |
|
160 | Add shows sanely in both: | |
160 | $ hg add gamma |
|
161 | $ hg add gamma | |
161 | $ hg status |
|
162 | $ hg status | |
162 | A gamma |
|
163 | A gamma | |
163 | $ hg files |
|
164 | $ hg files | |
164 | alpha |
|
165 | alpha | |
165 | beta |
|
166 | beta | |
166 | gamma |
|
167 | gamma | |
167 | $ git ls-files |
|
168 | $ git ls-files | |
168 | alpha |
|
169 | alpha | |
169 | beta |
|
170 | beta | |
170 | gamma |
|
171 | gamma | |
171 | $ git status |
|
172 | $ git status | |
172 | On branch master |
|
173 | On branch master | |
173 | Changes to be committed: |
|
174 | Changes to be committed: | |
174 | (use "git restore --staged <file>..." to unstage) (?) |
|
175 | (use "git restore --staged <file>..." to unstage) (?) | |
175 | (use "git reset HEAD <file>..." to unstage) (?) |
|
176 | (use "git reset HEAD <file>..." to unstage) (?) | |
176 | (?) |
|
177 | (?) | |
177 | new file: gamma |
|
178 | new file: gamma | |
178 |
|
179 | |||
179 |
|
180 | |||
180 | forget does what it should as well: |
|
181 | forget does what it should as well: | |
181 | $ hg forget gamma |
|
182 | $ hg forget gamma | |
182 | $ hg status |
|
183 | $ hg status | |
183 | ? gamma |
|
184 | ? gamma | |
184 | $ git status |
|
185 | $ git status | |
185 | On branch master |
|
186 | On branch master | |
186 | Untracked files: |
|
187 | Untracked files: | |
187 | (use "git add <file>..." to include in what will be committed) |
|
188 | (use "git add <file>..." to include in what will be committed) | |
188 | (?) |
|
189 | (?) | |
189 | gamma |
|
190 | gamma | |
190 |
|
191 | |||
191 | nothing added to commit but untracked files present (use "git add" to track) |
|
192 | nothing added to commit but untracked files present (use "git add" to track) | |
192 |
|
193 | |||
193 | clean up untracked file |
|
194 | clean up untracked file | |
194 | $ rm gamma |
|
195 | $ rm gamma | |
195 |
|
196 | |||
196 | hg log FILE |
|
197 | hg log FILE | |
197 |
|
198 | |||
198 | $ echo a >> alpha |
|
199 | $ echo a >> alpha | |
199 |
$ hg ci -m 'more alpha' --traceback --date '15835 |
|
200 | $ hg ci -m 'more alpha' --traceback --date '1583558723 18000' | |
200 | $ echo b >> beta |
|
201 | $ echo b >> beta | |
201 | $ hg ci -m 'more beta' |
|
202 | $ hg ci -m 'more beta' | |
202 | heads mismatch, rebuilding dagcache |
|
203 | heads mismatch, rebuilding dagcache | |
203 | $ echo a >> alpha |
|
204 | $ echo a >> alpha | |
204 | $ hg ci -m 'even more alpha' |
|
205 | $ hg ci -m 'even more alpha' | |
205 | heads mismatch, rebuilding dagcache |
|
206 | heads mismatch, rebuilding dagcache | |
206 | $ hg log -G alpha |
|
207 | $ hg log -G alpha | |
207 | heads mismatch, rebuilding dagcache |
|
208 | heads mismatch, rebuilding dagcache | |
208 |
@ changeset: 4: |
|
209 | @ changeset: 4:cf6ddf5d9b8a | |
209 | : bookmark: master |
|
210 | : bookmark: master | |
210 | : tag: tip |
|
211 | : tag: tip | |
211 | : user: test <test> |
|
212 | : user: test <test@example.org> | |
212 | : date: Thu Jan 01 00:00:00 1970 +0000 |
|
213 | : date: Thu Jan 01 00:00:00 1970 +0000 | |
213 | : summary: even more alpha |
|
214 | : summary: even more alpha | |
214 | : |
|
215 | : | |
215 |
o changeset: 2: |
|
216 | o changeset: 2:5b2c80b027ce | |
216 | : user: test <test> |
|
217 | : user: test <test@example.org> | |
217 |
: date: |
|
218 | : date: Sat Mar 07 00:25:23 2020 -0500 | |
218 | : summary: more alpha |
|
219 | : summary: more alpha | |
219 | : |
|
220 | : | |
220 | o changeset: 0:c5864c9d16fb |
|
221 | o changeset: 0:c5864c9d16fb | |
221 | user: test <test@example.org> |
|
222 | user: test <test@example.org> | |
222 | date: Mon Jan 01 00:00:10 2007 +0000 |
|
223 | date: Mon Jan 01 00:00:10 2007 +0000 | |
223 | summary: Add alpha |
|
224 | summary: Add alpha | |
224 |
|
225 | |||
225 | $ hg log -G beta |
|
226 | $ hg log -G beta | |
226 |
o changeset: 3: |
|
227 | o changeset: 3:980d4f79a9c6 | |
227 | : user: test <test> |
|
228 | : user: test <test@example.org> | |
228 | : date: Thu Jan 01 00:00:00 1970 +0000 |
|
229 | : date: Thu Jan 01 00:00:00 1970 +0000 | |
229 | : summary: more beta |
|
230 | : summary: more beta | |
230 | : |
|
231 | : | |
231 | o changeset: 1:3d9be8deba43 |
|
232 | o changeset: 1:3d9be8deba43 | |
232 | | user: test <test@example.org> |
|
233 | | user: test <test@example.org> | |
233 | ~ date: Mon Jan 01 00:00:11 2007 +0000 |
|
234 | ~ date: Mon Jan 01 00:00:11 2007 +0000 | |
234 | summary: Add beta |
|
235 | summary: Add beta | |
235 |
|
236 | |||
236 |
|
237 | |||
237 | $ hg log -r "children(3d9be8deba43)" -T"{node|short} {children}\n" |
|
238 | $ hg log -r "children(3d9be8deba43)" -T"{node|short} {children}\n" | |
238 | a1983dd7fb19 3:d8ee22687733 |
|
239 | 5b2c80b027ce 3:980d4f79a9c6 | |
239 |
|
240 | |||
240 | hg annotate |
|
241 | hg annotate | |
241 |
|
242 | |||
242 | $ hg annotate alpha |
|
243 | $ hg annotate alpha | |
243 | 0: alpha |
|
244 | 0: alpha | |
244 | 2: a |
|
245 | 2: a | |
245 | 4: a |
|
246 | 4: a | |
246 | $ hg annotate beta |
|
247 | $ hg annotate beta | |
247 | 1: beta |
|
248 | 1: beta | |
248 | 3: b |
|
249 | 3: b | |
249 |
|
250 | |||
250 |
|
251 | |||
251 | Files in subdirectories. TODO: case-folding support, make this `A` |
|
252 | Files in subdirectories. TODO: case-folding support, make this `A` | |
252 | instead of `a`. |
|
253 | instead of `a`. | |
253 |
|
254 | |||
254 | $ mkdir a |
|
255 | $ mkdir a | |
255 | $ echo "This is file mu." > a/mu |
|
256 | $ echo "This is file mu." > a/mu | |
256 | $ hg ci -A -m 'Introduce file a/mu' |
|
257 | $ hg ci -A -m 'Introduce file a/mu' | |
257 | adding a/mu |
|
258 | adding a/mu | |
258 |
|
259 | |||
259 | Both hg and git agree a/mu is part of the repo |
|
260 | Both hg and git agree a/mu is part of the repo | |
260 |
|
261 | |||
261 | $ git ls-files |
|
262 | $ git ls-files | |
262 | a/mu |
|
263 | a/mu | |
263 | alpha |
|
264 | alpha | |
264 | beta |
|
265 | beta | |
265 | $ hg files |
|
266 | $ hg files | |
266 | a/mu |
|
267 | a/mu | |
267 | alpha |
|
268 | alpha | |
268 | beta |
|
269 | beta | |
269 |
|
270 | |||
270 | hg and git status both clean |
|
271 | hg and git status both clean | |
271 |
|
272 | |||
272 | $ git status |
|
273 | $ git status | |
273 | On branch master |
|
274 | On branch master | |
274 | nothing to commit, working tree clean |
|
275 | nothing to commit, working tree clean | |
275 | $ hg status |
|
276 | $ hg status | |
276 | heads mismatch, rebuilding dagcache |
|
277 | heads mismatch, rebuilding dagcache | |
277 |
|
278 | |||
278 |
|
279 | |||
279 | node|shortest works correctly |
|
280 | node|shortest works correctly | |
280 | $ hg log -T '{node}\n' | sort |
|
281 | $ hg log -T '{node}\n' | sort | |
281 | 3d9be8deba43482be2c81a4cb4be1f10d85fa8bc |
|
282 | 3d9be8deba43482be2c81a4cb4be1f10d85fa8bc | |
282 | 6626247b7dc8f231b183b8a4761c89139baca2ad |
|
283 | 5b2c80b027ce4250f88957326c199a2dc48dad60 | |
283 | a1983dd7fb19cbd83ad5a1c2fc8bf3d775dea12f |
|
284 | 980d4f79a9c617d60d0fe1fb383753c4a61bea8e | |
284 | ae1ab744f95bfd5b07cf573baef98a778058537b |
|
285 | c1a41c49866ecc9c5411be932653e5b430961dd5 | |
285 | c5864c9d16fb3431fe2c175ff84dc6accdbb2c18 |
|
286 | c5864c9d16fb3431fe2c175ff84dc6accdbb2c18 | |
286 | d8ee22687733a1991813560b15128cd9734f4b48 |
|
287 | cf6ddf5d9b8a120bf90020342bcf7a96d0167279 | |
287 |
$ hg log -r |
|
288 | $ hg log -r c1a41c49866ecc9c5411be932653e5b430961dd5 --template "{shortest(node,1)}\n" | |
288 | ae |
|
289 | c1 | |
289 |
|
290 | |||
290 | This covers gitlog._partialmatch() |
|
291 | This covers gitlog._partialmatch() | |
291 |
$ hg log -r |
|
292 | $ hg log -r c | |
292 |
abort: ambiguous revision identifier: |
|
293 | abort: ambiguous revision identifier: c | |
293 | [10] |
|
294 | [10] | |
294 |
$ hg log -r |
|
295 | $ hg log -r c1 | |
295 |
changeset: |
|
296 | changeset: 5:c1a41c49866e | |
296 | user: test <test> |
|
297 | bookmark: master | |
297 | date: Fri Mar 06 14:26:27 2020 -0500 |
|
298 | tag: tip | |
298 | summary: more alpha |
|
299 | user: test <test@example.org> | |
|
300 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
301 | summary: Introduce file a/mu | |||
299 |
|
302 | |||
300 | $ hg log -r dead |
|
303 | $ hg log -r dead | |
301 | abort: unknown revision 'dead' |
|
304 | abort: unknown revision 'dead' | |
302 | [255] |
|
305 | [255] | |
303 |
|
306 | |||
304 | This coveres changelog.findmissing() |
|
307 | This coveres changelog.findmissing() | |
305 | $ hg merge --preview 3d9be8deba43 |
|
308 | $ hg merge --preview 3d9be8deba43 | |
306 |
|
309 | |||
307 | This covers manifest.diff() |
|
310 | This covers manifest.diff() | |
308 | $ hg diff -c 3d9be8deba43 |
|
311 | $ hg diff -c 3d9be8deba43 | |
309 | diff -r c5864c9d16fb -r 3d9be8deba43 beta |
|
312 | diff -r c5864c9d16fb -r 3d9be8deba43 beta | |
310 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
313 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
311 | +++ b/beta Mon Jan 01 00:00:11 2007 +0000 |
|
314 | +++ b/beta Mon Jan 01 00:00:11 2007 +0000 | |
312 | @@ -0,0 +1,1 @@ |
|
315 | @@ -0,0 +1,1 @@ | |
313 | +beta |
|
316 | +beta | |
314 |
|
317 | |||
315 |
|
318 | |||
316 | Interactive commit should work as expected |
|
319 | Interactive commit should work as expected | |
317 |
|
320 | |||
318 | $ echo bar >> alpha |
|
321 | $ echo bar >> alpha | |
319 | $ echo bar >> beta |
|
322 | $ echo bar >> beta | |
320 | $ hg commit -m "test interactive commit" -i --config ui.interactive=true --config ui.interface=text << EOF |
|
323 | $ hg commit -m "test interactive commit" -i --config ui.interactive=true --config ui.interface=text << EOF | |
321 | > y |
|
324 | > y | |
322 | > y |
|
325 | > y | |
323 | > n |
|
326 | > n | |
324 | > EOF |
|
327 | > EOF | |
325 | diff --git a/alpha b/alpha |
|
328 | diff --git a/alpha b/alpha | |
326 | 1 hunks, 1 lines changed |
|
329 | 1 hunks, 1 lines changed | |
327 | examine changes to 'alpha'? |
|
330 | examine changes to 'alpha'? | |
328 | (enter ? for help) [Ynesfdaq?] y |
|
331 | (enter ? for help) [Ynesfdaq?] y | |
329 |
|
332 | |||
330 | @@ -1,3 +1,4 @@ |
|
333 | @@ -1,3 +1,4 @@ | |
331 | alpha |
|
334 | alpha | |
332 | a |
|
335 | a | |
333 | a |
|
336 | a | |
334 | +bar |
|
337 | +bar | |
335 | record change 1/2 to 'alpha'? |
|
338 | record change 1/2 to 'alpha'? | |
336 | (enter ? for help) [Ynesfdaq?] y |
|
339 | (enter ? for help) [Ynesfdaq?] y | |
337 |
|
340 | |||
338 | diff --git a/beta b/beta |
|
341 | diff --git a/beta b/beta | |
339 | 1 hunks, 1 lines changed |
|
342 | 1 hunks, 1 lines changed | |
340 | examine changes to 'beta'? |
|
343 | examine changes to 'beta'? | |
341 | (enter ? for help) [Ynesfdaq?] n |
|
344 | (enter ? for help) [Ynesfdaq?] n | |
342 |
|
345 | |||
343 | Status should be consistent for both systems |
|
346 | Status should be consistent for both systems | |
344 |
|
347 | |||
345 | $ hg status |
|
348 | $ hg status | |
346 | heads mismatch, rebuilding dagcache |
|
349 | heads mismatch, rebuilding dagcache | |
347 | M beta |
|
350 | M beta | |
348 | $ git status | egrep -v '^$|^ \(use ' |
|
351 | $ git status | egrep -v '^$|^ \(use ' | |
349 | On branch master |
|
352 | On branch master | |
350 | Changes not staged for commit: |
|
353 | Changes not staged for commit: | |
351 | modified: beta |
|
354 | modified: beta | |
352 | no changes added to commit (use "git add" and/or "git commit -a") |
|
355 | no changes added to commit (use "git add" and/or "git commit -a") | |
353 |
|
356 | |||
354 | Contents of each commit should be the same |
|
357 | Contents of each commit should be the same | |
355 |
|
358 | |||
356 | $ hg ex -r . |
|
359 | $ hg ex -r . | |
357 | # HG changeset patch |
|
360 | # HG changeset patch | |
358 | # User test <test> |
|
361 | # User test <test@example.org> | |
359 | # Date 0 0 |
|
362 | # Date 0 0 | |
360 | # Thu Jan 01 00:00:00 1970 +0000 |
|
363 | # Thu Jan 01 00:00:00 1970 +0000 | |
361 | # Node ID 80adc61cf57e99f6a412d83fee6239d1556cefcf |
|
364 | # Node ID 6024eda7986da123aa6797dd4603bd399d49bf5c | |
362 | # Parent ae1ab744f95bfd5b07cf573baef98a778058537b |
|
365 | # Parent c1a41c49866ecc9c5411be932653e5b430961dd5 | |
363 | test interactive commit |
|
366 | test interactive commit | |
364 |
|
367 | |||
365 |
diff -r |
|
368 | diff -r c1a41c49866e -r 6024eda7986d alpha | |
366 | --- a/alpha Thu Jan 01 00:00:00 1970 +0000 |
|
369 | --- a/alpha Thu Jan 01 00:00:00 1970 +0000 | |
367 | +++ b/alpha Thu Jan 01 00:00:00 1970 +0000 |
|
370 | +++ b/alpha Thu Jan 01 00:00:00 1970 +0000 | |
368 | @@ -1,3 +1,4 @@ |
|
371 | @@ -1,3 +1,4 @@ | |
369 | alpha |
|
372 | alpha | |
370 | a |
|
373 | a | |
371 | a |
|
374 | a | |
372 | +bar |
|
375 | +bar | |
373 | $ git show |
|
376 | $ git show | |
374 | commit 80adc61cf57e99f6a412d83fee6239d1556cefcf |
|
377 | commit 6024eda7986da123aa6797dd4603bd399d49bf5c | |
375 | Author: test <test> |
|
378 | Author: test <test@example.org> | |
376 | Date: Thu Jan 1 00:00:00 1970 +0000 |
|
379 | Date: Thu Jan 1 00:00:00 1970 +0000 | |
377 |
|
380 | |||
378 | test interactive commit |
|
381 | test interactive commit | |
379 |
|
382 | |||
380 | diff --git a/alpha b/alpha |
|
383 | diff --git a/alpha b/alpha | |
381 | index d112a75..d2a2e9a 100644 |
|
384 | index d112a75..d2a2e9a 100644 | |
382 | --- a/alpha |
|
385 | --- a/alpha | |
383 | +++ b/alpha |
|
386 | +++ b/alpha | |
384 | @@ -1,3 +1,4 @@ |
|
387 | @@ -1,3 +1,4 @@ | |
385 | alpha |
|
388 | alpha | |
386 | a |
|
389 | a | |
387 | a |
|
390 | a | |
388 | +bar |
|
391 | +bar | |
389 |
|
392 | |||
390 | Deleting files should also work (this was issue6398) |
|
393 | Deleting files should also work (this was issue6398) | |
391 | $ hg revert -r . --all |
|
394 | $ hg revert -r . --all | |
392 | reverting beta |
|
395 | reverting beta | |
393 | $ hg rm beta |
|
396 | $ hg rm beta | |
394 | $ hg ci -m 'remove beta' |
|
397 | $ hg ci -m 'remove beta' | |
395 |
|
398 | |||
396 | This covers changelog.tiprev() (issue6510) |
|
399 | This covers changelog.tiprev() (issue6510) | |
397 | $ hg log -r '(.^^):' |
|
400 | $ hg log -r '(.^^):' | |
398 | heads mismatch, rebuilding dagcache |
|
401 | heads mismatch, rebuilding dagcache | |
399 |
changeset: 5: |
|
402 | changeset: 5:c1a41c49866e | |
400 | user: test <test> |
|
403 | user: test <test@example.org> | |
401 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
404 | date: Thu Jan 01 00:00:00 1970 +0000 | |
402 | summary: Introduce file a/mu |
|
405 | summary: Introduce file a/mu | |
403 |
|
406 | |||
404 |
changeset: 6: |
|
407 | changeset: 6:6024eda7986d | |
405 | user: test <test> |
|
408 | user: test <test@example.org> | |
406 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
409 | date: Thu Jan 01 00:00:00 1970 +0000 | |
407 | summary: test interactive commit |
|
410 | summary: test interactive commit | |
408 |
|
411 | |||
409 |
changeset: 7:1 |
|
412 | changeset: 7:1a0fee76bfc4 | |
410 | bookmark: master |
|
413 | bookmark: master | |
411 | tag: tip |
|
414 | tag: tip | |
412 | user: test <test> |
|
415 | user: test <test@example.org> | |
413 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
416 | date: Thu Jan 01 00:00:00 1970 +0000 | |
414 | summary: remove beta |
|
417 | summary: remove beta | |
415 |
|
418 | |||
416 | This covers changelog.headrevs() with a non-None arg |
|
419 | This covers changelog.headrevs() with a non-None arg | |
417 |
|
||||
418 | TODO: Fix the user name. The stray > char also break `hg ci --amend`. |
|
|||
419 | $ hg log -r 'heads(.)' -Tcompact |
|
420 | $ hg log -r 'heads(.)' -Tcompact | |
420 |
7[tip][master] 1 |
|
421 | 7[tip][master] 1a0fee76bfc4 1970-01-01 00:00 +0000 test | |
421 | remove beta |
|
422 | remove beta | |
422 |
|
423 | |||
423 |
|
424 | |||
424 |
|
425 |
General Comments 0
You need to be logged in to leave comments.
Login now