/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-03-09 16:22:27 UTC
  • Revision ID: vernooij@lenovo-c29b82cd-20070309162227-wiodikw2iu0758l6
Fix PyGTK URL.

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
    
185
163
    ret = {}
186
164
    branch = working.branch
187
165
    basis = working.basis_tree()
188
 
 
 
166
    work_inv = working.inventory
 
167
    
189
168
    if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
190
169
        delta = compare_trees(basis, working, want_unchanged=True)
191
170
    else:
213
192
    
214
193
    ret = {}
215
194
    basis = working.basis_tree()
216
 
 
 
195
    work_inv = working.inventory
 
196
    
217
197
    if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
218
198
        delta = compare_trees(basis, working, want_unchanged=True)
219
199
    else:
235
215
    ret['ignored'] = ignore_cnt
236
216
 
237
217
    dir_cnt = 0
238
 
    for path, ie in working.iter_entries_by_dir():
239
 
        if ie.kind == 'directory':
 
218
    for file_id in work_inv:
 
219
        if work_inv.get_file_kind(file_id) == 'directory':
240
220
            dir_cnt += 1
241
221
    ret['subdirs'] = dir_cnt
242
222