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

Angel Ezquerra angel.ezquerra at gmail.com
Sat Feb 16 06:27:29 CST 2013


# HG changeset patch
# User Angel Ezquerra <angel.ezquerra at 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.

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)


More information about the Mercurial-devel mailing list