mercurial/subrepo.py
changeset 23678 194d2f185008
parent 23666 965788d9ae09
child 23679 dd1e73c4be13
--- a/mercurial/subrepo.py	Tue Dec 23 19:54:48 2014 -0800
+++ b/mercurial/subrepo.py	Sun Dec 28 10:42:25 2014 +0100
@@ -1658,10 +1658,14 @@
     def revert(self, substate, *pats, **opts):
         self.ui.status(_('reverting subrepo %s\n') % substate[0])
         if not opts.get('no_backup'):
-            self.ui.warn('%s: reverting %s subrepos without '
-                         '--no-backup is unsupported\n'
-                         % (substate[0], substate[2]))
-            return []
+            status = self.status(None)
+            names = status.modified
+            for name in names:
+                bakname = "%s.orig" % name
+                self.ui.note(_('saving current version of %s as %s\n') %
+                        (name, bakname))
+                util.rename(os.path.join(self._abspath, name),
+                            os.path.join(self._abspath, bakname))
 
         self.get(substate, overwrite=True)
         return []