annotate tests/test-rebase-legacy.t @ 41163:0101a35deae2

phabricator: warn if unable to amend, instead of aborting after posting There was a divergence in behavior here between obsolete and strip based amending. I first noticed the abort when testing outside of the test harness, but then had trouble recreating it here after reverting the code changes. It turns out, strip based amend was successfully amending the public commit after it was posted! It looks like the protection is in the `commit --amend` command, not in the underlying code that it calls. I considered doing a preflight check and aborting. But the locks are only acquired at the end, if amending, and this is too large a section of code to be wrapped in a maybe-it's-held-or-not context manager for my tastes. Additionally, some people do post-push reviews, and amending is the default behavior, so they shouldn't see a misleading error message. The lack of a 'Differential Revision' entry in the commit message breaks a {phabreview} test, so it had to be partially conditionalized.
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 05 Jan 2019 15:20:33 -0500
parents 4441705b7111
children 35ebdbb38efb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
34004
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
1 Test rebase --continue with rebasestate written by legacy client
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
2
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
3 $ cat >> $HGRCPATH <<EOF
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
4 > [extensions]
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
5 > rebase=
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
6 > drawdag=$TESTDIR/drawdag.py
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
7 > EOF
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
8
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
9 $ hg init
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
10 $ hg debugdrawdag <<'EOF'
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
11 > D H
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
12 > | |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
13 > C G
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
14 > | |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
15 > B F
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
16 > | |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
17 > Z A E
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
18 > \|/
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
19 > R
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
20 > EOF
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
21
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
22 rebasestate generated by a legacy client running "hg rebase -r B+D+E+G+H -d Z"
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
23
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
24 $ touch .hg/last-message.txt
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
25 $ cat > .hg/rebasestate <<EOF
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
26 > 0000000000000000000000000000000000000000
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
27 > f424eb6a8c01c4a0c0fba9f863f79b3eb5b4b69f
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
28 > 0000000000000000000000000000000000000000
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
29 > 0
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
30 > 0
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
31 > 0
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
32 >
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
33 > 21a6c45028857f500f56ae84fbf40689c429305b:-2
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
34 > de008c61a447fcfd93f808ef527d933a84048ce7:0000000000000000000000000000000000000000
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
35 > c1e6b162678d07d0b204e5c8267d51b4e03b633c:0000000000000000000000000000000000000000
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
36 > aeba276fcb7df8e10153a07ee728d5540693f5aa:-3
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
37 > bd5548558fcf354d37613005737a143871bf3723:-3
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
38 > d2fa1c02b2401b0e32867f26cce50818a4bd796a:0000000000000000000000000000000000000000
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
39 > 6f7a236de6852570cd54649ab62b1012bb78abc8:0000000000000000000000000000000000000000
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
40 > 6582e6951a9c48c236f746f186378e36f59f4928:0000000000000000000000000000000000000000
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
41 > EOF
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
42
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
43 $ hg rebase --continue
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
44 rebasing 4:c1e6b162678d "B" (B)
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
45 rebasing 8:6f7a236de685 "D" (D)
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
46 rebasing 2:de008c61a447 "E" (E)
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
47 rebasing 7:d2fa1c02b240 "G" (G)
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
48 rebasing 9:6582e6951a9c "H" (H tip)
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
49 warning: orphaned descendants detected, not stripping c1e6b162678d, de008c61a447
35393
4441705b7111 tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents: 34004
diff changeset
50 saved backup bundle to $TESTTMP/.hg/strip-backup/6f7a236de685-9880a3dc-rebase.hg
34004
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
51
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
52 $ hg log -G -T '{rev}:{node|short} {desc}\n'
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
53 o 11:721b8da0a708 H
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
54 |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
55 o 10:9d65695ec3c2 G
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
56 |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
57 o 9:21c8397a5d68 E
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
58 |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
59 | o 8:fc52970345e8 D
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
60 | |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
61 | o 7:eac96551b107 B
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
62 |/
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
63 | o 6:bd5548558fcf C
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
64 | |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
65 | | o 5:aeba276fcb7d F
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
66 | | |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
67 | o | 4:c1e6b162678d B
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
68 | | |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
69 o | | 3:f424eb6a8c01 Z
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
70 | | |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
71 +---o 2:de008c61a447 E
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
72 | |
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
73 | o 1:21a6c4502885 A
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
74 |/
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
75 o 0:b41ce7760717 R
af609bb3487f rebase: change internal format to support destination map
Jun Wu <quark@fb.com>
parents:
diff changeset
76