Show More
@@ -109,16 +109,10 b' def setcurrent(repo, mark):' | |||
|
109 | 109 | def update(repo, parents, node): |
|
110 | 110 | marks = repo._bookmarks |
|
111 | 111 | update = False |
|
112 | if repo.ui.configbool('bookmarks', 'track.current'): | |
|
113 | mark = repo._bookmarkcurrent | |
|
114 |
|
|
|
115 | marks[mark] = node | |
|
116 | update = True | |
|
117 | else: | |
|
118 | for mark, n in marks.items(): | |
|
119 | if n in parents: | |
|
120 | marks[mark] = node | |
|
121 | update = True | |
|
112 | mark = repo._bookmarkcurrent | |
|
113 | if mark and marks[mark] in parents: | |
|
114 | marks[mark] = node | |
|
115 | update = True | |
|
122 | 116 | if update: |
|
123 | 117 | write(repo) |
|
124 | 118 |
@@ -532,17 +532,11 b' def bookmark(ui, repo, mark=None, rev=No' | |||
|
532 | 532 | ui.status(_("no bookmarks set\n")) |
|
533 | 533 | else: |
|
534 | 534 | for bmark, n in sorted(marks.iteritems()): |
|
535 |
|
|
|
536 |
|
|
|
537 |
|
|
|
538 | prefix, label = '*', 'bookmarks.current' | |
|
539 | else: | |
|
540 | prefix, label = ' ', '' | |
|
535 | current = repo._bookmarkcurrent | |
|
536 | if bmark == current and n == cur: | |
|
537 | prefix, label = '*', 'bookmarks.current' | |
|
541 | 538 | else: |
|
542 |
|
|
|
543 | prefix, label = '*', 'bookmarks.current' | |
|
544 | else: | |
|
545 | prefix, label = ' ', '' | |
|
539 | prefix, label = ' ', '' | |
|
546 | 540 | |
|
547 | 541 | if ui.quiet: |
|
548 | 542 | ui.write("%s\n" % bmark, label=label) |
@@ -4059,7 +4053,7 b' def update(ui, repo, node=None, rev=None' | |||
|
4059 | 4053 | else: |
|
4060 | 4054 | ret = hg.update(repo, rev) |
|
4061 | 4055 | |
|
4062 | if repo.ui.configbool('bookmarks', 'track.current'): | |
|
4056 | if brev in repo._bookmarks: | |
|
4063 | 4057 | bookmarks.setcurrent(repo, brev) |
|
4064 | 4058 | |
|
4065 | 4059 | return ret |
@@ -2,7 +2,6 b'' | |||
|
2 | 2 | $ echo "bookmarks=" >> $HGRCPATH |
|
3 | 3 | |
|
4 | 4 | $ echo "[bookmarks]" >> $HGRCPATH |
|
5 | $ echo "track.current = True" >> $HGRCPATH | |
|
6 | 5 | |
|
7 | 6 | $ hg init |
|
8 | 7 |
@@ -1,9 +1,6 b'' | |||
|
1 | 1 | $ echo "[extensions]" >> $HGRCPATH |
|
2 | 2 | $ echo "bookmarks=" >> $HGRCPATH |
|
3 | 3 | |
|
4 | $ echo "[bookmarks]" >> $HGRCPATH | |
|
5 | $ echo "track.current = True" >> $HGRCPATH | |
|
6 | ||
|
7 | 4 | initialize |
|
8 | 5 | |
|
9 | 6 | $ hg init a |
@@ -41,7 +41,6 b' rebase' | |||
|
41 | 41 | |
|
42 | 42 | $ hg log |
|
43 | 43 | changeset: 3:9163974d1cb5 |
|
44 | bookmark: one | |
|
45 | 44 | bookmark: two |
|
46 | 45 | tag: tip |
|
47 | 46 | parent: 1:925d80f479bb |
@@ -57,6 +56,7 b' rebase' | |||
|
57 | 56 | summary: 2 |
|
58 | 57 | |
|
59 | 58 | changeset: 1:925d80f479bb |
|
59 | bookmark: one | |
|
60 | 60 | user: test |
|
61 | 61 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
62 | 62 | summary: 1 |
@@ -61,7 +61,7 b' strip to revision 1' | |||
|
61 | 61 | list bookmarks |
|
62 | 62 | |
|
63 | 63 | $ hg book |
|
64 |
|
|
|
64 | test 1:8cf31af87a2b | |
|
65 | 65 | * test2 1:8cf31af87a2b |
|
66 | 66 | |
|
67 | 67 | immediate rollback and reentrancy issue |
@@ -54,8 +54,8 b' bookmark rev -1 again' | |||
|
54 | 54 | list bookmarks |
|
55 | 55 | |
|
56 | 56 | $ hg bookmarks |
|
57 |
|
|
|
58 |
|
|
|
57 | X 0:f7b1eb17ad24 | |
|
58 | X2 0:f7b1eb17ad24 | |
|
59 | 59 | Y -1:000000000000 |
|
60 | 60 | |
|
61 | 61 | $ echo b > b |
@@ -65,23 +65,21 b' list bookmarks' | |||
|
65 | 65 | bookmarks revset |
|
66 | 66 | |
|
67 | 67 | $ hg log -r 'bookmark()' |
|
68 |
changeset: |
|
|
68 | changeset: 0:f7b1eb17ad24 | |
|
69 | 69 | bookmark: X |
|
70 | 70 | bookmark: X2 |
|
71 | tag: tip | |
|
72 | 71 | user: test |
|
73 | 72 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
74 |
summary: |
|
|
73 | summary: 0 | |
|
75 | 74 | |
|
76 | 75 | $ hg log -r 'bookmark(Y)' |
|
77 | 76 | $ hg log -r 'bookmark(X2)' |
|
78 |
changeset: |
|
|
77 | changeset: 0:f7b1eb17ad24 | |
|
79 | 78 | bookmark: X |
|
80 | 79 | bookmark: X2 |
|
81 | tag: tip | |
|
82 | 80 | user: test |
|
83 | 81 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
84 |
summary: |
|
|
82 | summary: 0 | |
|
85 | 83 | |
|
86 | 84 | $ hg help revsets | grep 'bookmark(' |
|
87 | 85 | "bookmark([name])" |
@@ -89,23 +87,26 b' bookmarks revset' | |||
|
89 | 87 | bookmarks X and X2 moved to rev 1, Y at rev -1 |
|
90 | 88 | |
|
91 | 89 | $ hg bookmarks |
|
92 |
|
|
|
93 |
|
|
|
90 | X 0:f7b1eb17ad24 | |
|
91 | X2 0:f7b1eb17ad24 | |
|
94 | 92 | Y -1:000000000000 |
|
95 | 93 | |
|
96 | 94 | bookmark rev 0 again |
|
97 | 95 | |
|
98 | 96 | $ hg bookmark -r 0 Z |
|
99 | 97 | |
|
98 | $ hg update X | |
|
99 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
|
100 | 100 | $ echo c > c |
|
101 | 101 | $ hg add c |
|
102 | 102 | $ hg commit -m 2 |
|
103 | created new head | |
|
103 | 104 | |
|
104 |
bookmarks X |
|
|
105 | bookmarks X moved to rev 2, Y at rev -1, Z at rev 0 | |
|
105 | 106 | |
|
106 | 107 | $ hg bookmarks |
|
107 |
* X 2: |
|
|
108 |
|
|
|
108 | * X 2:db815d6d32e6 | |
|
109 | X2 0:f7b1eb17ad24 | |
|
109 | 110 | Y -1:000000000000 |
|
110 | 111 | Z 0:f7b1eb17ad24 |
|
111 | 112 | |
@@ -128,8 +129,8 b' force rename to existent bookmark' | |||
|
128 | 129 | list bookmarks |
|
129 | 130 | |
|
130 | 131 | $ hg bookmark |
|
131 |
|
|
|
132 |
* Y 2: |
|
|
132 | X2 0:f7b1eb17ad24 | |
|
133 | * Y 2:db815d6d32e6 | |
|
133 | 134 | Z 0:f7b1eb17ad24 |
|
134 | 135 | |
|
135 | 136 | rename without new name |
@@ -157,19 +158,19 b' bookmark name with spaces should be stri' | |||
|
157 | 158 | list bookmarks |
|
158 | 159 | |
|
159 | 160 | $ hg bookmarks |
|
160 |
|
|
|
161 |
|
|
|
161 | X2 0:f7b1eb17ad24 | |
|
162 | Y 2:db815d6d32e6 | |
|
162 | 163 | Z 0:f7b1eb17ad24 |
|
163 |
* x y 2: |
|
|
164 | * x y 2:db815d6d32e6 | |
|
164 | 165 | |
|
165 | 166 | look up stripped bookmark name |
|
166 | 167 | |
|
167 | 168 | $ hg log -r '"x y"' |
|
168 |
changeset: 2: |
|
|
169 | bookmark: X2 | |
|
169 | changeset: 2:db815d6d32e6 | |
|
170 | 170 | bookmark: Y |
|
171 | 171 | bookmark: x y |
|
172 | 172 | tag: tip |
|
173 | parent: 0:f7b1eb17ad24 | |
|
173 | 174 | user: test |
|
174 | 175 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
175 | 176 | summary: 2 |
@@ -195,10 +196,10 b' force bookmark with existing name' | |||
|
195 | 196 | list bookmarks |
|
196 | 197 | |
|
197 | 198 | $ hg bookmark |
|
198 |
|
|
|
199 |
|
|
|
200 |
* Z 2: |
|
|
201 |
|
|
|
199 | X2 0:f7b1eb17ad24 | |
|
200 | Y 2:db815d6d32e6 | |
|
201 | * Z 2:db815d6d32e6 | |
|
202 | x y 2:db815d6d32e6 | |
|
202 | 203 | |
|
203 | 204 | revision but no bookmark name |
|
204 | 205 |
General Comments 0
You need to be logged in to leave comments.
Login now