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