subrepo: add auto-pull for merge
authorMatt Mackall <mpm@selenic.com>
Wed, 30 Sep 2009 18:47:33 -0500
changeset 9507 5987183d6e59
parent 9506 49b62395e910
child 9508 e2fd9b62349b
child 9519 0d3c1aa9d5de
subrepo: add auto-pull for merge
mercurial/subrepo.py
--- a/mercurial/subrepo.py	Wed Sep 30 16:08:11 2009 -0400
+++ b/mercurial/subrepo.py	Wed Sep 30 18:47:33 2009 -0500
@@ -168,7 +168,7 @@
         self._repo.ui.note(_('removing subrepo %s\n') % self._path)
         hg.clean(self._repo, node.nullid, False)
 
-    def get(self, state):
+    def _get(self, state):
         source, revision = state
         try:
             self._repo.lookup(revision)
@@ -179,9 +179,13 @@
             other = hg.repository(self._repo.ui, srcurl)
             self._repo.pull(other)
 
+    def get(self, state):
+        self._get(state)
+        source, revision = state
         hg.clean(self._repo, revision, False)
 
     def merge(self, state):
+        self._get(state)
         hg.merge(self._repo, state[1], remind=False)
 
     def push(self, force):