hgext/evolve.py
changeset 653 116c6f76d24b
parent 652 5a929510de9d
child 657 789acc1d039b
equal deleted inserted replaced
652:5a929510de9d 653:116c6f76d24b
   373     args = revset.getargs(x, 0, 0, 'divergent takes no arguments')
   373     args = revset.getargs(x, 0, 0, 'divergent takes no arguments')
   374     conf = getrevs(repo, 'divergent')
   374     conf = getrevs(repo, 'divergent')
   375     return [r for r in subset if r in conf]
   375     return [r for r in subset if r in conf]
   376 
   376 
   377 
   377 
   378 
       
   379 
       
   380 #####################################################################
       
   381 ### Filter extinct changesets from common operations              ###
       
   382 #####################################################################
       
   383 
       
   384 @eh.wrapfunction(merge, 'update')
       
   385 def wrapmergeupdate(orig, repo, node, *args, **kwargs):
       
   386     """ensure we don't automatically update on hidden changeset"""
       
   387     if node is None:
       
   388         # tip of current branch
       
   389         branch = repo[None].branch()
       
   390         node = repo.revs('last((.:: and branch(%s)) - hidden())', branch)[0]
       
   391     return orig(repo, node, *args, **kwargs)
       
   392 
       
   393 @eh.wrapfunction(localrepo.localrepository, 'branchtip')
       
   394 def obsbranchtip(orig, repo, branch):
       
   395     """ensure "stable" reference does not end on a hidden changeset"""
       
   396     if not getattr(repo, '_dofilterbranchtip', True):
       
   397         return orig(repo, branch)
       
   398     result = ()
       
   399     heads = repo.branchmap().get(branch, ())
       
   400     if heads:
       
   401         result = list(repo.set('last(heads(branch(%n) - hidden()))', heads[0]))
       
   402     if not result:
       
   403         raise error.RepoLookupError(_("unknown branch '%s'") % branch)
       
   404     return result[0].node()
       
   405 
       
   406 
       
   407 @eh.wrapfunction(mercurial.hgweb.hgweb_mod.hgweb, '__init__')
       
   408 @eh.wrapfunction(mercurial.hgweb.hgweb_mod.hgweb, 'refresh')
       
   409 def nofilter(orig, hgweb, *args, **kwargs):
       
   410     orig(hgweb, *args, **kwargs)
       
   411     hgweb.repo._dofilterbranchtip = False
       
   412 
   378 
   413 
   379 
   414 #####################################################################
   380 #####################################################################
   415 ### Additional Utilities                                          ###
   381 ### Additional Utilities                                          ###
   416 #####################################################################
   382 #####################################################################