~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/branch.py

  • Committer: Martin Pool
  • Date: 2005-05-09 06:09:42 UTC
  • Revision ID: mbp@sourcefrog.net-20050509060942-d9c9efd7feed0894
- more indicators at top of test output
- tidy up remotebranch stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
 
42
42
 
43
 
def find_branch(f, **args):
44
 
    if f.startswith('http://') or f.startswith('https://'):
45
 
        import remotebranch 
46
 
        return remotebranch.RemoteBranch(f, **args)
47
 
    else:
48
 
        return Branch(f, **args)
49
 
        
50
 
 
51
43
def find_branch_root(f=None):
52
44
    """Find the branch root enclosing f, or pwd.
53
45
 
54
 
    f may be a filename or a URL.
55
 
 
56
46
    It is not necessary that f exists.
57
47
 
58
48
    Basically we keep looking up until we find the control directory or
63
53
        f = os.path.realpath(f)
64
54
    else:
65
55
        f = os.path.abspath(f)
66
 
    if not os.path.exists(f):
67
 
        raise BzrError('%r does not exist' % f)
68
 
        
69
56
 
70
57
    orig_f = f
71
58
 
213
200
        and binary.  binary files are untranslated byte streams.  Text
214
201
        control files are stored with Unix newlines and in UTF-8, even
215
202
        if the platform or locale defaults are different.
216
 
 
217
 
        Controlfiles should almost never be opened in write mode but
218
 
        rather should be atomically copied and replaced using atomicfile.
219
203
        """
220
204
 
221
205
        fn = self.controlfilename(file_or_path)