diff tests/test-subrepo-git.t @ 23550:7fa2189c1e87

subrepo: add revert support without backup for git subrepos Previously, git subrepos did not support reverting. This change adds basic support for reverting when '--no-backup' is specified. A warning is given (and the current state is kept) when a revert is done without the '--no-backup' flag.
author Mathias De Mar? <mathias.demare@gmail.com>
date Sun, 14 Dec 2014 11:34:51 +0100
parents 8b5adc6b72ae
children 7651621507cf
line wrap: on
line diff
--- a/tests/test-subrepo-git.t	Sat Nov 01 22:56:49 2014 -0700
+++ b/tests/test-subrepo-git.t	Sun Dec 14 11:34:51 2014 +0100
@@ -784,4 +784,21 @@
   $ hg diff --subrepos -I s/foobar
   $ hg diff --subrepos -X s/foobar
 
+revert the subrepository
+  $ hg revert --all
+  reverting subrepo ../gitroot (glob)
+  ../gitroot: reverting git subrepos without --no-backup is unsupported (glob)
+
+  $ hg status --subrepos
+  M s/foobar
+  A s/barfoo
+
+  $ hg revert --no-backup --all
+  reverting subrepo ../gitroot (glob)
+  $ hg revert --no-backup s
+  reverting subrepo ../gitroot (glob)
+
+  $ hg status --subrepos
+  ? s/barfoo
+
   $ cd ..