mirror of
https://github.com/facebook/sapling.git
synced 2025-01-01 09:37:56 +03:00
rebase: abort cleanly when we encounter a damaged rebasestate (issue4155)
This commit is contained in:
parent
26f147d151
commit
c738b36ce1
@ -658,6 +658,7 @@ def clearstatus(repo):
|
||||
def restorestatus(repo):
|
||||
'Restore a previously stored status'
|
||||
try:
|
||||
keepbranches = None
|
||||
target = None
|
||||
collapse = False
|
||||
external = nullrev
|
||||
@ -687,6 +688,10 @@ def restorestatus(repo):
|
||||
state[repo[oldrev].rev()] = int(newrev)
|
||||
else:
|
||||
state[repo[oldrev].rev()] = repo[newrev].rev()
|
||||
|
||||
if keepbranches is None:
|
||||
raise util.Abort(_('.hg/rebasestate is incomplete'))
|
||||
|
||||
skipped = set()
|
||||
# recompute the set of skipped revs
|
||||
if not collapse:
|
||||
|
@ -13,6 +13,16 @@
|
||||
$ hg init a
|
||||
$ cd a
|
||||
|
||||
$ touch .hg/rebasestate
|
||||
$ hg sum
|
||||
parent: -1:000000000000 tip (empty repository)
|
||||
branch: default
|
||||
commit: (clean)
|
||||
update: (current)
|
||||
abort: .hg/rebasestate is incomplete
|
||||
[255]
|
||||
$ rm .hg/rebasestate
|
||||
|
||||
$ echo c1 > common
|
||||
$ hg add common
|
||||
$ hg ci -m C1
|
||||
|
Loading…
Reference in New Issue
Block a user