hgext/evolve.py
changeset 756 64c6bdfd0518
parent 752 bfdfdf731f8a
child 757 0ff862dcddbd
equal deleted inserted replaced
755:0021301f7fde 756:64c6bdfd0518
   602     """Add a hint for "hg evolve" when troubles make push fails
   602     """Add a hint for "hg evolve" when troubles make push fails
   603     """
   603     """
   604     if not repo.local():
   604     if not repo.local():
   605         return
   605         return
   606 
   606 
   607     opush = repo.push
       
   608 
       
   609     class evolvingrepo(repo.__class__):
   607     class evolvingrepo(repo.__class__):
   610         def push(self, remote, *args, **opts):
   608         def push(self, remote, *args, **opts):
   611             """wrapper around pull that pull obsolete relation"""
   609             """wrapper around pull that pull obsolete relation"""
   612             try:
   610             try:
   613                 result = opush(remote, *args, **opts)
   611                 result = super(evolvingrepo, self).push(remote, *args, **opts)
   614             except util.Abort, ex:
   612             except util.Abort, ex:
   615                 hint = _("use 'hg evolve' to get a stable history "
   613                 hint = _("use 'hg evolve' to get a stable history "
   616                          "or --force to ignore warnings")
   614                          "or --force to ignore warnings")
   617                 if (len(ex.args) >= 1
   615                 if (len(ex.args) >= 1
   618                     and ex.args[0].startswith('push includes ')
   616                     and ex.args[0].startswith('push includes ')