mercurial/commands.py
changeset 8815 e87b0fc4750b
parent 8812 859f841937d0
child 8834 6d36fc70754e
--- a/mercurial/commands.py	Mon Jun 15 02:45:38 2009 -0500
+++ b/mercurial/commands.py	Mon Jun 15 02:46:20 2009 -0500
@@ -2289,6 +2289,13 @@
     ui.status(_('pushing to %s\n') % url.hidepassword(dest))
     if revs:
         revs = [repo.lookup(rev) for rev in revs]
+
+    # push subrepos depth-first for coherent ordering
+    c = repo['']
+    subs = c.substate # only repos that are committed
+    for s in sorted(subs):
+        c.sub(s).push(opts.get('force'))
+
     r = repo.push(other, opts.get('force'), revs=revs)
     return r == 0