[PATCH] subrepo: process merge substate in sorted order in submerge()

Adrian Buehlmann adrian at cadifra.com
Sun Apr 3 04:27:47 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1301788637 -7200
# Node ID ba1f98f877ecd564ed21bf1e54d14ded05f067f3
# Parent  0995eee8ffe4a24478379fb16fd6c38812bc3dd5
subrepo: process merge substate in sorted order in submerge()

This ensures that subrepositories are pulled in a well defined
order when cloning the parent repository.

BEFORE:

  $ hg clone http://hg.gerg.ca/allextensions
  destination directory: allextensions
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 10 changesets with 20 changes to 6 files
  updating to branch default
  pulling subrepo caseguard from http://bitbucket.org/alexandru/caseguard
  real URL is https://bitbucket.org/alexandru/caseguard
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 81 changesets with 100 changes to 13 files
  pulling subrepo hg-prompt from http://bitbucket.org/sjl/hg-prompt
  real URL is https://bitbucket.org/sjl/hg-prompt
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 114 changesets with 176 changes to 35 files
  pulling subrepo hgpaste from http://bitbucket.org/birkenfeld/hgpaste
  real URL is https://bitbucket.org/birkenfeld/hgpaste
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 18 changesets with 18 changes to 2 files
  ...

AFTER:

  $ hg clone http://hg.gerg.ca/allextensions
  destination directory: allextensions
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 10 changesets with 20 changes to 6 files
  updating to branch default
  pulling subrepo Artemis from http://hg.mrzv.org/Artemis
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 55 changesets with 108 changes to 47 files
  ...

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -144,7 +144,7 @@
                 debug(s, "prompt remove")
                 wctx.sub(s).remove()
 
-    for s, r in s2.items():
+    for s, r in sorted(s2.items()):
         if s in s1:
             continue
         elif s not in sa:


More information about the Mercurial-devel mailing list