~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2006-04-07 08:32:26 UTC
  • mto: (1654.1.5 integration)
  • mto: This revision was merged to the branch mainline in revision 1661.
  • Revision ID: robertc@robertcollins.net-20060407083226-2e8f48b8a7a16cf4
Change knit index files to be robust in the presence of partial writes.

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