~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Aaron Bentley
  • Date: 2005-09-30 04:02:34 UTC
  • mfrom: (1185.12.1)
  • mto: (1393.1.21) (1185.14.1)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: aaron.bentley@utoronto.ca-20050930040234-71c1a151f795e806
Merged export fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
927
927
                raise BzrError('bzr export --revision takes exactly 1 argument')
928
928
            rev_id = revision[0].in_history(b).rev_id
929
929
        t = b.revision_tree(rev_id)
930
 
        root, ext = os.path.splitext(dest)
 
930
        arg_root, ext = os.path.splitext(os.path.basename(dest))
 
931
        if ext in ('.gz', '.bz2'):
 
932
            new_root, new_ext = os.path.splitext(arg_root)
 
933
            if new_ext == '.tar':
 
934
                arg_root = new_root
 
935
                ext = new_ext + ext
 
936
        if root is None:
 
937
            root = arg_root
931
938
        if not format:
932
939
            if ext in (".tar",):
933
940
                format = "tar"
934
 
            elif ext in (".gz", ".tgz"):
 
941
            elif ext in (".tar.gz", ".tgz"):
935
942
                format = "tgz"
936
 
            elif ext in (".bz2", ".tbz2"):
 
943
            elif ext in (".tar.bz2", ".tbz2"):
937
944
                format = "tbz2"
938
945
            else:
939
946
                format = "dir"