Patchwork [09,of,24] bookmarks: process pulled remote bookmarks in sorted order

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 16, 2012, 10:34 p.m.
Message ID <3c6e2e0aad7fbd090bac.1355697244@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/133/
State Accepted
Commit c6e033a7dd389f514028ea1dcad1e45525e604c3
Headers show

Comments

Mads Kiilerich - Dec. 16, 2012, 10:34 p.m.
# HG changeset patch
# User Mads Kiilerich <mads at kiilerich.com>
# Date 1355687456 -3600
# Node ID 3c6e2e0aad7fbd090bac10d2cd6589da6421556b
# Parent  c5976bcb3832034ff1934a3093e0241088112cc9
bookmarks: process pulled remote bookmarks in sorted order
Bryan O'Sullivan - Dec. 17, 2012, 8:58 p.m.
On Sun, Dec 16, 2012 at 2:34 PM, Mads Kiilerich <mads at kiilerich.com> wrote:

> bookmarks: process pulled remote bookmarks in sorted order
>

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

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -198,7 +198,7 @@ 
     rb = remote.listkeys('bookmarks')
     changed = False
     localmarks = repo._bookmarks
-    for k in rb.keys():
+    for k in sorted(rb):
         if k in localmarks:
             nr, nl = rb[k], localmarks[k]
             if nr in repo:
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
@@ -41,8 +41,8 @@ 
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
+  adding remote bookmark X
   updating bookmark Y
-  adding remote bookmark X
   adding remote bookmark Z
   (run 'hg update' to get a working copy)
   $ hg bookmarks
@@ -145,9 +145,9 @@ 
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files (+1 heads)
+  divergent bookmark @ stored as @foo
   divergent bookmark X stored as X at foo
   updating bookmark Z
-  divergent bookmark @ stored as @foo
   (run 'hg heads' to see heads, 'hg merge' to merge)
   $ hg book
      @                         1:9b140be10808
@@ -324,10 +324,10 @@ 
   pulling from http://localhost:$HGPORT/
   no changes found
   divergent bookmark @ stored as @1
+  divergent bookmark X stored as X at 1
+  adding remote bookmark Z
   adding remote bookmark foo
   adding remote bookmark foobar
-  divergent bookmark X stored as X at 1
-  adding remote bookmark Z
   importing bookmark Z
   $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
   requesting all changes