mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
obsolete: refuse to push divergent changeset
As other troubles `unstable` and `bumped`. Followup patches may simplify the push code with unification of "obsolescence troubles" handling.
This commit is contained in:
parent
38afff41e0
commit
2038eca723
@ -1918,6 +1918,7 @@ class localrepository(object):
|
||||
mso = _("push includes obsolete changeset: %s!")
|
||||
msu = _("push includes unstable changeset: %s!")
|
||||
msb = _("push includes bumped changeset: %s!")
|
||||
msd = _("push includes divergent changeset: %s!")
|
||||
# If we are to push if there is at least one
|
||||
# obsolete or unstable changeset in missing, at
|
||||
# least one of the missinghead will be obsolete or
|
||||
@ -1930,6 +1931,8 @@ class localrepository(object):
|
||||
raise util.Abort(msu % ctx)
|
||||
elif ctx.bumped():
|
||||
raise util.Abort(msb % ctx)
|
||||
elif ctx.divergent():
|
||||
raise util.Abort(msd % ctx)
|
||||
discovery.checkheads(unfi, remote, outgoing,
|
||||
remoteheads, newbranch,
|
||||
bool(inc))
|
||||
|
@ -84,6 +84,16 @@ A_1 have two direct and divergent successors A_1 and A_1
|
||||
$ hg log -r 'divergent()'
|
||||
2:82623d38b9ba A_1
|
||||
3:392fd25390da A_2
|
||||
|
||||
check that mercurial refuse to push
|
||||
|
||||
$ hg init ../other
|
||||
$ hg push ../other
|
||||
pushing to ../other
|
||||
searching for changes
|
||||
abort: push includes divergent changeset: 82623d38b9ba!
|
||||
[255]
|
||||
|
||||
$ cd ..
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user