Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 20234:8a133190da89
commands.bookmarks: move cur initialization to inside wlock
This is more correct because we now fetch '.' while nothing else can interfere
with it.
author | Siddharth Agarwal <sid0@fb.com> |
---|---|
date | Tue, 19 Nov 2013 12:42:17 -0800 |
parents | 410193f11422 |
children | a602d2aca8bf |
comparison
equal
deleted
inserted
replaced
20233:410193f11422 | 20234:8a133190da89 |
---|---|
806 delete = opts.get('delete') | 806 delete = opts.get('delete') |
807 rename = opts.get('rename') | 807 rename = opts.get('rename') |
808 inactive = opts.get('inactive') | 808 inactive = opts.get('inactive') |
809 | 809 |
810 hexfn = ui.debugflag and hex or short | 810 hexfn = ui.debugflag and hex or short |
811 cur = repo.changectx('.').node() | |
812 | 811 |
813 def checkformat(mark): | 812 def checkformat(mark): |
814 mark = mark.strip() | 813 mark = mark.strip() |
815 if not mark: | 814 if not mark: |
816 raise util.Abort(_("bookmark names cannot consist entirely of " | 815 raise util.Abort(_("bookmark names cannot consist entirely of " |
862 raise util.Abort(_("bookmark name required")) | 861 raise util.Abort(_("bookmark name required")) |
863 | 862 |
864 if delete or rename or names or inactive: | 863 if delete or rename or names or inactive: |
865 wlock = repo.wlock() | 864 wlock = repo.wlock() |
866 try: | 865 try: |
866 cur = repo.changectx('.').node() | |
867 marks = repo._bookmarks | 867 marks = repo._bookmarks |
868 if delete: | 868 if delete: |
869 for mark in names: | 869 for mark in names: |
870 if mark not in marks: | 870 if mark not in marks: |
871 raise util.Abort(_("bookmark '%s' does not exist") % | 871 raise util.Abort(_("bookmark '%s' does not exist") % |