comparison hgext/histedit.py @ 27171:3028ea0aff46

histedit: mention histedit-last-edit.txt on abort Users may spend a lot of effort writing histedit rules, getting an abort without being told they can recover their work is very frustrating. Avoid that by telling them where to find their work.
author timeless <timeless@mozdev.org>
date Wed, 02 Dec 2015 08:07:36 +0000
parents 4cff4c38c5cc
children 62b9a87a365e
comparison
equal deleted inserted replaced
27170:4cff4c38c5cc 27171:3028ea0aff46
827 state = histeditstate(repo) 827 state = histeditstate(repo)
828 try: 828 try:
829 state.wlock = repo.wlock() 829 state.wlock = repo.wlock()
830 state.lock = repo.lock() 830 state.lock = repo.lock()
831 _histedit(ui, repo, state, *freeargs, **opts) 831 _histedit(ui, repo, state, *freeargs, **opts)
832 except error.Abort:
833 if repo.vfs.exists('histedit-last-edit.txt'):
834 ui.warn(_('warning: histedit rules saved '
835 'to: .hg/histedit-last-edit.txt\n'))
836 raise
832 finally: 837 finally:
833 release(state.lock, state.wlock) 838 release(state.lock, state.wlock)
834 839
835 def _histedit(ui, repo, state, *freeargs, **opts): 840 def _histedit(ui, repo, state, *freeargs, **opts):
836 # TODO only abort if we try to histedit mq patches, not just 841 # TODO only abort if we try to histedit mq patches, not just
955 return 960 return
956 else: 961 else:
957 cmdutil.checkunfinished(repo) 962 cmdutil.checkunfinished(repo)
958 cmdutil.bailifchanged(repo) 963 cmdutil.bailifchanged(repo)
959 964
965 if repo.vfs.exists('histedit-last-edit.txt'):
966 repo.vfs.unlink('histedit-last-edit.txt')
960 topmost, empty = repo.dirstate.parents() 967 topmost, empty = repo.dirstate.parents()
961 if outg: 968 if outg:
962 if freeargs: 969 if freeargs:
963 remote = freeargs[0] 970 remote = freeargs[0]
964 else: 971 else: