hgext/obsolete.py
changeset 473 1f8f8dd75d18
parent 472 641e0cd43d6d
child 479 b63da0fb8ee5
equal deleted inserted replaced
472:641e0cd43d6d 473:1f8f8dd75d18
    59 from mercurial import localrepo
    59 from mercurial import localrepo
    60 from mercurial import phases
    60 from mercurial import phases
    61 from mercurial import revset
    61 from mercurial import revset
    62 from mercurial import scmutil
    62 from mercurial import scmutil
    63 from mercurial import templatekw
    63 from mercurial import templatekw
       
    64 from mercurial import merge
    64 from mercurial.node import bin, short, nullid
    65 from mercurial.node import bin, short, nullid
    65 
    66 
    66 # This extension contains the following code
    67 # This extension contains the following code
    67 #
    68 #
    68 # - Extension Helper code
    69 # - Extension Helper code
   573         if ctx.conflicting():
   574         if ctx.conflicting():
   574             raise util.Abort(_("push includes a conflicting changeset: %s!")
   575             raise util.Abort(_("push includes a conflicting changeset: %s!")
   575                              % ctx)
   576                              % ctx)
   576     return orig(repo, remote, outgoing, *args, **kwargs)
   577     return orig(repo, remote, outgoing, *args, **kwargs)
   577 
   578 
       
   579 #####################################################################
       
   580 ### Filter extinct changeset from common operation                ###
       
   581 #####################################################################
       
   582 
       
   583 @eh.wrapfunction(merge, 'update')
       
   584 def wrapmergeupdate(orig, repo, node, *args, **kwargs):
       
   585     """ensure we don't automatically update on hidden changeset"""
       
   586     if node is None:
       
   587         # tip of current branch
       
   588         branch = repo[None].branch()
       
   589         node = repo.revs('last((.:: and branch(%s)) - hidden())', branch)[0]
       
   590     return orig(repo, node, *args, **kwargs)
   578 
   591 
   579 #####################################################################
   592 #####################################################################
   580 ### Additional Utilities                                          ###
   593 ### Additional Utilities                                          ###
   581 #####################################################################
   594 #####################################################################
   582 
   595