hgext/bookmarks.py
changeset 7253 8b81d1e2dc04
parent 7252 104a8324798e
child 7254 d892211d670e
equal deleted inserted replaced
7252:104a8324798e 7253:8b81d1e2dc04
    50     in a format equal to those of localtags.
    50     in a format equal to those of localtags.
    51 
    51 
    52     We also store a backup of the previous state in undo.bookmarks that
    52     We also store a backup of the previous state in undo.bookmarks that
    53     can be copied back on rollback.
    53     can be copied back on rollback.
    54     '''
    54     '''
    55     util.copyfile(repo.join('bookmarks'), repo.join('undo.bookmarks'))
    55     if os.path.exists(repo.join('bookmarks')):
       
    56         util.copyfile(repo.join('bookmarks'), repo.join('undo.bookmarks'))
    56     file = repo.opener('bookmarks', 'w+')
    57     file = repo.opener('bookmarks', 'w+')
    57     for refspec, node in refs.items():
    58     for refspec, node in refs.items():
    58         file.write("%s %s\n" % (hex(node), refspec))
    59         file.write("%s %s\n" % (hex(node), refspec))
    59     file.close()
    60     file.close()
    60 
    61