~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/doc/api/transport.txt

  • Committer: Robert Collins
  • Date: 2005-09-28 05:25:54 UTC
  • mfrom: (1185.1.42)
  • mto: (1092.2.18)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050928052554-beb985505f77ea6a
update symlink branch to integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
The Transport API in bzrlib provides URL based access to network resources.
2
 
 
3
 
   >>> import os
4
 
   >>> from bzrlib.osutils import getcwd, dirname
5
 
   >>> import bzrlib.transport as transport
6
 
   >>> root = transport.get_transport("file:///")
7
 
   >>>
8
 
 
9
 
Each Transport instance represents a single logical directory.
10
 
 
11
 
   >>> dir = transport.get_transport(".")
12
 
   >>> dir.base == getcwd() + '/'
13
 
   True
14
 
 
15
 
You can change directories via the clone method:
16
 
 
17
 
   >>> parent = dir.clone('..')
18
 
   >>> parent.base == (dirname(getcwd()).rstrip('/') + '/')
19
 
   True