Patchwork [12,of,24] debugpushkey: list keys sorted

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 16, 2012, 10:34 p.m.
Message ID <50e9cac5cdf058c64e41.1355697247@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/137/
State Accepted
Headers show

Comments

Mads Kiilerich - Dec. 16, 2012, 10:34 p.m.
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1355687457 -3600
# Node ID 50e9cac5cdf058c64e4190212be9d92a16b5a76f
# Parent  f886abbb6947d813813df8c3edeb83af6923cd7a
debugpushkey: list keys sorted
Bryan O'Sullivan - Dec. 17, 2012, 8:59 p.m.
On Sun, Dec 16, 2012 at 2:34 PM, Mads Kiilerich <mads at kiilerich.com> wrote:

> debugpushkey: list keys sorted
>

Looks good, thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121217/d1ecda0c/attachment.html>

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2153,7 +2153,7 @@ 
         ui.status(str(r) + '\n')
         return not r
     else:
-        for k, v in target.listkeys(namespace).iteritems():
+        for k, v in sorted(target.listkeys(namespace).iteritems()):
             ui.write("%s\t%s\n" % (k.encode('string-escape'),
                                    v.encode('string-escape')))
 
diff --git a/tests/test-bookmarks-pushpull.t b/tests/test-bookmarks-pushpull.t
--- a/tests/test-bookmarks-pushpull.t
+++ b/tests/test-bookmarks-pushpull.t
@@ -51,12 +51,12 @@ 
      Z                         0:4e3505fd9583
   $ hg debugpushkey ../a namespaces
   bookmarks	
-  phases	
   namespaces	
   obsolete	
+  phases	
   $ hg debugpushkey ../a bookmarks
+  X	4e3505fd95835d721066b76e75dbb8cc554d7f77
   Y	4e3505fd95835d721066b76e75dbb8cc554d7f77
-  X	4e3505fd95835d721066b76e75dbb8cc554d7f77
   Z	4e3505fd95835d721066b76e75dbb8cc554d7f77
   $ hg pull -B X ../a
   pulling from ../a
@@ -292,16 +292,16 @@ 
 
   $ hg debugpushkey http://localhost:$HGPORT/ namespaces
   bookmarks	
-  phases	
   namespaces	
   obsolete	
+  phases	
   $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
   @	9b140be1080824d768c5a4691a564088eede71f9
+  X	9b140be1080824d768c5a4691a564088eede71f9
+  Y	c922c0139ca03858f655e4a2af4dd02796a63969
+  Z	0d2164f0ce0d8f1d6f94351eba04b794909be66c
   foo	0000000000000000000000000000000000000000
   foobar	9b140be1080824d768c5a4691a564088eede71f9
-  Y	c922c0139ca03858f655e4a2af4dd02796a63969
-  X	9b140be1080824d768c5a4691a564088eede71f9
-  Z	0d2164f0ce0d8f1d6f94351eba04b794909be66c
   $ hg out -B http://localhost:$HGPORT/
   comparing with http://localhost:$HGPORT/
   searching for changed bookmarks
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -165,8 +165,8 @@ 
   $ cd ../local
   $ hg debugpushkey --config ui.ssh="python \"$TESTDIR/dummyssh\"" ssh://user at dummy/remote namespaces
   bookmarks	
+  namespaces	
   phases	
-  namespaces	
   $ hg book foo -r 0
   $ hg out -B
   comparing with ssh://user at dummy/remote