~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Martin Pool
  • Date: 2005-09-30 06:39:42 UTC
  • mfrom: (1185.10.11)
  • mto: (1185.14.2)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: mbp@sourcefrog.net-20050930063942-3eab86500bffba49
- merge merge and export fixes from aaron
aaron.bentley@utoronto.ca-20050930040234-71c1a151f795e806

Show diffs side-by-side

added added

removed removed

Lines of Context:
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"