Add a states.bypass option to push without touching state.
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 28 Nov 2011 00:59:42 +0100
changeset 107 f45325da7970
parent 106 03bbce26553e
child 108 85271a8a7fb9
Add a states.bypass option to push without touching state.
hgext/states.py
--- a/hgext/states.py	Mon Nov 28 00:59:18 2011 +0100
+++ b/hgext/states.py	Mon Nov 28 00:59:42 2011 +0100
@@ -985,11 +985,12 @@
         def push(self, remote, *args, **opts):
             """altered push that also update states heads on local and remote"""
             result = opush(remote, *args, **opts)
-            remoteheads = self._pullstatesheads(remote)
-            for st, heads in remoteheads.iteritems():
-                self.setstate(st, heads)
-                if heads != self.stateheads(st):
-                    self._pushstatesheads(remote, st,  heads)
+            if not self.ui.configbool('states', 'bypass', False):
+                remoteheads = self._pullstatesheads(remote)
+                for st, heads in remoteheads.iteritems():
+                    self.setstate(st, heads)
+                    if heads != self.stateheads(st):
+                        self._pushstatesheads(remote, st,  heads)
             return result
 
         def _pushstatesheads(self, remote, state, remoteheads):