/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-07-15 15:22:29 UTC
  • Revision ID: jelmer@samba.org-20070715152229-clmlen0vpd8d2pzx
Add docstrings, remove unused code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
import bzrlib.osutils as osutils
24
24
 
25
 
from bzrlib.info import _repo_relpath
 
25
from bzrlib.info import _repo_rel_url
26
26
from bzrlib.missing import find_unmerged
27
27
 
28
28
def get_location_info(repository, branch=None, working=None):
41
41
            if repository.is_shared():
42
42
                # lightweight checkout of branch in shared repository
43
43
                ret['sharedrepo'] = repository_path
44
 
                ret['repobranch'] = _repo_relpath(repository_path, branch_path)
 
44
                ret['repobranch'] = _repo_rel_url(repository_path, branch_path)
45
45
            else:
46
46
                # lightweight checkout of standalone branch
47
47
                ret['cobranch'] = branch_path
48
48
        elif repository.is_shared():
49
49
            # branch with tree inside shared repository
50
50
            ret['sharedrepo'] = repository_path
51
 
            ret['repoco'] = _repo_relpath(repository_path, branch_path)
 
51
            ret['repoco'] = _repo_rel_url(repository_path, branch_path)
52
52
        elif branch.get_bound_location():
53
53
            # normal checkout
54
54
            ret['coroot'] = working_path
61
61
        if repository.is_shared():
62
62
            # branch is part of shared repository
63
63
            ret['sharedrepo'] = repository_path
64
 
            ret['repobranch'] = _repo_relpath(repository_path, branch_path)
 
64
            ret['repobranch'] = _repo_rel_url(repository_path, branch_path)
65
65
        else:
66
66
            # standalone branch
67
67
            ret['branchroot'] = branch_path
163
163
    ret = {}
164
164
    branch = working.branch
165
165
    basis = working.basis_tree()
166
 
    work_inv = working.inventory
167
 
    
 
166
 
168
167
    if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
169
168
        delta = compare_trees(basis, working, want_unchanged=True)
170
169
    else:
192
191
    
193
192
    ret = {}
194
193
    basis = working.basis_tree()
195
 
    work_inv = working.inventory
196
 
    
 
194
 
197
195
    if (bzrlib.version_info[0] == 0) and (bzrlib.version_info[1] < 9):
198
196
        delta = compare_trees(basis, working, want_unchanged=True)
199
197
    else:
215
213
    ret['ignored'] = ignore_cnt
216
214
 
217
215
    dir_cnt = 0
218
 
    for file_id in work_inv:
219
 
        if work_inv.get_file_kind(file_id) == 'directory':
 
216
    for path, ie in working.iter_entries_by_dir():
 
217
        if ie.kind == 'directory':
220
218
            dir_cnt += 1
221
219
    ret['subdirs'] = dir_cnt
222
220