~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Robert Collins
  • Date: 2005-10-02 21:51:29 UTC
  • mfrom: (1396)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20051002215128-5686c7d24bf9bdb9
merge from martins newformat branch - brings in transport abstraction

Show diffs side-by-side

added added

removed removed

Lines of Context:
382
382
    aliases = ['get', 'clone']
383
383
 
384
384
    def run(self, from_location, to_location=None, revision=None, basis=None):
385
 
        from bzrlib.branch import copy_branch
 
385
        from bzrlib.clone import copy_branch
386
386
        import tempfile
387
387
        import errno
388
388
        from shutil import rmtree
935
935
                raise BzrError('bzr export --revision takes exactly 1 argument')
936
936
            rev_id = revision[0].in_history(b).rev_id
937
937
        t = b.revision_tree(rev_id)
938
 
        root, ext = os.path.splitext(dest)
 
938
        arg_root, ext = os.path.splitext(os.path.basename(dest))
 
939
        if ext in ('.gz', '.bz2'):
 
940
            new_root, new_ext = os.path.splitext(arg_root)
 
941
            if new_ext == '.tar':
 
942
                arg_root = new_root
 
943
                ext = new_ext + ext
 
944
        if root is None:
 
945
            root = arg_root
939
946
        if not format:
940
947
            if ext in (".tar",):
941
948
                format = "tar"
942
 
            elif ext in (".gz", ".tgz"):
 
949
            elif ext in (".tar.gz", ".tgz"):
943
950
                format = "tgz"
944
 
            elif ext in (".bz2", ".tbz2"):
 
951
            elif ext in (".tar.bz2", ".tbz2"):
945
952
                format = "tbz2"
946
953
            else:
947
954
                format = "dir"
1373
1380
            # should not change the parent
1374
1381
            b.set_parent(remote)
1375
1382
        br_remote = Branch.open_containing(remote)
1376
 
 
1377
1383
        return show_missing(b, br_remote, verbose=verbose, quiet=quiet)
1378
1384
 
1379
1385
 
1380
 
 
1381
1386
class cmd_plugins(Command):
1382
1387
    """List plugins"""
1383
1388
    hidden = True