~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin Pool
  • Date: 2005-08-25 05:58:05 UTC
  • mfrom: (974.1.36)
  • Revision ID: mbp@sourcefrog.net-20050825055805-8c892bc3c2d75131
- merge aaron's merge improvements:

  * When merging, pull in all missing revisions from the source
    branch. 

  * Detect common ancestors by looking at the whole ancestry graph, 
    rather than just mainline history.

  Some changes to reconcile this with parallel updates to the test and
  trace code.

aaron.bentley@utoronto.ca-20050823052551-f3401a8b57d9126f

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
 
   >>> from bzrlib.urlutils import local_path_from_url
6
 
   >>> import bzrlib.transport as transport
7
 
   >>> root = transport.get_transport("file:///")
8
 
   >>>
9
 
 
10
 
Each Transport instance represents a single logical directory.
11
 
 
12
 
   >>> dir = transport.get_transport(".")
13
 
   >>> local_path_from_url(dir.base) == getcwd() + '/'
14
 
   True
15
 
 
16
 
You can change directories via the clone method:
17
 
 
18
 
   >>> parent = dir.clone('..')
19
 
   >>> local_path_from_url(parent.base) == (dirname(getcwd()).rstrip('/') + '/')
20
 
   True