hgext/obsolete.py
changeset 473 1f8f8dd75d18
parent 472 641e0cd43d6d
child 479 b63da0fb8ee5
--- a/hgext/obsolete.py	Tue Aug 21 02:50:11 2012 +0200
+++ b/hgext/obsolete.py	Tue Aug 21 04:36:25 2012 +0200
@@ -61,6 +61,7 @@
 from mercurial import revset
 from mercurial import scmutil
 from mercurial import templatekw
+from mercurial import merge
 from mercurial.node import bin, short, nullid
 
 # This extension contains the following code
@@ -575,6 +576,18 @@
                              % ctx)
     return orig(repo, remote, outgoing, *args, **kwargs)
 
+#####################################################################
+### Filter extinct changeset from common operation                ###
+#####################################################################
+
+@eh.wrapfunction(merge, 'update')
+def wrapmergeupdate(orig, repo, node, *args, **kwargs):
+    """ensure we don't automatically update on hidden changeset"""
+    if node is None:
+        # tip of current branch
+        branch = repo[None].branch()
+        node = repo.revs('last((.:: and branch(%s)) - hidden())', branch)[0]
+    return orig(repo, node, *args, **kwargs)
 
 #####################################################################
 ### Additional Utilities                                          ###