~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Martin Pool
  • Date: 2006-06-05 16:55:41 UTC
  • mto: This revision was merged to the branch mainline in revision 1752.
  • Revision ID: mbp@sourcefrog.net-20060605165541-b83fe60311368198
[broken] Change BzrDir.create to use urlutils.split

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
        if cls is not BzrDir:
190
190
            raise AssertionError("BzrDir.create always creates the default format, "
191
191
                    "not one of %r" % cls)
192
 
        segments = base.split('/')
193
 
        if segments and segments[-1] not in ('', '.'):
194
 
            parent = '/'.join(segments[:-1])
195
 
            t = bzrlib.transport.get_transport(parent)
 
192
        head, tail = urlutils.split(base)
 
193
        if tail and tail != '.':
 
194
            # TODO: chdir to parent, don't use get_transport
 
195
            t = bzrlib.transport.get_transport(head)
196
196
            try:
197
 
                t.mkdir(segments[-1])
 
197
                t.mkdir(tail)
198
198
            except errors.FileExists:
199
199
                pass
200
200
        return BzrDirFormat.get_default_format().initialize(safe_unicode(base))