Mercurial > hg
annotate tests/test-rebase-dest.t @ 44957:1ca0d5cae9bc stable
tests: skip pyflakes for mercurial/thirdparty/
The current version of pyflakes (2.2.0) correctly detects one issue:
mercurial/thirdparty/selectors2.py:335:40 '...'.format(...) has unused arguments at position(s): 1
But we're not interested in fixing lint errors in third-party code, so we need
to exclude at least selectors2.py. And in the discussion for this patch it was
decided to just skip the entire thirdparty directory.
This is a graft of a similar fix that ended up on default.
Differential Revision: https://phab.mercurial-scm.org/D8628
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Sat, 06 Jun 2020 19:19:27 +0800 |
parents | f63598aa1c4b |
children | dc5e5577af39 |
rev | line source |
---|---|
31729
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
1 Require a destination |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
2 $ cat >> $HGRCPATH <<EOF |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
3 > [extensions] |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
4 > rebase = |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
5 > [commands] |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
6 > rebase.requiredest = True |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
7 > EOF |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
8 $ hg init repo |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
9 $ cd repo |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
10 $ echo a >> a |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
11 $ hg commit -qAm aa |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
12 $ echo b >> b |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
13 $ hg commit -qAm bb |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
14 $ hg up ".^" |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
15 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
16 $ echo c >> c |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
17 $ hg commit -qAm cc |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
18 $ hg rebase |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
19 abort: you must specify a destination |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
20 (use: hg rebase -d REV) |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
21 [255] |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
22 $ hg rebase -d 1 |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
23 rebasing 2:5db65b93a12b "cc" (tip) |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
35385
diff
changeset
|
24 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5db65b93a12b-4fb789ec-rebase.hg |
31729
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
25 $ hg rebase -d 0 -r . -q |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
26 $ HGPLAIN=1 hg rebase |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
27 rebasing 2:889b0bc6a730 "cc" (tip) |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
35385
diff
changeset
|
28 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/889b0bc6a730-41ec4f81-rebase.hg |
31729
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
29 $ hg rebase -d 0 -r . -q |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
30 $ hg --config commands.rebase.requiredest=False rebase |
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
31 rebasing 2:279de9495438 "cc" (tip) |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
35385
diff
changeset
|
32 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/279de9495438-ab0a5128-rebase.hg |
31729
c069c4e271e3
rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff
changeset
|
33 |
31730
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
34 Requiring dest should not break continue or other rebase options |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
35 $ hg up 1 -q |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
36 $ echo d >> c |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
37 $ hg commit -qAm dc |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
38 $ hg log -G -T '{rev} {desc}' |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
39 @ 3 dc |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
40 | |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
41 | o 2 cc |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
42 |/ |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
43 o 1 bb |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
44 | |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
45 o 0 aa |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
46 |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
47 $ hg rebase -d 2 |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
48 rebasing 3:0537f6b50def "dc" (tip) |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
49 merging c |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
50 warning: conflicts while merging c! (edit, then use 'hg resolve --mark') |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
51 unresolved conflicts (see hg resolve, then hg rebase --continue) |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
52 [1] |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
53 $ echo d > c |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
54 $ hg resolve --mark --all |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
55 (no more unresolved files) |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
56 continue: hg rebase --continue |
6931c3346551
rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents:
31729
diff
changeset
|
57 $ hg rebase --continue |
31731
b5afec71c1f9
rebase: allow destination-free continue and abort (issue5513)
Ryan McElroy <rmcelroy@fb.com>
parents:
31730
diff
changeset
|
58 rebasing 3:0537f6b50def "dc" (tip) |
35393
4441705b7111
tests: remove (glob) annotations that were only for '\' matches
Matt Harbison <matt_harbison@yahoo.com>
parents:
35385
diff
changeset
|
59 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0537f6b50def-be4c7386-rebase.hg |
31732
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
60 |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
61 $ cd .. |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
62 |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
63 Check rebase.requiredest interaction with pull --rebase |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
64 $ hg clone repo clone |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
65 updating to branch default |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
66 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
67 $ cd repo |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
68 $ echo e > e |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
69 $ hg commit -qAm ee |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
70 $ cd .. |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
71 $ cd clone |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
72 $ echo f > f |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
73 $ hg commit -qAm ff |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
74 $ hg pull --rebase |
31733
ae6bab095c66
rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514)
Ryan McElroy <rmcelroy@fb.com>
parents:
31732
diff
changeset
|
75 abort: rebase destination required by configuration |
ae6bab095c66
rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514)
Ryan McElroy <rmcelroy@fb.com>
parents:
31732
diff
changeset
|
76 (use hg pull followed by hg rebase -d DEST) |
31732
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
77 [255] |
9ddf875183b0
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents:
31731
diff
changeset
|
78 |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
79 Setup rebase with multiple destinations |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
80 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
81 $ cd $TESTTMP |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
82 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
83 $ cat >> $TESTTMP/maprevset.py <<EOF |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
84 > from __future__ import absolute_import |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
85 > from mercurial import registrar, revset, revsetlang, smartset |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
86 > revsetpredicate = registrar.revsetpredicate() |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
87 > cache = {} |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
88 > @revsetpredicate(b'map') |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
89 > def map(repo, subset, x): |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
90 > """(set, mapping)""" |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
91 > setarg, maparg = revsetlang.getargs(x, 2, 2, b'') |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
92 > rset = revset.getset(repo, smartset.fullreposet(repo), setarg) |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
93 > mapstr = revsetlang.getstring(maparg, b'') |
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
94 > map = dict(a.split(b':') for a in mapstr.split(b',')) |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
95 > rev = rset.first() |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
96 > desc = repo[rev].description() |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
97 > newdesc = map.get(desc) |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
98 > if newdesc == b'null': |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
99 > revs = [-1] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
100 > else: |
36272
164ed6d54fdf
tests: add b prefixes to test-rebase-dest.t
Augie Fackler <augie@google.com>
parents:
35709
diff
changeset
|
101 > query = revsetlang.formatspec(b'desc(%s)', newdesc) |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
102 > revs = repo.revs(query) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
103 > return smartset.baseset(revs) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
104 > EOF |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
105 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
106 $ cat >> $HGRCPATH <<EOF |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
107 > [ui] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
108 > allowemptycommit=1 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
109 > [extensions] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
110 > drawdag=$TESTDIR/drawdag.py |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
111 > [phases] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
112 > publish=False |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
113 > [alias] |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
114 > tglog = log -G --template "{rev}: {node|short} {desc} {instabilities}" -r 'sort(all(), topo)' |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
115 > [extensions] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
116 > maprevset=$TESTTMP/maprevset.py |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
117 > [experimental] |
34865
a0100f34e20b
config: replace experimental.stabilization by experimental.evolution
Boris Feld <boris.feld@octobus.net>
parents:
34006
diff
changeset
|
118 > evolution=true |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
119 > EOF |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
120 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
121 $ rebasewithdag() { |
39707
5abc47d4ca6b
tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents:
36272
diff
changeset
|
122 > N=`"$PYTHON" -c "print($N+1)"` |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
123 > hg init repo$N && cd repo$N |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
124 > hg debugdrawdag |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
125 > hg rebase "$@" > _rebasetmp |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
126 > r=$? |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
127 > grep -v 'saved backup bundle' _rebasetmp |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
128 > [ $r -eq 0 ] && rm -f .hg/localtags && hg tglog |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
129 > cd .. |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
130 > return $r |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
131 > } |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
132 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
133 Destination resolves to an empty set: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
134 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
135 $ rebasewithdag -s B -d 'SRC - SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
136 > C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
137 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
138 > B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
139 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
140 > A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
141 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
142 nothing to rebase - empty destination |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
143 [1] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
144 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
145 Multiple destinations and --collapse are not compatible: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
146 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
147 $ rebasewithdag -s C+E -d 'SRC^^' --collapse <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
148 > C F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
149 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
150 > B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
151 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
152 > A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
153 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
154 abort: --collapse does not work with multiple destinations |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
155 [255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
156 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
157 Multiple destinations cannot be used with --base: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
158 |
44556
f63598aa1c4b
rebase: accept multiple --base arguments (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
44555
diff
changeset
|
159 $ rebasewithdag -b B -b E -d 'SRC^^' --collapse <<'EOS' |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
160 > B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
161 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
162 > A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
163 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
164 abort: unknown revision 'SRC'! |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
165 [255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
166 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
167 Rebase to null should work: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
168 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
169 $ rebasewithdag -r A+C+D -d 'null' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
170 > C D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
171 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
172 > A B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
173 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
174 already rebased 0:426bada5c675 "A" (A) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
175 already rebased 2:dc0947a82db8 "C" (C) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
176 rebasing 3:004dc1679908 "D" (D tip) |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
177 o 4: d8d8601abd5e D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
178 |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
179 o 2: dc0947a82db8 C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
180 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
181 | o 1: fc2b737bb2e5 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
182 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
183 o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
184 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
185 Destination resolves to multiple changesets: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
186 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
187 $ rebasewithdag -s B -d 'ALLSRC+SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
188 > C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
189 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
190 > B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
191 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
192 > Z |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
193 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
194 abort: rebase destination for f0a671a46792 is not unique |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
195 [255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
196 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
197 Destination is an ancestor of source: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
198 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
199 $ rebasewithdag -s B -d 'SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
200 > C |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
201 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
202 > B |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
203 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
204 > Z |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
205 > EOS |
34006 | 206 abort: source and destination form a cycle |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
207 [255] |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
208 |
42107
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
209 BUG: cycles aren't flagged correctly when --dry-run is set: |
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
210 $ rebasewithdag -s B -d 'SRC' --dry-run <<'EOS' |
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
211 > C |
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
212 > | |
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
213 > B |
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
214 > | |
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
215 > Z |
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
216 > EOS |
42108
1b5cec8b6a1e
rebase: fix bug that prevented dry-run rebases from printing failures
Augie Fackler <augie@google.com>
parents:
42107
diff
changeset
|
217 abort: source and destination form a cycle |
42107
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
218 starting dry-run rebase; repository will not be changed |
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
219 [255] |
8890fce7c13d
rebase: demonstrate bug in dry-run mode which causes cycles to not be reported
Augie Fackler <augie@google.com>
parents:
39707
diff
changeset
|
220 |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
221 Switch roots: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
222 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
223 $ rebasewithdag -s 'all() - roots(all())' -d 'roots(all()) - ::SRC' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
224 > C F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
225 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
226 > B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
227 > | | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
228 > A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
229 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
230 rebasing 2:112478962961 "B" (B) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
231 rebasing 4:26805aba1e60 "C" (C) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
232 rebasing 3:cd488e83d208 "E" (E) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
233 rebasing 5:0069ba24938a "F" (F tip) |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
234 o 9: d150ff263fc8 F |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
235 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
236 o 8: 66f30a1a2eab E |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
237 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
238 | o 7: 93db94ffae0e C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
239 | | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
240 | o 6: d0071c3b0c88 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
241 | | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
242 | o 1: 058c1e1fb10a D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
243 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
244 o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
245 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
246 Different destinations for merge changesets with a same root: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
247 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
248 $ rebasewithdag -s B -d '((parents(SRC)-B-A)::) - (::ALLSRC)' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
249 > C G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
250 > |\| |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
251 > | F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
252 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
253 > B E |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
254 > |\| |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
255 > A D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
256 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
257 rebasing 3:a4256619d830 "B" (B) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
258 rebasing 6:8e139e245220 "C" (C tip) |
44341
77bb38be00ea
rebase: always be graft-like, not merge-like, also for merges
Martin von Zweigbergk <martinvonz@google.com>
parents:
42108
diff
changeset
|
259 o 8: d7d1169e9b1c C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
260 |\ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
261 | o 7: 2ed0c8546285 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
262 | |\ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
263 o | | 5: 8fdb2c1feb20 G |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
264 | | | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
265 | | o 4: cd488e83d208 E |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
266 | | | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
267 o | | 2: a6661b868de9 F |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
268 / / |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
269 | o 1: 058c1e1fb10a D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
270 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
271 o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
272 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
273 Move to a previous parent: |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
274 |
44555
05654ea5137c
rebase: accept multiple --source arguments (BC)
Martin von Zweigbergk <martinvonz@google.com>
parents:
44341
diff
changeset
|
275 $ rebasewithdag -s E -s F -s G -d 'SRC^^' <<'EOS' |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
276 > H |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
277 > | |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
278 > D G |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
279 > |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
280 > C F |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
281 > |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
282 > B E # E will be ignored, since E^^ is empty |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
283 > |/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
284 > A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
285 > EOS |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
286 rebasing 4:33441538d4aa "F" (F) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
287 rebasing 6:cf43ad9da869 "G" (G) |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
288 rebasing 7:eef94f3b5f03 "H" (H tip) |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
289 o 10: b3d84c6666cf H |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
290 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
291 | o 5: f585351a92f8 D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
292 |/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
293 o 3: 26805aba1e60 C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
294 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
295 | o 9: f7c28a1a15e2 G |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
296 |/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
297 o 1: 112478962961 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
298 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
299 | o 8: 02aa697facf7 F |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
300 |/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
301 | o 2: 7fb047a69f22 E |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
302 |/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
303 o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
304 |
34006 | 305 Source overlaps with destination: |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
306 |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
307 $ rebasewithdag -s 'B+C+D' -d 'map(SRC, "B:C,C:D")' <<'EOS' |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
308 > B C D |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
309 > \|/ |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
310 > A |
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
311 > EOS |
34006 | 312 rebasing 2:dc0947a82db8 "C" (C) |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
313 rebasing 1:112478962961 "B" (B) |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
314 o 5: 5fe9935d5222 B |
34006 | 315 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
316 o 4: 12d20731b9e0 C |
34006 | 317 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
318 o 3: b18e25de2cf5 D |
34006 | 319 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
320 o 0: 426bada5c675 A |
34006 | 321 |
322 Detect cycles early: | |
323 | |
324 $ rebasewithdag -r 'all()-Z' -d 'map(SRC, "A:B,B:C,C:D,D:B")' <<'EOS' | |
325 > A B C | |
326 > \|/ | |
327 > | D | |
328 > |/ | |
329 > Z | |
330 > EOS | |
331 abort: source and destination form a cycle | |
332 [255] | |
333 | |
334 Detect source is ancestor of dest in runtime: | |
335 | |
336 $ rebasewithdag -r 'C+B' -d 'map(SRC, "C:B,B:D")' -q <<'EOS' | |
337 > D | |
338 > | | |
339 > B C | |
340 > \| | |
341 > A | |
342 > EOS | |
343 abort: source is ancestor of destination | |
344 [255] | |
345 | |
346 "Already rebased" fast path still works: | |
347 | |
348 $ rebasewithdag -r 'all()' -d 'SRC^' <<'EOS' | |
349 > E F | |
350 > /| | | |
351 > B C D | |
352 > \|/ | |
353 > A | |
354 > EOS | |
355 already rebased 1:112478962961 "B" (B) | |
356 already rebased 2:dc0947a82db8 "C" (C) | |
357 already rebased 3:b18e25de2cf5 "D" (D) | |
358 already rebased 4:312782b8f06e "E" (E) | |
359 already rebased 5:ad6717a6a58e "F" (F tip) | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
360 o 5: ad6717a6a58e F |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
361 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
362 o 3: b18e25de2cf5 D |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
363 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
364 | o 4: 312782b8f06e E |
34006 | 365 | |\ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
366 +---o 2: dc0947a82db8 C |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
367 | | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
368 | o 1: 112478962961 B |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
369 |/ |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
370 o 0: 426bada5c675 A |
34005
5e83a8fe6bc4
rebase: initial support for multiple destinations
Jun Wu <quark@fb.com>
parents:
33332
diff
changeset
|
371 |
34006 | 372 Massively rewrite the DAG: |
373 | |
374 $ rebasewithdag -r 'all()' -d 'map(SRC, "A:I,I:null,H:A,B:J,J:C,C:H,D:E,F:G,G:K,K:D,E:B")' <<'EOS' | |
375 > D G K | |
376 > | | | | |
377 > C F J | |
378 > | | | | |
379 > B E I | |
380 > \| | | |
381 > A H | |
382 > EOS | |
383 rebasing 4:701514e1408d "I" (I) | |
384 rebasing 0:426bada5c675 "A" (A) | |
385 rebasing 1:e7050b6e5048 "H" (H) | |
386 rebasing 5:26805aba1e60 "C" (C) | |
387 rebasing 7:cf89f86b485b "J" (J) | |
388 rebasing 2:112478962961 "B" (B) | |
389 rebasing 3:7fb047a69f22 "E" (E) | |
390 rebasing 8:f585351a92f8 "D" (D) | |
391 rebasing 10:ae41898d7875 "K" (K tip) | |
392 rebasing 9:711f53bbef0b "G" (G) | |
393 rebasing 6:64a8289d2492 "F" (F) | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
394 o 21: 3735afb3713a F |
34006 | 395 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
396 o 20: 07698142d7a7 G |
34006 | 397 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
398 o 19: 33aba52e7e72 K |
34006 | 399 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
400 o 18: 9fdae89dc5a1 D |
34006 | 401 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
402 o 17: 277dda9a65ee E |
34006 | 403 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
404 o 16: 9c74fd8657ad B |
34006 | 405 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
406 o 15: 6527eb0688bb J |
34006 | 407 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
408 o 14: e94d655b928d C |
34006 | 409 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
410 o 13: 620d6d349459 H |
34006 | 411 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
412 o 12: a569a116758f A |
34006 | 413 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
414 o 11: 2bf1302f5c18 I |
34006 | 415 |
416 Resolve instability: | |
417 | |
418 $ rebasewithdag <<'EOF' -r 'orphan()-obsolete()' -d 'max((successors(max(roots(ALLSRC) & ::SRC)^)-obsolete())::)' | |
419 > F2 | |
420 > | | |
421 > J E E2 | |
422 > | |/ | |
423 > I2 I | E3 | |
424 > \| |/ | |
425 > H | G | |
426 > | | | | |
427 > B2 D F | |
428 > | |/ # rebase: B -> B2 | |
429 > N C # amend: E -> E2 | |
430 > | | # amend: E2 -> E3 | |
431 > M B # rebase: F -> F2 | |
432 > \| # amend: I -> I2 | |
433 > A | |
434 > EOF | |
35709
1a09dad8b85a
evolution: report new unstable changesets
Martin von Zweigbergk <martinvonz@google.com>
parents:
35393
diff
changeset
|
435 6 new orphan changesets |
34006 | 436 rebasing 16:5c432343bf59 "J" (J tip) |
437 rebasing 3:26805aba1e60 "C" (C) | |
438 rebasing 6:f585351a92f8 "D" (D) | |
439 rebasing 10:ffebc37c5d0b "E3" (E3) | |
440 rebasing 13:fb184bcfeee8 "F2" (F2) | |
441 rebasing 11:dc838ab4c0da "G" (G) | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
442 o 22: 174f63d574a8 G |
34006 | 443 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
444 o 21: c9d9fbe76705 F2 |
34006 | 445 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
446 o 20: 0a03c2ede755 E3 |
34006 | 447 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
448 o 19: 228d9d2541b1 D |
34006 | 449 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
450 o 18: cd856b400c95 C |
34006 | 451 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
452 o 17: 9148200c858c J |
34006 | 453 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
454 o 15: eb74780f5094 I2 |
34006 | 455 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
456 o 12: 78309edd643f H |
34006 | 457 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
458 o 5: 4b4531bd8e1d B2 |
34006 | 459 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
460 o 4: 337c285c272b N |
34006 | 461 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
462 o 2: 699bc4b6fa22 M |
34006 | 463 | |
35385
469b06b4c3ca
tests: add commit hashes to log commands in rebase tests
Phil Cohen <phillco@fb.com>
parents:
35287
diff
changeset
|
464 o 0: 426bada5c675 A |
34006 | 465 |