/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: Vincent Ladeuil
  • Date: 2008-05-05 18:16:46 UTC
  • mto: (487.1.1 gtk)
  • mto: This revision was merged to the branch mainline in revision 490.
  • Revision ID: v.ladeuil+lp@free.fr-20080505181646-n95l8ltw2u6jtr26
Fix bug #187283 fix replacing _() by _i18n().

* genpot.sh 
Remove duplication. Add the ability to specify the genrated pot
file on command-line for debugging purposes.

* po/olive-gtk.pot:
Regenerated.

* __init__.py, branch.py, branchview/treeview.py, checkout.py,
commit.py, conflicts.py, diff.py, errors.py, initialize.py,
merge.py, nautilus-bzr.py, olive/__init__.py, olive/add.py,
olive/bookmark.py, olive/guifiles.py, olive/info.py,
olive/menu.py, olive/mkdir.py, olive/move.py, olive/remove.py,
olive/rename.py, push.py, revbrowser.py, status.py, tags.py:
Replace all calls to _() by calls to _i18n(), the latter being
defined in __init__.py and imported in the other modules from
there. This fix the problem encountered countless times when
running bzr selftest and getting silly error messages about
boolean not being callables.

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
21
20
 
22
21
import bzrlib
23
22
 
29
28
    urlutils,
30
29
    )
31
30
 
32
 
from bzrlib.diff import show_diff_trees
33
31
from bzrlib.missing import find_unmerged
34
 
    
 
32
 
35
33
def _repo_rel_url(repo_url, inner_url):
36
34
    """Return path with common prefix of repository path removed.
37
35
 
262
260
    if revno > 0:
263
261
        firstrev = repository.get_revision(history[0])
264
262
        age = int((time.time() - firstrev.timestamp) / 3600 / 24)
265
 
        ret['age'] = '%d days'%age
 
263
        ret['age'] = age
266
264
        ret['firstrev'] = osutils.format_date(firstrev.timestamp,
267
265
                                              firstrev.timezone)
268
266
 
281
279
    if repository.bzrdir.root_transport.listable():
282
280
        c, t = repository._revision_store.total_size(repository.get_transaction())
283
281
        ret['revisions'] = c
284
 
        ret['size'] = '%d KiB'%t
 
282
        ret['size'] = t
285
283
 
286
284
    return ret
287
285
 
300
298
 
301
299
    :param new_revision_spec:  if None, use working tree as new revision, otherwise use the tree for the specified revision.
302
300
    """
 
301
    import sys
 
302
    
 
303
    from bzrlib.diff import show_diff_trees
303
304
    
304
305
    if output == None:
305
306
        output = sys.stdout
306
307
    
 
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
    
307
312
    if old_revision_spec is None:
308
313
        old_tree = tree.basis_tree()
309
314
    else:
317
322
    return show_diff_trees(old_tree, new_tree, output, specific_files,
318
323
                           external_diff_options,
319
324
                           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)