Commits

Benjamin Pollack committed 89a3bc3

update remote branch heads on push

Comments (0)

Files changed (1)

 def reposetup(ui, repo):
     if repo.local():
         opull = repo.pull
+        opush = repo.push
         olookup = repo.lookup
         ofindtags = repo._findtags
 
                     lock.release()
                     return res
 
+            def push(self, remote, *args, **kwargs):
+                res = opush(remote, *args, **kwargs)
+                lock = self.lock()
+                try:
+                    try:
+                        path = self._activepath(remote)
+                        if path:
+                            self.saveremotebranches(path, remote.branchmap())
+                    except Exception, e:
+                        ui.debug('remote branches for path %s not saved: %s\n'
+                                 % (path, e))
+                finally:
+                    lock.release()
+                    return res
+
             def _activepath(self, remote):
                 conf = config.config()
                 rc = self.join('hgrc')