[PATCH 03 of 24] localrepo: store branchheads sorted

Mads Kiilerich mads at kiilerich.com
Sun Dec 16 16:33:58 CST 2012


# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1355277440 -3600
# Node ID 9e2769163db312cfdd2a9d93be434d489693021c
# Parent  8b5eb2f44c24a7d940f743fa040bc77ee0b3000b
localrepo: store branchheads sorted

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -733,7 +733,7 @@
         try:
             f = self.opener("cache/branchheads", "w", atomictemp=True)
             f.write("%s %s\n" % (hex(tip), tiprev))
-            for label, nodes in branches.iteritems():
+            for label, nodes in sorted(branches.iteritems()):
                 for node in nodes:
                     f.write("%s %s\n" % (hex(node), encoding.fromlocal(label)))
             f.close()
diff --git a/tests/test-newbranch.t b/tests/test-newbranch.t
--- a/tests/test-newbranch.t
+++ b/tests/test-newbranch.t
@@ -150,9 +150,9 @@
 
   $ cat $branchcache
   adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
+  c21617b13b220988e7a2e26290fbe4325ffa7139 bar
   1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
   adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo
-  c21617b13b220988e7a2e26290fbe4325ffa7139 bar
 
 Push should update the branch cache:
 
@@ -172,9 +172,9 @@
 
   $ cat ../target/$branchcache
   adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 4
+  c21617b13b220988e7a2e26290fbe4325ffa7139 bar
   1c28f494dae69a2f8fc815059d257eccf3fcfe75 default
   adf1a74a7f7b4cd193d12992f5d0d6a004ed21d6 foo
-  c21617b13b220988e7a2e26290fbe4325ffa7139 bar
 
 Update with no arguments: tipmost revision of the current branch:
 


More information about the Mercurial-devel mailing list