~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 01:53:46 UTC
  • mfrom: (1393.1.23)
  • Revision ID: robertc@robertcollins.net-20051002015346-587422189352289e
merge from upstream newformat

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
936
936
                raise BzrError('bzr export --revision takes exactly 1 argument')
937
937
            rev_id = revision[0].in_history(b).rev_id
938
938
        t = b.revision_tree(rev_id)
939
 
        root, ext = os.path.splitext(dest)
 
939
        arg_root, ext = os.path.splitext(os.path.basename(dest))
 
940
        if ext in ('.gz', '.bz2'):
 
941
            new_root, new_ext = os.path.splitext(arg_root)
 
942
            if new_ext == '.tar':
 
943
                arg_root = new_root
 
944
                ext = new_ext + ext
 
945
        if root is None:
 
946
            root = arg_root
940
947
        if not format:
941
948
            if ext in (".tar",):
942
949
                format = "tar"
943
 
            elif ext in (".gz", ".tgz"):
 
950
            elif ext in (".tar.gz", ".tgz"):
944
951
                format = "tgz"
945
 
            elif ext in (".bz2", ".tbz2"):
 
952
            elif ext in (".tar.bz2", ".tbz2"):
946
953
                format = "tbz2"
947
954
            else:
948
955
                format = "dir"
1376
1383
            # should not change the parent
1377
1384
            b.set_parent(remote)
1378
1385
        br_remote = Branch.open_containing(remote)
1379
 
 
1380
1386
        return show_missing(b, br_remote, verbose=verbose, quiet=quiet)
1381
1387
 
1382
1388
 
1383
 
 
1384
1389
class cmd_plugins(Command):
1385
1390
    """List plugins"""
1386
1391
    hidden = True