/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/info_helper.py

  • Committer: Jelmer Vernooij
  • Date: 2008-06-29 19:18:34 UTC
  • mto: This revision was merged to the branch mainline in revision 515.
  • Revision ID: jelmer@samba.org-20080629191834-ha2ecpv5szt96nge
Make sure signed testament matches repository data.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import bzrlib
22
22
 
23
 
import bzrlib.osutils as osutils
 
23
from bzrlib import (
 
24
    bzrdir,
 
25
    diff,
 
26
    errors,
 
27
    osutils,
 
28
    urlutils,
 
29
    )
24
30
 
25
 
from bzrlib.info import _repo_rel_url
26
31
from bzrlib.missing import find_unmerged
27
32
 
 
33
def _repo_rel_url(repo_url, inner_url):
 
34
    """Return path with common prefix of repository path removed.
 
35
 
 
36
    If path is not part of the repository, the original path is returned.
 
37
    If path is equal to the repository, the current directory marker '.' is
 
38
    returned.
 
39
    Otherwise, a relative path is returned, with trailing '/' stripped.
 
40
    """
 
41
    inner_url = urlutils.normalize_url(inner_url)
 
42
    repo_url = urlutils.normalize_url(repo_url)
 
43
    if inner_url == repo_url:
 
44
        return '.'
 
45
    result = urlutils.relative_url(repo_url, inner_url)
 
46
    if result != inner_url:
 
47
        result = result.rstrip('/')
 
48
    return result
 
49
 
28
50
def get_location_info(repository, branch=None, working=None):
29
51
    """ Get known locations for working, branch and repository.
30
52