Comments
Patch
@@ -13,6 +13,7 @@
import cStringIO, os, tarfile, time, zipfile
import zlib, gzip
import struct
+import error
# from unzip source code:
_UNX_IFREG = 0x8000
@@ -286,8 +287,11 @@
if matchfn:
files = [f for f in ctx.manifest().keys() if matchfn(f)]
+ if not files:
+ raise error.Abort(_('no files match the archive pattern'))
else:
files = ctx.manifest().keys()
+
files.sort()
total = len(files)
repo.ui.progress(_('archiving'), 0, unit=_('files'), total=total)
@@ -289,6 +289,16 @@
*-----* (glob)
\s*147\s+2 files (re)
+show an error when a provided pattern matches no files
+
+ $ hg archive -I file_that_does_not_exist.foo ../empty.zip
+ abort: no files match the archive pattern
+ [255]
+
+ $ hg archive -X * ../empty.zip
+ abort: no files match the archive pattern
+ [255]
+
$ cd ..
issue3600: check whether "hg archive" can create archive files which