changeset 107:f45325da7970

Add a states.bypass option to push without touching state.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Mon, 28 Nov 2011 00:59:42 +0100
parents 03bbce26553e
children 85271a8a7fb9
files hgext/states.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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):