pushrebase: disallow pushing obsolete commits

Summary:
@durin42 suggested that the extension might want to prevent processing of
obsolete commits.  Given the current state of dealing with conflicting
obsolescence markers, this seems like a good idea.

Test Plan: ##run-tests.py##

Reviewers: pyd, durham

Reviewed By: durham

Subscribers: calvinb, mitrandir, rmcelroy, daviser, mpm, davidsp, sid0, akushner, pyd, durham

Differential Revision: https://phabricator.fb.com/D1740886

Signature: t1:1740886:1418686275:d505ff1de8fbce39eb4fbe3a2e6d368b4b14edb8
This commit is contained in:
Eric Sumner 2014-12-15 15:06:57 -08:00
parent a032665ffb
commit 17840a1afd

View File

@ -55,6 +55,9 @@ def validaterevset(repo, revset):
if repo.revs('%r and merge()', revset):
raise util.Abort(_('cannot rebase merge changesets'))
if repo.revs('%r and obsolete()', revset):
raise util.Abort(_('cannot rebase obsolete changesets'))
tails = repo.revs('%r and ancestor(%r)', revset, revset)
if not tails:
raise util.Abort(_('cannot rebase unrelated changesets'))