Show More
@@ -358,7 +358,7 b' def rebase(ui, repo, **opts):' | |||
|
358 | 358 | |
|
359 | 359 | # Keep track of the current bookmarks in order to reset them later |
|
360 | 360 | currentbookmarks = repo._bookmarks.copy() |
|
361 |
activebookmark = activebookmark or repo._bookmark |
|
|
361 | activebookmark = activebookmark or repo._activebookmark | |
|
362 | 362 | if activebookmark: |
|
363 | 363 | bookmarks.deactivate(repo) |
|
364 | 364 | |
@@ -1052,7 +1052,7 b' def pullrebase(orig, ui, repo, *args, **' | |||
|
1052 | 1052 | hg.update(repo, dest) |
|
1053 | 1053 | if bookmarks.update(repo, [movemarkfrom], repo['.'].node()): |
|
1054 | 1054 | ui.status(_("updating bookmark %s\n") |
|
1055 |
% repo._bookmark |
|
|
1055 | % repo._activebookmark) | |
|
1056 | 1056 | else: |
|
1057 | 1057 | if opts.get('tool'): |
|
1058 | 1058 | raise util.Abort(_('--tool can only be used with --rebase')) |
@@ -163,7 +163,7 b' def createcmd(ui, repo, pats, opts):' | |||
|
163 | 163 | |
|
164 | 164 | # we never need the user, so we use a generic user for all shelve operations |
|
165 | 165 | user = 'shelve@localhost' |
|
166 |
label = repo._bookmark |
|
|
166 | label = repo._activebookmark or parent.branch() or 'default' | |
|
167 | 167 | |
|
168 | 168 | # slashes aren't allowed in filenames, therefore we rename it |
|
169 | 169 | label = label.replace('/', '_') |
@@ -60,7 +60,7 b' def strip(ui, repo, revs, update=True, b' | |||
|
60 | 60 | |
|
61 | 61 | marks = repo._bookmarks |
|
62 | 62 | if bookmark: |
|
63 |
if bookmark == repo._bookmark |
|
|
63 | if bookmark == repo._activebookmark: | |
|
64 | 64 | bookmarks.deactivate(repo) |
|
65 | 65 | del marks[bookmark] |
|
66 | 66 | marks.write() |
@@ -83,7 +83,7 b' class bmstore(dict):' | |||
|
83 | 83 | |
|
84 | 84 | def _writerepo(self, repo): |
|
85 | 85 | """Factored out for extensibility""" |
|
86 |
if repo._bookmark |
|
|
86 | if repo._activebookmark not in self: | |
|
87 | 87 | deactivate(repo) |
|
88 | 88 | |
|
89 | 89 | wlock = repo.wlock() |
@@ -137,7 +137,7 b' def activate(repo, mark):' | |||
|
137 | 137 | if mark not in repo._bookmarks: |
|
138 | 138 | raise AssertionError('bookmark %s does not exist!' % mark) |
|
139 | 139 | |
|
140 |
current = repo._bookmark |
|
|
140 | current = repo._activebookmark | |
|
141 | 141 | if current == mark: |
|
142 | 142 | return |
|
143 | 143 | |
@@ -148,7 +148,7 b' def activate(repo, mark):' | |||
|
148 | 148 | file.close() |
|
149 | 149 | finally: |
|
150 | 150 | wlock.release() |
|
151 |
repo._bookmark |
|
|
151 | repo._activebookmark = mark | |
|
152 | 152 | |
|
153 | 153 | def deactivate(repo): |
|
154 | 154 | """ |
@@ -158,7 +158,7 b' def deactivate(repo):' | |||
|
158 | 158 | try: |
|
159 | 159 | try: |
|
160 | 160 | repo.vfs.unlink('bookmarks.current') |
|
161 |
repo._bookmark |
|
|
161 | repo._activebookmark = None | |
|
162 | 162 | except OSError, inst: |
|
163 | 163 | if inst.errno != errno.ENOENT: |
|
164 | 164 | raise |
@@ -172,7 +172,7 b' def iscurrent(repo, mark=None, parents=N' | |||
|
172 | 172 | parent of the working directory. |
|
173 | 173 | ''' |
|
174 | 174 | if not mark: |
|
175 |
mark = repo._bookmark |
|
|
175 | mark = repo._activebookmark | |
|
176 | 176 | if not parents: |
|
177 | 177 | parents = [p.node() for p in repo[None].parents()] |
|
178 | 178 | marks = repo._bookmarks |
@@ -209,7 +209,7 b' def calculateupdate(ui, repo, checkout):' | |||
|
209 | 209 | check out and where to move the active bookmark from, if needed.''' |
|
210 | 210 | movemarkfrom = None |
|
211 | 211 | if checkout is None: |
|
212 |
curmark = repo._bookmark |
|
|
212 | curmark = repo._activebookmark | |
|
213 | 213 | if iscurrent(repo): |
|
214 | 214 | movemarkfrom = repo['.'].node() |
|
215 | 215 | elif curmark: |
@@ -221,7 +221,7 b' def update(repo, parents, node):' | |||
|
221 | 221 | deletefrom = parents |
|
222 | 222 | marks = repo._bookmarks |
|
223 | 223 | update = False |
|
224 |
cur = repo._bookmark |
|
|
224 | cur = repo._activebookmark | |
|
225 | 225 | if not cur: |
|
226 | 226 | return False |
|
227 | 227 |
@@ -2480,13 +2480,13 b' def amend(ui, repo, commitfunc, old, ext' | |||
|
2480 | 2480 | # First, do a regular commit to record all changes in the working |
|
2481 | 2481 | # directory (if there are any) |
|
2482 | 2482 | ui.callhooks = False |
|
2483 |
currentbookmark = repo._bookmark |
|
|
2483 | currentbookmark = repo._activebookmark | |
|
2484 | 2484 | try: |
|
2485 |
repo._bookmark |
|
|
2485 | repo._activebookmark = None | |
|
2486 | 2486 | opts['message'] = 'temporary amend commit for %s' % old |
|
2487 | 2487 | node = commit(ui, repo, commitfunc, pats, opts) |
|
2488 | 2488 | finally: |
|
2489 |
repo._bookmark |
|
|
2489 | repo._activebookmark = currentbookmark | |
|
2490 | 2490 | ui.callhooks = True |
|
2491 | 2491 | ctx = repo[node] |
|
2492 | 2492 | |
@@ -2722,7 +2722,7 b' def buildcommittext(repo, ctx, subs, ext' | |||
|
2722 | 2722 | if ctx.branch(): |
|
2723 | 2723 | edittext.append(_("HG: branch '%s'") % ctx.branch()) |
|
2724 | 2724 | if bookmarks.iscurrent(repo): |
|
2725 |
edittext.append(_("HG: bookmark '%s'") % repo._bookmark |
|
|
2725 | edittext.append(_("HG: bookmark '%s'") % repo._activebookmark) | |
|
2726 | 2726 | edittext.extend([_("HG: subrepo %s") % s for s in subs]) |
|
2727 | 2727 | edittext.extend([_("HG: added %s") % f for f in added]) |
|
2728 | 2728 | edittext.extend([_("HG: changed %s") % f for f in modified]) |
@@ -979,7 +979,7 b' def bookmark(ui, repo, *names, **opts):' | |||
|
979 | 979 | if mark not in marks: |
|
980 | 980 | raise util.Abort(_("bookmark '%s' does not exist") % |
|
981 | 981 | mark) |
|
982 |
if mark == repo._bookmark |
|
|
982 | if mark == repo._activebookmark: | |
|
983 | 983 | bookmarks.deactivate(repo) |
|
984 | 984 | del marks[mark] |
|
985 | 985 | marks.write() |
@@ -994,7 +994,7 b' def bookmark(ui, repo, *names, **opts):' | |||
|
994 | 994 | raise util.Abort(_("bookmark '%s' does not exist") % rename) |
|
995 | 995 | checkconflict(repo, mark, cur, force) |
|
996 | 996 | marks[mark] = marks[rename] |
|
997 |
if repo._bookmark |
|
|
997 | if repo._activebookmark == rename and not inactive: | |
|
998 | 998 | bookmarks.activate(repo, mark) |
|
999 | 999 | del marks[rename] |
|
1000 | 1000 | marks.write() |
@@ -1005,7 +1005,7 b' def bookmark(ui, repo, *names, **opts):' | |||
|
1005 | 1005 | mark = checkformat(mark) |
|
1006 | 1006 | if newact is None: |
|
1007 | 1007 | newact = mark |
|
1008 |
if inactive and mark == repo._bookmark |
|
|
1008 | if inactive and mark == repo._activebookmark: | |
|
1009 | 1009 | bookmarks.deactivate(repo) |
|
1010 | 1010 | return |
|
1011 | 1011 | tgt = cur |
@@ -1015,14 +1015,14 b' def bookmark(ui, repo, *names, **opts):' | |||
|
1015 | 1015 | marks[mark] = tgt |
|
1016 | 1016 | if not inactive and cur == marks[newact] and not rev: |
|
1017 | 1017 | bookmarks.activate(repo, newact) |
|
1018 |
elif cur != tgt and newact == repo._bookmark |
|
|
1018 | elif cur != tgt and newact == repo._activebookmark: | |
|
1019 | 1019 | bookmarks.deactivate(repo) |
|
1020 | 1020 | marks.write() |
|
1021 | 1021 | |
|
1022 | 1022 | elif inactive: |
|
1023 | 1023 | if len(marks) == 0: |
|
1024 | 1024 | ui.status(_("no bookmarks set\n")) |
|
1025 |
elif not repo._bookmark |
|
|
1025 | elif not repo._activebookmark: | |
|
1026 | 1026 | ui.status(_("no active bookmark\n")) |
|
1027 | 1027 | else: |
|
1028 | 1028 | bookmarks.deactivate(repo) |
@@ -1035,7 +1035,7 b' def bookmark(ui, repo, *names, **opts):' | |||
|
1035 | 1035 | if len(marks) == 0 and not fm: |
|
1036 | 1036 | ui.status(_("no bookmarks set\n")) |
|
1037 | 1037 | for bmark, n in sorted(marks.iteritems()): |
|
1038 |
current = repo._bookmark |
|
|
1038 | current = repo._activebookmark | |
|
1039 | 1039 | if bmark == current: |
|
1040 | 1040 | prefix, label = '*', 'bookmarks.current' |
|
1041 | 1041 | else: |
@@ -1506,7 +1506,7 b' def commit(ui, repo, *pats, **opts):' | |||
|
1506 | 1506 | match, |
|
1507 | 1507 | extra=extra) |
|
1508 | 1508 | |
|
1509 |
current = repo._bookmark |
|
|
1509 | current = repo._activebookmark | |
|
1510 | 1510 | marks = old.bookmarks() |
|
1511 | 1511 | node = cmdutil.amend(ui, repo, commitfunc, old, extra, pats, opts) |
|
1512 | 1512 | if node == old.node(): |
@@ -4702,9 +4702,9 b' def merge(ui, repo, node=None, **opts):' | |||
|
4702 | 4702 | if node: |
|
4703 | 4703 | node = scmutil.revsingle(repo, node).node() |
|
4704 | 4704 | |
|
4705 |
if not node and repo._bookmark |
|
|
4706 |
bmheads = repo.bookmarkheads(repo._bookmark |
|
|
4707 |
curhead = repo[repo._bookmark |
|
|
4705 | if not node and repo._activebookmark: | |
|
4706 | bmheads = repo.bookmarkheads(repo._activebookmark) | |
|
4707 | curhead = repo[repo._activebookmark].node() | |
|
4708 | 4708 | if len(bmheads) == 2: |
|
4709 | 4709 | if curhead == bmheads[0]: |
|
4710 | 4710 | node = bmheads[1] |
@@ -4719,7 +4719,7 b' def merge(ui, repo, node=None, **opts):' | |||
|
4719 | 4719 | "please merge with an explicit rev or bookmark"), |
|
4720 | 4720 | hint=_("run 'hg heads' to see all heads")) |
|
4721 | 4721 | |
|
4722 |
if not node and not repo._bookmark |
|
|
4722 | if not node and not repo._activebookmark: | |
|
4723 | 4723 | branch = repo[None].branch() |
|
4724 | 4724 | bheads = repo.branchheads(branch) |
|
4725 | 4725 | nbhs = [bh for bh in bheads if not repo[bh].bookmarks()] |
@@ -5049,7 +5049,7 b' def postincoming(ui, repo, modheads, opt' | |||
|
5049 | 5049 | return 0 |
|
5050 | 5050 | if not ret and not checkout: |
|
5051 | 5051 | if bookmarks.update(repo, [movemarkfrom], repo['.'].node()): |
|
5052 |
ui.status(_("updating bookmark %s\n") % repo._bookmark |
|
|
5052 | ui.status(_("updating bookmark %s\n") % repo._activebookmark) | |
|
5053 | 5053 | return ret |
|
5054 | 5054 | if modheads > 1: |
|
5055 | 5055 | currentbranchheads = len(repo.branchheads()) |
@@ -5914,7 +5914,7 b' def summary(ui, repo, **opts):' | |||
|
5914 | 5914 | ui.status(m, label='log.branch') |
|
5915 | 5915 | |
|
5916 | 5916 | if marks: |
|
5917 |
current = repo._bookmark |
|
|
5917 | current = repo._activebookmark | |
|
5918 | 5918 | # i18n: column positioning for "hg summary" |
|
5919 | 5919 | ui.write(_('bookmarks:'), label='log.bookmark') |
|
5920 | 5920 | if current is not None: |
@@ -6405,14 +6405,14 b' def update(ui, repo, node=None, rev=None' | |||
|
6405 | 6405 | |
|
6406 | 6406 | if not ret and movemarkfrom: |
|
6407 | 6407 | if bookmarks.update(repo, [movemarkfrom], repo['.'].node()): |
|
6408 |
ui.status(_("updating bookmark %s\n") % repo._bookmark |
|
|
6408 | ui.status(_("updating bookmark %s\n") % repo._activebookmark) | |
|
6409 | 6409 | elif brev in repo._bookmarks: |
|
6410 | 6410 | bookmarks.activate(repo, brev) |
|
6411 | 6411 | ui.status(_("(activating bookmark %s)\n") % brev) |
|
6412 | 6412 | elif brev: |
|
6413 |
if repo._bookmark |
|
|
6413 | if repo._activebookmark: | |
|
6414 | 6414 | ui.status(_("(leaving bookmark %s)\n") % |
|
6415 |
repo._bookmark |
|
|
6415 | repo._activebookmark) | |
|
6416 | 6416 | bookmarks.deactivate(repo) |
|
6417 | 6417 | |
|
6418 | 6418 | return ret |
@@ -415,7 +415,7 b' class localrepository(object):' | |||
|
415 | 415 | return bookmarks.bmstore(self) |
|
416 | 416 | |
|
417 | 417 | @repofilecache('bookmarks.current') |
|
418 |
def _bookmark |
|
|
418 | def _activebookmark(self): | |
|
419 | 419 | return bookmarks.readactive(self) |
|
420 | 420 | |
|
421 | 421 | def bookmarkheads(self, bookmark): |
@@ -210,7 +210,7 b' def showbookmarks(**args):' | |||
|
210 | 210 | """ |
|
211 | 211 | repo = args['ctx']._repo |
|
212 | 212 | bookmarks = args['ctx'].bookmarks() |
|
213 |
current = repo._bookmark |
|
|
213 | current = repo._activebookmark | |
|
214 | 214 | makemap = lambda v: {'bookmark': v, 'current': current} |
|
215 | 215 | f = _showlist('bookmark', bookmarks, **args) |
|
216 | 216 | return _hybrid(f, bookmarks, makemap, lambda x: x['bookmark']) |
@@ -227,7 +227,7 b' def showcurrentbookmark(**args):' | |||
|
227 | 227 | import bookmarks as bookmarks # to avoid circular import issues |
|
228 | 228 | repo = args['repo'] |
|
229 | 229 | if bookmarks.iscurrent(repo): |
|
230 |
current = repo._bookmark |
|
|
230 | current = repo._activebookmark | |
|
231 | 231 | if current in args['ctx'].bookmarks(): |
|
232 | 232 | return current |
|
233 | 233 | return '' |
General Comments 0
You need to be logged in to leave comments.
Login now