annotate tests/test-rebase-bookmarks.t @ 18081:f88c60e740a1

revlog.ancestors: add support for including revs This is in preparation for an upcoming refactoring. This also fixes a bug in incancestors, where if an element of revs was an ancestor of another it would be generated twice.
author Siddharth Agarwal <sid0@fb.com>
date Mon, 17 Dec 2012 15:13:51 -0800
parents 2944a6d35158
children 2a1fac3650a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
1 $ cat >> $HGRCPATH <<EOF
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
2 > [extensions]
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
3 > graphlog=
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
4 > rebase=
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
5 >
15742
65df60a3f96b phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14884
diff changeset
6 > [phases]
65df60a3f96b phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14884
diff changeset
7 > publish=False
65df60a3f96b phases: prevent rebase to rebase immutable changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 14884
diff changeset
8 >
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
9 > [alias]
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
10 > tglog = log -G --template "{rev}: '{desc}' bookmarks: {bookmarks}\n"
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
11 > EOF
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
12
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
13 Create a repo with several bookmarks
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
14 $ hg init a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
15 $ cd a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
16
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
17 $ echo a > a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
18 $ hg ci -Am A
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
19 adding a
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
20
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
21 $ echo b > b
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
22 $ hg ci -Am B
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
23 adding b
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
24 $ hg book 'X'
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
25 $ hg book 'Y'
17346
2944a6d35158 check-code: fix check for trailing whitespace on empty lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17345
diff changeset
26
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
27 $ echo c > c
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
28 $ hg ci -Am C
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
29 adding c
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
30 $ hg book 'Z'
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
31
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
32 $ hg up -q 0
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
33
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
34 $ echo d > d
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
35 $ hg ci -Am D
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
36 adding d
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
37 created new head
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
38
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
39 $ hg book W
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
40
17345
4f8054d3171b check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17059
diff changeset
41 $ hg tglog
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
42 @ 3: 'D' bookmarks: W
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
43 |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
44 | o 2: 'C' bookmarks: Y Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
45 | |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
46 | o 1: 'B' bookmarks: X
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
47 |/
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
48 o 0: 'A' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
49
17346
2944a6d35158 check-code: fix check for trailing whitespace on empty lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17345
diff changeset
50
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
51 Move only rebased bookmarks
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
52
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
53 $ cd ..
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
54 $ hg clone -q a a1
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
55
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
56 $ cd a1
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
57 $ hg up -q Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
58
17005
50f434510da6 rebase: do not add second parent to rebased changeset (drop detach option) (BC)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 16913
diff changeset
59 $ hg rebase -s Y -d 3
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
60 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
61
17345
4f8054d3171b check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17059
diff changeset
62 $ hg tglog
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
63 @ 3: 'C' bookmarks: Y Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
64 |
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
65 o 2: 'D' bookmarks: W
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
66 |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
67 | o 1: 'B' bookmarks: X
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
68 |/
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
69 o 0: 'A' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
70
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
71 Keep bookmarks to the correct rebased changeset
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
72
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
73 $ cd ..
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
74 $ hg clone -q a a2
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
75
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
76 $ cd a2
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
77 $ hg up -q Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
78
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
79 $ hg rebase -s 1 -d 3
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
80 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
81
17345
4f8054d3171b check-code: fix check for trailing whitespace on sh command lines
Mads Kiilerich <mads@kiilerich.com>
parents: 17059
diff changeset
82 $ hg tglog
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
83 @ 3: 'C' bookmarks: Y Z
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
84 |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
85 o 2: 'B' bookmarks: X
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
86 |
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
87 o 1: 'D' bookmarks: W
14884
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
88 |
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
89 o 0: 'A' bookmarks:
c0ccd70df52c rebase: reset bookmarks (issue2265 and issue2873)
Stefano Tortarolo <stefano.tortarolo@gmail.com>
parents:
diff changeset
90
17046
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
91
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
92 Keep active bookmark on the correct changeset
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
93
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
94 $ cd ..
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
95 $ hg clone -q a a3
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
96
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
97 $ cd a3
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
98 $ hg up -q X
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
99
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
100 $ hg rebase -d W
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
101 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
102
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
103 $ hg tglog
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
104 @ 3: 'C' bookmarks: Y Z
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
105 |
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
106 o 2: 'B' bookmarks: X
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
107 |
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
108 o 1: 'D' bookmarks: W
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
109 |
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
110 o 0: 'A' bookmarks:
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
111
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
112
4116504d1ec4 bookmarks: correctly update current bookmarks on rebase (issue2277)
David Schleimer <dschleimer@fb.com>
parents: 15742
diff changeset
113 $ cd ..