diff tests/test-subrepo.t @ 16430:6883c2363f44

revert: add support for reverting subrepos without --no-backup and/or --all When a subrepo is reverted but --no-backup is not set, call revert on the subrepo that is being reverted prior to updating it to the revision specified in the parent repo's .hgsubstate file. The --all flag is passed down to the subrepo when it is being reverted. If the --all flag is not set, all files that are modified on the subrepo will be reverted.
author Angel Ezquerra <angel.ezquerra@gmail.com>
date Wed, 28 Mar 2012 11:42:17 +0200
parents 71dcce391a44
children 92c7e917b647
line wrap: on
line diff
--- a/tests/test-subrepo.t	Wed Mar 28 11:42:17 2012 +0200
+++ b/tests/test-subrepo.t	Wed Mar 28 11:42:17 2012 +0200
@@ -38,20 +38,20 @@
   update: (current)
   $ hg ci -m1
 
-Revert can't (yet) revert subrepos:
+Revert subrepo:
 
   $ echo b > s/a
   $ hg revert s
-  abort: cannot revert subrepos without --no-backup
-  [255]
-
-Revert currently ignores subrepos by default
+  reverting subrepo s
+  reverting s/a
+  $ rm s/a.orig
 
-  $ hg revert -a
-  abort: cannot revert subrepos without --no-backup
-  [255]
-  $ hg revert -R s -a -C
-  reverting s/a (glob)
+Revert subrepo with no backup. The "reverting s/a" line is gone since
+we're really running 'hg update' in the subrepo:
+
+  $ echo b > s/a
+  $ hg revert --no-backup s
+  reverting subrepo s
 
 Issue2022: update -C