[PATCH] export: clobber files with -o (bc) (issue3652)

Kevin Bullock kbullock+mercurial at ringworld.org
Mon Oct 8 12:41:17 CDT 2012


On Oct 5, 2012, at 6:52 PM, Augie Fackler wrote:

> # HG changeset patch
> # User Augie Fackler <raf at durin42.com>
> # Date 1349480822 18000
> # Node ID d227c19ce93985d21a20ba006367a41995ddeab6
> # Parent  fa714f3ed2989aff64c267c9935251d9fc4f31ee
> export: clobber files with -o (bc) (issue3652)
> 
> This violated user expectation. Updated the code to clobber files, but
> preserve the behavior of appending multiple patches requested in a
> single export. Includes tests.

This fails to clobber any but the first file opened, so it doesn't work when outputting multiple changes with a parameterized OUTFILESPEC. Test:

diff --git a/tests/test-export.t b/tests/test-export.t
--- a/tests/test-export.t
+++ b/tests/test-export.t
@@ -91,6 +91,16 @@
   foo-foo_10.patch
   foo-foo_11.patch
 
+Doing it again clobbers the files rather than appending:
+  $ hg export -v -o "foo-%m.patch" 2:3
+  exporting patches:
+  foo-foo_2.patch
+  foo-foo_3.patch
+  $ grep HG foo-foo_2.patch | wc -l  # this passes
+  \s*1 (re)
+  $ grep HG foo-foo_3.patch | wc -l  # this fails
+  \s*1 (re)
+
 Exporting 4 changesets to a file:
 
   $ hg export -o export_internal 1 2 3 4

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock



More information about the Mercurial-devel mailing list