Commits

Anonymous committed 002ab27

Provide patch status information for hg attic

The list of existing patches has now marks for the current and default patch.

  • Participants
  • Parent commits 29c1e17

Comments (0)

Files changed (3)

     elif opts['header']:
         headerinfo(ui, repo, opts['header'])
     else:
-        available = repo.attic.available()
-        repo.ui.write('\n'.join(available))
+        s = repo.attic
+        active = s.applied
+        default = s.currentpatch
+        available = s.available()
+        for p in available:
+            amark = ((p == active) and "*") or " "
+            dmark = ((p == default) and "C") or " "
+            ui.write('%s%s %s\n' % (amark, dmark, p))
         if len(available) > 0:
-            repo.ui.write('\n')
+            ui.write('\n')
 
 def commitwrapper(orig, ui, repo, *args, **opts):
     s = repo.attic

File tests/test-display.out

  adding a.txt
 adding b.txt
 ### hg attic
-a
-b
+   a
+ C b
+

File tests/test-shelve2.out

 ### call hg shelve a (should fail)
 abort: attempting to overwrite existing patch
 ### call hg attic
-a
+ C a
+