1. Oleg Oshmyan
  2. hgshelve


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

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

Comments (0)

Files changed (2)

File hgshelve.py

View file
  • Ignore whitespace
     # 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):

File test-shelve.t

View file
  • Ignore whitespace
   $ hg status
   M tip.bundle
   $ hg shelve --list
+  file1
+  $ hg unshelve --list
-  $ hg unshelve --list
-  file1
   $ hg unshelve --name file1
   unshelve completed
   $ hg unshelve --name file2