equal
deleted
inserted
replaced
65 exts = { |
65 exts = { |
66 'tar': ['.tar'], |
66 'tar': ['.tar'], |
67 'tbz2': ['.tbz2', '.tar.bz2'], |
67 'tbz2': ['.tbz2', '.tar.bz2'], |
68 'tgz': ['.tgz', '.tar.gz'], |
68 'tgz': ['.tgz', '.tar.gz'], |
69 'zip': ['.zip'], |
69 'zip': ['.zip'], |
|
70 'txz': ['.txz', '.tar.xz'] |
70 } |
71 } |
71 |
72 |
72 def guesskind(dest): |
73 def guesskind(dest): |
73 for kind, extensions in exts.iteritems(): |
74 for kind, extensions in exts.iteritems(): |
74 if any(dest.endswith(ext) for ext in extensions): |
75 if any(dest.endswith(ext) for ext in extensions): |
268 archivers = { |
269 archivers = { |
269 'files': fileit, |
270 'files': fileit, |
270 'tar': tarit, |
271 'tar': tarit, |
271 'tbz2': lambda name, mtime: tarit(name, mtime, 'bz2'), |
272 'tbz2': lambda name, mtime: tarit(name, mtime, 'bz2'), |
272 'tgz': lambda name, mtime: tarit(name, mtime, 'gz'), |
273 'tgz': lambda name, mtime: tarit(name, mtime, 'gz'), |
|
274 'txz': lambda name, mtime: tarit(name, mtime, 'xz'), |
273 'uzip': lambda name, mtime: zipit(name, mtime, False), |
275 'uzip': lambda name, mtime: zipit(name, mtime, False), |
274 'zip': zipit, |
276 'zip': zipit, |
275 } |
277 } |
276 |
278 |
277 def archive(repo, dest, node, kind, decode=True, match=None, |
279 def archive(repo, dest, node, kind, decode=True, match=None, |
292 |
294 |
293 mtime is the modified time, in seconds, or None to use the changeset time. |
295 mtime is the modified time, in seconds, or None to use the changeset time. |
294 |
296 |
295 subrepos tells whether to include subrepos. |
297 subrepos tells whether to include subrepos. |
296 ''' |
298 ''' |
|
299 |
|
300 if kind == 'txz' and not pycompat.ispy3: |
|
301 raise error.Abort(_('xz compression is only available in Python 3')) |
297 |
302 |
298 if kind == 'files': |
303 if kind == 'files': |
299 if prefix: |
304 if prefix: |
300 raise error.Abort(_('cannot give prefix when archiving to files')) |
305 raise error.Abort(_('cannot give prefix when archiving to files')) |
301 else: |
306 else: |