Mercurial > hg
comparison tests/test-phabricator.t @ 44719:c482e2fe444c
phabricator: prevent posting obsolete commits
I don't see why this would be useful in the first place. But I had a coworker
submit a single commit that was not a branch head, and the result was to orphan
its child and keep the original commit visible. He then did up arrow + Enter,
and it happily created a new review (since the URL isn't amended into the
original commit specified on the command line) and a new successor, resulting in
a local divergence. I'd like to fix the issue with creating orphans, but this
is simple enough to prevent on its own.
Differential Revision: https://phab.mercurial-scm.org/D8437
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 12 Apr 2020 13:11:42 -0400 |
parents | 0680b8a1992a |
children | 601ce5392cb0 |
comparison
equal
deleted
inserted
replaced
44718:0680b8a1992a | 44719:c482e2fe444c |
---|---|
227 | modified 1 | 227 | modified 1 |
228 | | 228 | |
229 o 0 5cbade24e0fa 1970-01-01 00:00 +0000 test | 229 o 0 5cbade24e0fa 1970-01-01 00:00 +0000 test |
230 added | 230 added |
231 | 231 |
232 Posting obsolete commits is disallowed | |
233 | |
234 $ echo "mod3" > file1.txt | |
235 $ hg ci -m 'modified A' | |
236 $ echo "mod4" > file1.txt | |
237 $ hg ci -m 'modified B' | |
238 | |
239 $ hg up '.^' | |
240 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
241 $ echo 'obsolete' > file1.txt | |
242 $ hg amend --config extensions.amend= | |
243 1 new orphan changesets | |
244 $ hg log -G | |
245 @ changeset: 8:8d83edb3cbac | |
246 | tag: tip | |
247 | parent: 5:1dff6b051abf | |
248 | user: test | |
249 | date: Thu Jan 01 00:00:00 1970 +0000 | |
250 | summary: modified A | |
251 | | |
252 | * changeset: 7:d4ea1b2e3511 | |
253 | | user: test | |
254 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
255 | | instability: orphan | |
256 | | summary: modified B | |
257 | | | |
258 | x changeset: 6:4635d7f0d1ff | |
259 |/ user: test | |
260 | date: Thu Jan 01 00:00:00 1970 +0000 | |
261 | obsolete: rewritten using amend as 8:8d83edb3cbac | |
262 | summary: modified A | |
263 | | |
264 o changeset: 5:1dff6b051abf | |
265 | user: test | |
266 | date: Thu Jan 01 00:00:00 1970 +0000 | |
267 | summary: modified 2 | |
268 | | |
269 o changeset: 4:eb3752621d45 | |
270 | parent: 0:5cbade24e0fa | |
271 | user: test | |
272 | date: Thu Jan 01 00:00:00 1970 +0000 | |
273 | summary: modified 1 | |
274 | | |
275 o changeset: 0:5cbade24e0fa | |
276 user: test | |
277 date: Thu Jan 01 00:00:00 1970 +0000 | |
278 summary: added | |
279 | |
280 $ hg phabsend -r 5:: | |
281 abort: obsolete commits cannot be posted for review | |
282 [255] | |
283 | |
232 $ cd .. | 284 $ cd .. |
233 | 285 |
234 Phabesending a new binary, a modified binary, and a removed binary | 286 Phabesending a new binary, a modified binary, and a removed binary |
235 | 287 |
236 >>> open('bin', 'wb').write(b'\0a') and None | 288 >>> open('bin', 'wb').write(b'\0a') and None |