[PATCH 2 of 2] largefiles: test reverting largefiles (coverage creeping ever upwards)

Greg Ward greg-hg at gerg.ca
Tue Oct 25 12:57:35 UTC 2011


# HG changeset patch
# User Greg Ward <greg at gerg.ca>
# Date 1319547419 14400
# Branch stable
# Node ID a30ba32d503f89f90e4676478c4dc620c35318ae
# Parent  cd6091b6b718f32838036b6abc89520077bc41e4
largefiles: test reverting largefiles (coverage creeping ever upwards)

This reveals a small bug: revert reports "reverting .hglf/largefile"
when it really should report "reverting largefile". I don't see an
easy fix, though (short of using ui.pushbuffer() to interfere with
revert's output).

diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -633,6 +633,51 @@
   getting changed largefiles
   1 largefiles updated, 0 removed
 
+"revert" works on largefiles (and normal files too).
+  $ echo hack3 >> normal3
+  $ echo hack4 >> sub/normal4
+  $ echo hack4 >> sub/large4
+  $ hg rm sub2/large6
+  $ echo new >> sub2/large8
+  $ hg add --large sub2/large8
+# XXX we don't really want to report that we're reverting the standin;
+# that's just an implementation detail. But I don't see an obvious fix. ;-(
+  $ hg revert sub
+  reverting .hglf/sub/large4
+  reverting sub/normal4
+  $ hg status
+  M normal3
+  A sub2/large8
+  R sub2/large6
+  ? sub/large4.orig
+  ? sub/normal4.orig
+  $ cat sub/normal4
+  normal4-modified
+  $ cat sub/large4
+  large4-modified
+  $ hg revert -a --no-backup
+  undeleting .hglf/sub2/large6
+  forgetting .hglf/sub2/large8
+  reverting normal3
+  $ hg status
+  ? sub/large4.orig
+  ? sub/normal4.orig
+  ? sub2/large8
+  $ cat normal3
+  normal3-modified
+  $ cat sub2/large6
+  large6-modified
+  $ rm sub/*.orig sub2/large8
+
+revert some files to an older revision
+  $ hg revert --no-backup -r 8 sub2
+  reverting .hglf/sub2/large6
+  $ cat sub2/large6
+  large6
+  $ hg revert --no-backup sub2
+  reverting .hglf/sub2/large6
+  $ hg status
+
 "verify --large" actaully verifies largefiles
 
   $ hg verify --large



More information about the Mercurial-devel mailing list