~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2007-03-15 22:35:35 UTC
  • mto: This revision was merged to the branch mainline in revision 2363.
  • Revision ID: john@arbash-meinel.com-20070315223535-d3d4964oe1hc8zhg
Add an overzealous test, for Unicode support of _iter_changes.
For both knowns and unknowns.
And include a basic, if suboptimal, fix.
I would rather defer the decoding until we've determined that we are going to return the tuple.
There is still something broken with added files, but I'll get to that.

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
   >>> import sys
 
5
   >>> from bzrlib.osutils import getcwd, dirname
 
6
   >>> from bzrlib.urlutils import local_path_from_url
 
7
   >>> 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:///')
 
12
   >>>
 
13
 
 
14
Each Transport instance represents a single logical directory.
 
15
 
 
16
   >>> dir = transport.get_transport(".")
 
17
   >>> local_path_from_url(dir.base) == getcwd() + '/'
 
18
   True
 
19
 
 
20
You can change directories via the clone method:
 
21
 
 
22
   >>> parent = dir.clone('..')
 
23
   >>> local_path_from_url(parent.base) == (dirname(getcwd()).rstrip('/') + '/')
 
24
   True