/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/export/__init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-14 12:18:38 UTC
  • mto: This revision was merged to the branch mainline in revision 5724.
  • Revision ID: jelmer@samba.org-20110314121838-z78awaohgsme6qht
Don't export to '-', but rather to ''.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
def get_root_name(dest):
125
125
    """Get just the root name for an export.
126
126
 
127
 
    >>> get_root_name('../mytest.tar')
128
 
    'mytest'
129
 
    >>> get_root_name('mytar.tar')
130
 
    'mytar'
131
 
    >>> get_root_name('mytar.tar.bz2')
132
 
    'mytar'
133
 
    >>> get_root_name('tar.tar.tar.tgz')
134
 
    'tar.tar.tar'
135
 
    >>> get_root_name('bzr-0.0.5.tar.gz')
136
 
    'bzr-0.0.5'
137
 
    >>> get_root_name('bzr-0.0.5.zip')
138
 
    'bzr-0.0.5'
139
 
    >>> get_root_name('bzr-0.0.5')
140
 
    'bzr-0.0.5'
141
 
    >>> get_root_name('a/long/path/mytar.tgz')
142
 
    'mytar'
143
 
    >>> get_root_name('../parent/../dir/other.tbz2')
144
 
    'other'
145
127
    """
146
128
    global _exporter_extensions
 
129
    if dest == '-':
 
130
        # Exporting to -/foo doesn't make sense so use relative paths.
 
131
        return ''
147
132
    dest = os.path.basename(dest)
148
133
    for ext in _exporter_extensions:
149
134
        if dest.endswith(ext):