/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: 2009-05-04 20:06:58 UTC
  • Revision ID: jelmer@samba.org-20090504200658-n6hsag1soygn3n1o
Use _get_nick(local=True) rather than .nick to get at a branches' nick, since 
the previous might check the nickname of the master branch, which will be slow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
18
 
19
19
import time
 
20
import sys
20
21
 
21
22
import bzrlib
22
23
 
28
29
    urlutils,
29
30
    )
30
31
 
 
32
from bzrlib.diff import show_diff_trees
31
33
from bzrlib.missing import find_unmerged
32
 
 
 
34
    
33
35
def _repo_rel_url(repo_url, inner_url):
34
36
    """Return path with common prefix of repository path removed.
35
37
 
260
262
    if revno > 0:
261
263
        firstrev = repository.get_revision(history[0])
262
264
        age = int((time.time() - firstrev.timestamp) / 3600 / 24)
263
 
        ret['age'] = age
 
265
        ret['age'] = '%d days'%age
264
266
        ret['firstrev'] = osutils.format_date(firstrev.timestamp,
265
267
                                              firstrev.timezone)
266
268
 
279
281
    if repository.bzrdir.root_transport.listable():
280
282
        c, t = repository._revision_store.total_size(repository.get_transaction())
281
283
        ret['revisions'] = c
282
 
        ret['size'] = t
 
284
        ret['size'] = '%d KiB'%t
283
285
 
284
286
    return ret
285
287
 
298
300
 
299
301
    :param new_revision_spec:  if None, use working tree as new revision, otherwise use the tree for the specified revision.
300
302
    """
301
 
    import sys
302
 
    
303
 
    from bzrlib.diff import show_diff_trees
304
303
    
305
304
    if output == None:
306
305
        output = sys.stdout
307
306
    
308
 
    def spec_tree(spec):
309
 
        revision_id = spec.in_store(tree.branch).rev_id
310
 
        return tree.branch.repository.revision_tree(revision_id)
311
 
    
312
307
    if old_revision_spec is None:
313
308
        old_tree = tree.basis_tree()
314
309
    else:
322
317
    return show_diff_trees(old_tree, new_tree, output, specific_files,
323
318
                           external_diff_options,
324
319
                           old_label=old_label, new_label=new_label)
 
320
 
 
321
def spec_tree(spec):
 
322
        revision_id = spec.in_store(tree.branch).rev_id
 
323
        return tree.branch.repository.revision_tree(revision_id)