/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: 2007-08-05 01:03:35 UTC
  • mto: This revision was merged to the branch mainline in revision 256.
  • Revision ID: jelmer@samba.org-20070805010335-1js1cwqxtcvbljw1
Add Merge Directive option to revision menu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import bzrlib
22
22
 
23
 
from bzrlib import (
24
 
    bzrdir,
25
 
    diff,
26
 
    errors,
27
 
    osutils,
28
 
    urlutils,
29
 
    )
 
23
import bzrlib.osutils as osutils
30
24
 
 
25
from bzrlib.info import _repo_rel_url
31
26
from bzrlib.missing import find_unmerged
32
27
 
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
 
 
50
28
def get_location_info(repository, branch=None, working=None):
51
29
    """ Get known locations for working, branch and repository.
52
30