Show More
@@ -59,7 +59,7 b' def write(repo, refs):' | |||
|
59 | 59 | file.write("%s %s\n" % (hex(node), refspec)) |
|
60 | 60 | file.close() |
|
61 | 61 | |
|
62 |
def bookmark(ui, repo, mark=None, rev=None, force=False, delete=False, m |
|
|
62 | def bookmark(ui, repo, mark=None, rev=None, force=False, delete=False, rename=None): | |
|
63 | 63 | '''mercurial bookmarks |
|
64 | 64 | |
|
65 | 65 | Bookmarks are pointers to certain commits that move when |
@@ -76,15 +76,15 b' def bookmark(ui, repo, mark=None, rev=No' | |||
|
76 | 76 | marks = parse(repo) |
|
77 | 77 | cur = repo.changectx('.').node() |
|
78 | 78 | |
|
79 |
if m |
|
|
80 |
if m |
|
|
79 | if rename: | |
|
80 | if rename not in marks: | |
|
81 | 81 | raise util.Abort(_("a bookmark of this name does not exist")) |
|
82 | 82 | if mark in marks and not force: |
|
83 | 83 | raise util.Abort(_("a bookmark of the same name already exists")) |
|
84 | 84 | if mark is None: |
|
85 | 85 | raise util.Abort(_("new bookmark name required")) |
|
86 |
marks[mark] = marks[m |
|
|
87 |
del marks[m |
|
|
86 | marks[mark] = marks[rename] | |
|
87 | del marks[rename] | |
|
88 | 88 | write(repo, marks) |
|
89 | 89 | return |
|
90 | 90 | |
@@ -222,6 +222,6 b' cmdtable = {' | |||
|
222 | 222 | [('f', 'force', False, _('force')), |
|
223 | 223 | ('r', 'rev', '', _('revision')), |
|
224 | 224 | ('d', 'delete', False, _('delete a given bookmark')), |
|
225 |
('m', 'm |
|
|
225 | ('m', 'rename', '', _('rename a given bookmark'))], | |
|
226 | 226 | _('hg bookmarks [-d] [-m NAME] [-r NAME] [NAME]')), |
|
227 | 227 | } |
General Comments 0
You need to be logged in to leave comments.
Login now