mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
histedit: add checkunfinished support (issue3955)
The tests contain a couple corner cases where workarounds are now required. Strictly speaking, these are behavior regressions, but of an extremely obscure and marginal sort. Commits or updates in the middle of a histedit would have almost always been fairly serious user error.
This commit is contained in:
parent
f699a2855a
commit
90a5bc169d
@ -512,6 +512,7 @@ def histedit(ui, repo, *freeargs, **opts):
|
||||
os.unlink(os.path.join(repo.path, 'histedit-state'))
|
||||
return
|
||||
else:
|
||||
cmdutil.checkunfinished(repo)
|
||||
cmdutil.bailifchanged(repo)
|
||||
|
||||
topmost, empty = repo.dirstate.parents()
|
||||
@ -872,3 +873,6 @@ def summaryhook(ui, repo):
|
||||
|
||||
def extsetup(ui):
|
||||
cmdutil.summaryhooks.add('histedit', summaryhook)
|
||||
cmdutil.unfinishedstates.append(
|
||||
['histedit-state', False, _('histedit in progress'),
|
||||
_("use 'hg histedit --continue' or 'hg histedit --abort'")])
|
||||
|
@ -69,16 +69,12 @@ Go at a random point and try to continue
|
||||
$ hg id -n
|
||||
3+
|
||||
$ hg up 0
|
||||
0 files updated, 0 files merged, 3 files removed, 0 files unresolved
|
||||
$ HGEDITOR='echo foobaz > ' hg histedit --continue
|
||||
abort: 055a42cdd887 is not an ancestor of working directory
|
||||
(update to 055a42cdd887 or descendant and run "hg histedit --continue" again)
|
||||
abort: histedit in progress
|
||||
(use 'hg histedit --continue' or 'hg histedit --abort')
|
||||
[255]
|
||||
$ hg up 3
|
||||
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||
|
||||
commit, then edit the revision
|
||||
$ hg ci -m 'wat'
|
||||
commit, then edit the revision (temporarily disable histedit to allow commit)
|
||||
$ hg ci -m 'wat' --config 'extensions.histedit=!'
|
||||
created new head
|
||||
$ echo a > e
|
||||
$ HGEDITOR='echo foobaz > ' hg histedit --continue 2>&1 | fixbundle
|
||||
|
@ -214,7 +214,7 @@ dropped revision.
|
||||
> 5
|
||||
> EOF
|
||||
$ hg resolve --mark file
|
||||
$ hg commit -m '+5.2'
|
||||
$ hg commit -m '+5.2' --config 'extensions.histedit=!'
|
||||
created new head
|
||||
$ echo 6 >> file
|
||||
$ HGEDITOR=cat hg histedit --continue
|
||||
|
Loading…
Reference in New Issue
Block a user