Commits

Christian Widmer committed 80217a8

Sort shelves alphabetically

Mercurial tests record the output and as such they assume that the output
is stable across a wide variety of software stacks. But that does not play
nice with the implementation of 'hg shelve -l' which uses 'os.listdir'.

According to the Python doc the the list is in arbitrary order. That's why
the ordering on Fedora is different than on OS X. Thus we sort the list
returned by 'os.listdir' to achieve a stable ordering across different
platforms.

  • Participants
  • Parent commits 5e6f9c9
  • Tags hg-2.1

Comments (0)

Files changed (2)

     # Now go through all the files in the shelves folder and list them out
     dirname = repo.join('shelves')
     if os.path.isdir(dirname):
-        for filename in os.listdir(repo.join('shelves')):
+        for filename in sorted(os.listdir(repo.join('shelves'))):
             ui.status(filename + '\n')
     
 def unshelve(ui, repo, **opts):
   $ hg status
   M tip.bundle
   $ hg shelve --list
+  file1
   file2
+  $ hg unshelve --list
   file1
-  $ hg unshelve --list
   file2
-  file1
   $ hg unshelve --name file1
   unshelve completed
   $ hg unshelve --name file2