Mercurial > evolve
comparison hgext/obsolete.py @ 377:1d6cc8c22cd9
merge with stable fix and preparation
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Wed, 25 Jul 2012 17:53:17 +0200 |
parents | ac7969043677 188afb394e10 |
children | 0313cb49fa1a |
comparison
equal
deleted
inserted
replaced
372:de3d112db51b | 377:1d6cc8c22cd9 |
---|---|
453 # do not push instability | 453 # do not push instability |
454 for h in outgoing.missingheads: | 454 for h in outgoing.missingheads: |
455 # checking heads only is enought because any thing base on obsolete | 455 # checking heads only is enought because any thing base on obsolete |
456 # changeset is either obsolete or unstable. | 456 # changeset is either obsolete or unstable. |
457 ctx = repo[h] | 457 ctx = repo[h] |
458 hint = _("use 'hg stabilize' to get a stable history (or --force to proceed)") | |
459 if ctx.unstable(): | 458 if ctx.unstable(): |
460 raise util.Abort(_("Trying to push unstable changeset: %s!") % ctx, | 459 raise util.Abort(_("push includes an unstable changeset: %s!") |
461 hint=hint) | 460 % ctx) |
462 if ctx.obsolete(): | 461 if ctx.obsolete(): |
463 raise util.Abort(_("Trying to push obsolete changeset: %s!") % ctx, | 462 raise util.Abort(_("push includes an obsolete changeset: %s!") |
464 hint=hint) | 463 % ctx) |
465 if ctx.latecomer(): | 464 if ctx.latecomer(): |
466 raise util.Abort(_("Trying to push latecomer changeset: %s!") % ctx, | 465 raise util.Abort(_("push includes an latecomer changeset: %s!") |
467 hint=hint) | 466 % ctx) |
468 if ctx.conflicting(): | 467 if ctx.conflicting(): |
469 raise util.Abort(_("Trying to push conflicting changeset: %s!") % ctx, | 468 raise util.Abort(_("push includes conflicting changeset: %s!") |
470 hint=hint) | 469 % ctx) |
471 ### patch remote branch map | 470 ### patch remote branch map |
472 # do not read it this burn eyes | 471 # do not read it this burn eyes |
473 try: | 472 try: |
474 if 'oldbranchmap' not in vars(remote): | 473 if 'oldbranchmap' not in vars(remote): |
475 remote.oldbranchmap = remote.branchmap | 474 remote.oldbranchmap = remote.branchmap |
958 l.release() | 957 l.release() |
959 | 958 |
960 def push(self, remote, *args, **opts): | 959 def push(self, remote, *args, **opts): |
961 """wrapper around pull that pull obsolete relation""" | 960 """wrapper around pull that pull obsolete relation""" |
962 self._turn_extinct_secret() | 961 self._turn_extinct_secret() |
963 result = opush(remote, *args, **opts) | 962 try: |
963 result = opush(remote, *args, **opts) | |
964 except util.Abort, ex: | |
965 hint = _("use 'hg stabilize' to get a stable history (or --force to proceed)") | |
966 if (len(ex.args) >= 1 | |
967 and ex.args[0].startswith('push includes ') | |
968 and ex.hint is None): | |
969 ex.hint = hint | |
970 raise | |
964 self._turn_extinct_secret() | 971 self._turn_extinct_secret() |
965 return result | 972 return result |
966 | 973 |
967 | 974 |
968 ### rollback support | 975 ### rollback support |