Show More
@@ -780,12 +780,19 b' def archive(ui, repo, dest, **opts):' | |||||
780 | 'specific revision')) |
|
780 | 'specific revision')) | |
781 |
|
781 | |||
782 | dest = make_filename(repo, repo.changelog, dest, node) |
|
782 | dest = make_filename(repo, repo.changelog, dest, node) | |
783 | prefix = make_filename(repo, repo.changelog, opts['prefix'], node) |
|
|||
784 | if os.path.realpath(dest) == repo.root: |
|
783 | if os.path.realpath(dest) == repo.root: | |
785 | raise util.Abort(_('repository root cannot be destination')) |
|
784 | raise util.Abort(_('repository root cannot be destination')) | |
786 | dummy, matchfn, dummy = matchpats(repo, [], opts) |
|
785 | dummy, matchfn, dummy = matchpats(repo, [], opts) | |
787 |
|
|
786 | kind = opts.get('type') or 'files' | |
788 | not opts['no_decode'], matchfn, prefix) |
|
787 | prefix = opts['prefix'] | |
|
788 | if dest == '-': | |||
|
789 | if kind == 'files': | |||
|
790 | raise util.Abort(_('cannot archive plain files to stdout')) | |||
|
791 | dest = sys.stdout | |||
|
792 | if not prefix: prefix = os.path.basename(repo.root) + '-%h' | |||
|
793 | prefix = make_filename(repo, repo.changelog, prefix, node) | |||
|
794 | archival.archive(repo, dest, node, kind, not opts['no_decode'], | |||
|
795 | matchfn, prefix) | |||
789 |
|
796 | |||
790 | def backout(ui, repo, rev, **opts): |
|
797 | def backout(ui, repo, rev, **opts): | |
791 | '''reverse effect of earlier changeset |
|
798 | '''reverse effect of earlier changeset |
@@ -51,3 +51,5 b' hg archive -t zip -p very/../bad test.zi' | |||||
51 |
|
51 | |||
52 | hg archive -t zip -r 2 test.zip |
|
52 | hg archive -t zip -r 2 test.zip | |
53 | unzip -t test.zip |
|
53 | unzip -t test.zip | |
|
54 | ||||
|
55 | hg archive -t tar - | tar tf - | sed "s/$QTIP/TIP/" |
@@ -36,3 +36,7 b' Archive: test.zip' | |||||
36 | testing: test/baz/bletch OK |
|
36 | testing: test/baz/bletch OK | |
37 | testing: test/foo OK |
|
37 | testing: test/foo OK | |
38 | No errors detected in compressed data of test.zip. |
|
38 | No errors detected in compressed data of test.zip. | |
|
39 | test-TIP/.hg_archival.txt | |||
|
40 | test-TIP/bar | |||
|
41 | test-TIP/baz/bletch | |||
|
42 | test-TIP/foo |
General Comments 0
You need to be logged in to leave comments.
Login now