/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/doc/api/transport.txt

  • Committer: Michael Ellerman
  • Date: 2006-05-31 08:44:29 UTC
  • mto: (1711.2.63 jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1792.
  • Revision ID: michael@ellerman.id.au-20060531084429-35e5429abda9f560
Add optional location to ancestry and fix behaviour for checkouts.

This adds an optional location parameter to the ancestry command. It also
changes the behaviour of ancestry on checkouts such that if they have
been created with a subset of the branch history, only the subset is
shown by 'bzr ancestry'. Tests for all of that as well.

Show diffs side-by-side

added added

removed removed

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