equal
deleted
inserted
replaced
65 if os.path.exists(repo.join('bookmarks')): |
65 if os.path.exists(repo.join('bookmarks')): |
66 util.copyfile(repo.join('bookmarks'), repo.join('undo.bookmarks')) |
66 util.copyfile(repo.join('bookmarks'), repo.join('undo.bookmarks')) |
67 if current(repo) not in refs: |
67 if current(repo) not in refs: |
68 setcurrent(repo, None) |
68 setcurrent(repo, None) |
69 file = repo.opener('bookmarks', 'w+') |
69 file = repo.opener('bookmarks', 'w+') |
70 for refspec, node in refs.items(): |
70 for refspec, node in refs.iteritems(): |
71 file.write("%s %s\n" % (hex(node), refspec)) |
71 file.write("%s %s\n" % (hex(node), refspec)) |
72 file.close() |
72 file.close() |
73 |
73 |
74 def current(repo): |
74 def current(repo): |
75 '''Get the current bookmark |
75 '''Get the current bookmark |
204 the mercurial.strip method. This usually happens during |
204 the mercurial.strip method. This usually happens during |
205 qpush and qpop""" |
205 qpush and qpop""" |
206 revisions = _revstostrip(repo.changelog, node) |
206 revisions = _revstostrip(repo.changelog, node) |
207 marks = parse(repo) |
207 marks = parse(repo) |
208 update = [] |
208 update = [] |
209 for mark, n in marks.items(): |
209 for mark, n in marks.iteritems(): |
210 if repo.changelog.rev(n) in revisions: |
210 if repo.changelog.rev(n) in revisions: |
211 update.append(mark) |
211 update.append(mark) |
212 oldstrip(ui, repo, node, backup) |
212 oldstrip(ui, repo, node, backup) |
213 if len(update) > 0: |
213 if len(update) > 0: |
214 for m in update: |
214 for m in update: |