discovery: use stable sort order in --new-branch warning stable
authorMartin Geisler <mg@aragost.com>
Tue, 22 Jun 2010 12:38:39 +0200
branchstable
changeset 11429 d420ff348c49
parent 11421 45aabc523c86
child 11430 6bee25d51a7d
discovery: use stable sort order in --new-branch warning A Python set seems to do this already when you iterate over it, but this should be considered an implementation detail and not something we can rely on. This also gets rid of an unnecessary string conversion -- the set already contains strings.
mercurial/discovery.py
--- a/mercurial/discovery.py	Mon Jun 21 13:41:11 2010 -0500
+++ b/mercurial/discovery.py	Tue Jun 22 12:38:39 2010 +0200
@@ -280,7 +280,7 @@
             remotemap = remote.branchmap()
             newbranches = branches - set(remotemap)
             if newbranches and not newbranch: # new branch requires --new-branch
-                branchnames = ', '.join("%s" % b for b in newbranches)
+                branchnames = ', '.join(sorted(newbranches))
                 repo.ui.warn(_("abort: push creates "
                                "new remote branches: %s!\n")
                              % branchnames)