Patchwork [5,of,5] subrepo: do not push mercurial subrepos whose store is clean

login
register
mail settings
Submitter Angel Ezquerra
Date Feb. 16, 2013, 12:27 p.m.
Message ID <f1ad0ece11a8936080b8.1361017649@Angel-PC.localdomain>
Download mbox | patch
Permalink /patch/1019/
State Superseded, archived
Headers show

Comments

Angel Ezquerra - Feb. 16, 2013, 12:27 p.m.
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1360974100 -3600
# Node ID f1ad0ece11a8936080b8594a69dc362a1d250499
# Parent  0f2ca0430dc9d6380a58c31ddd83e59dbf6c4cf8
subrepo: do not push mercurial subrepos whose store is clean

This patch stops mercurial from pushing unmodified subrepos. An unmodified
subrepo is one whose store is "clean".

I have not added tests yet because I'd like to get feedback first, particularly
on the message that is shown when a subrepo is not pushed because its store is
clean.

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -690,6 +690,12 @@ 
                 return False
 
         dsturl = _abssource(self._repo, True)
+        if not force:
+            if self.storeclean(dsturl):
+                self._repo.ui.status(
+                    _('no changes made to subrepo %s since last push to %s\n')
+                    % (subrelpath(self), dsturl))
+                return None
         self._repo.ui.status(_('pushing subrepo %s to %s\n') %
             (subrelpath(self), dsturl))
         other = hg.peer(self._repo, {'ssh': ssh}, dsturl)