/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2007-09-14 06:31:28 UTC
  • mfrom: (2822 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2823.
  • Revision ID: mbp@sourcefrog.net-20070914063128-0p7mh6zfb4pzdg9p
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
                            is_inside_or_parent_of_any,
73
73
                            quotefn, sha_file, split_lines)
74
74
from bzrlib.testament import Testament
75
 
from bzrlib.trace import mutter, note, warning
 
75
from bzrlib.trace import mutter, note, warning, is_quiet
76
76
from bzrlib.xml5 import serializer_v5
77
77
from bzrlib.inventory import Inventory, InventoryEntry
78
78
from bzrlib import symbol_versioning
80
80
        deprecated_function,
81
81
        DEPRECATED_PARAMETER)
82
82
from bzrlib.workingtree import WorkingTree
 
83
from bzrlib.urlutils import unescape_for_display
83
84
import bzrlib.ui
84
85
 
85
86
 
86
87
class NullCommitReporter(object):
87
88
    """I report on progress of a commit."""
88
89
 
 
90
    def started(self, revno, revid, location=None):
 
91
        pass
 
92
 
89
93
    def snapshot_change(self, change, path):
90
94
        pass
91
95
 
104
108
    def renamed(self, change, old_path, new_path):
105
109
        pass
106
110
 
 
111
    def is_verbose(self):
 
112
        return False
 
113
 
107
114
 
108
115
class ReportCommitToLog(NullCommitReporter):
109
116
 
121
128
            return
122
129
        self._note("%s %s", change, path)
123
130
 
 
131
    def started(self, revno, rev_id, location=None):
 
132
        if location is not None:
 
133
            location = ' to "' + unescape_for_display(location, 'utf-8') + '"'
 
134
        else:
 
135
            location = ''
 
136
        self._note('Committing revision %d%s.', revno, location)
 
137
 
124
138
    def completed(self, revno, rev_id):
125
139
        self._note('Committed revision %d.', revno)
126
 
    
 
140
 
127
141
    def deleted(self, file_id):
128
142
        self._note('deleted %s', file_id)
129
143
 
136
150
    def renamed(self, change, old_path, new_path):
137
151
        self._note('%s %s => %s', change, old_path, new_path)
138
152
 
 
153
    def is_verbose(self):
 
154
        return True
 
155
 
139
156
 
140
157
class Commit(object):
141
158
    """Task of committing a new revision.
152
169
    def __init__(self,
153
170
                 reporter=None,
154
171
                 config=None):
155
 
        if reporter is not None:
156
 
            self.reporter = reporter
157
 
        else:
158
 
            self.reporter = NullCommitReporter()
 
172
        """Create a Commit object.
 
173
 
 
174
        :param reporter: the default reporter to use or None to decide later
 
175
        """
 
176
        self.reporter = reporter
159
177
        self.config = config
160
 
        
 
178
 
161
179
    def commit(self,
162
180
               message=None,
163
181
               timestamp=None,
198
216
 
199
217
        :param revprops: Properties for new revision
200
218
        :param local: Perform a local only commit.
 
219
        :param reporter: the reporter to use or None for the default
 
220
        :param verbose: if True and the reporter is not None, report everything
201
221
        :param recursive: If set to 'down', commit in any subtrees that have
202
222
            pending changes of any sort during this commit.
203
223
        """
236
256
        self.strict = strict
237
257
        self.verbose = verbose
238
258
 
239
 
        if reporter is None and self.reporter is None:
240
 
            self.reporter = NullCommitReporter()
241
 
        elif reporter is not None:
242
 
            self.reporter = reporter
243
 
 
244
259
        self.work_tree.lock_write()
245
260
        self.pb = bzrlib.ui.ui_factory.nested_progress_bar()
246
261
        self.basis_tree = self.work_tree.basis_tree()
254
269
            self._check_bound_branch()
255
270
 
256
271
            # Check that the working tree is up to date
257
 
            old_revno,new_revno = self._check_out_of_date_tree()
 
272
            old_revno, new_revno = self._check_out_of_date_tree()
258
273
 
259
 
            if strict:
260
 
                # raise an exception as soon as we find a single unknown.
261
 
                for unknown in self.work_tree.unknowns():
262
 
                    raise StrictCommitFailed()
263
 
                   
 
274
            # Complete configuration setup
 
275
            if reporter is not None:
 
276
                self.reporter = reporter
 
277
            elif self.reporter is None:
 
278
                self.reporter = self._select_reporter()
264
279
            if self.config is None:
265
280
                self.config = self.branch.get_config()
266
281
 
280
295
            # information in the progress bar during the relevant stages.
281
296
            self.pb_stage_name = ""
282
297
            self.pb_stage_count = 0
283
 
            self.pb_stage_total = 4
 
298
            self.pb_stage_total = 5
284
299
            if self.bound_branch:
285
300
                self.pb_stage_total += 1
286
301
            self.pb.show_pct = False
295
310
            self._gather_parents()
296
311
            if len(self.parents) > 1 and self.specific_files:
297
312
                raise errors.CannotCommitSelectedFileMerge(self.specific_files)
298
 
            
 
313
 
299
314
            # Collect the changes
300
 
            self._emit_progress_set_stage("Collecting changes", show_entries=True)
 
315
            self._set_progress_stage("Collecting changes",
 
316
                    entries_title="Directory")
301
317
            self.builder = self.branch.get_commit_builder(self.parents,
302
318
                self.config, timestamp, timezone, committer, revprops, rev_id)
303
 
            self._update_builder_with_changes()
304
 
            self._check_pointless()
305
 
 
306
 
            # TODO: Now the new inventory is known, check for conflicts.
307
 
            # ADHB 2006-08-08: If this is done, populate_new_inv should not add
308
 
            # weave lines, because nothing should be recorded until it is known
309
 
            # that commit will succeed.
310
 
            self._emit_progress_set_stage("Saving data locally")
311
 
            self.builder.finish_inventory()
312
 
 
313
 
            # Prompt the user for a commit message if none provided
314
 
            message = message_callback(self)
315
 
            assert isinstance(message, unicode), type(message)
316
 
            self.message = message
317
 
            self._escape_commit_message()
318
 
 
319
 
            # Add revision data to the local branch
320
 
            self.rev_id = self.builder.commit(self.message)
321
319
            
 
320
            try:
 
321
                # find the location being committed to
 
322
                if self.bound_branch:
 
323
                    master_location = self.master_branch.base
 
324
                else:
 
325
                    master_location = self.branch.base
 
326
 
 
327
                # report the start of the commit
 
328
                self.reporter.started(new_revno, self.rev_id, master_location)
 
329
 
 
330
                self._update_builder_with_changes()
 
331
                self._check_pointless()
 
332
 
 
333
                # TODO: Now the new inventory is known, check for conflicts.
 
334
                # ADHB 2006-08-08: If this is done, populate_new_inv should not add
 
335
                # weave lines, because nothing should be recorded until it is known
 
336
                # that commit will succeed.
 
337
                self._set_progress_stage("Saving data locally")
 
338
                self.builder.finish_inventory()
 
339
 
 
340
                # Prompt the user for a commit message if none provided
 
341
                message = message_callback(self)
 
342
                assert isinstance(message, unicode), type(message)
 
343
                self.message = message
 
344
                self._escape_commit_message()
 
345
 
 
346
                # Add revision data to the local branch
 
347
                self.rev_id = self.builder.commit(self.message)
 
348
 
 
349
            except:
 
350
                self.builder.abort()
 
351
                raise
 
352
 
 
353
            self._process_pre_hooks(old_revno, new_revno)
 
354
 
322
355
            # Upload revision data to the master.
323
356
            # this will propagate merged revisions too if needed.
324
357
            if self.bound_branch:
325
 
                self._emit_progress_set_stage("Uploading data to master branch")
 
358
                self._set_progress_stage("Uploading data to master branch")
326
359
                self.master_branch.repository.fetch(self.branch.repository,
327
360
                                                    revision_id=self.rev_id)
328
361
                # now the master has the revision data
335
368
            self.branch.set_last_revision_info(new_revno, self.rev_id)
336
369
 
337
370
            # Make the working tree up to date with the branch
338
 
            self._emit_progress_set_stage("Updating the working tree")
 
371
            self._set_progress_stage("Updating the working tree")
339
372
            rev_tree = self.builder.revision_tree()
340
373
            self.work_tree.set_parent_trees([(self.rev_id, rev_tree)])
341
374
            self.reporter.completed(new_revno, self.rev_id)
342
 
            self._process_hooks(old_revno, new_revno)
 
375
            self._process_post_hooks(old_revno, new_revno)
343
376
        finally:
344
377
            self._cleanup()
345
378
        return self.rev_id
346
379
 
 
380
    def _select_reporter(self):
 
381
        """Select the CommitReporter to use."""
 
382
        if is_quiet():
 
383
            return NullCommitReporter()
 
384
        return ReportCommitToLog()
 
385
 
347
386
    def _any_real_changes(self):
348
387
        """Are there real changes between new_inventory and basis?
349
388
 
465
504
            new_revno = 1
466
505
        return old_revno,new_revno
467
506
 
468
 
    def _process_hooks(self, old_revno, new_revno):
469
 
        """Process any registered commit hooks."""
 
507
    def _process_pre_hooks(self, old_revno, new_revno):
 
508
        """Process any registered pre commit hooks."""
 
509
        self._set_progress_stage("Running pre_commit hooks")
 
510
        self._process_hooks("pre_commit", old_revno, new_revno)
 
511
 
 
512
    def _process_post_hooks(self, old_revno, new_revno):
 
513
        """Process any registered post commit hooks."""
470
514
        # Process the post commit hooks, if any
471
 
        self._emit_progress_set_stage("Running post commit hooks")
 
515
        self._set_progress_stage("Running post_commit hooks")
472
516
        # old style commit hooks - should be deprecated ? (obsoleted in
473
517
        # 0.15)
474
518
        if self.config.post_commit() is not None:
479
523
                              {'branch':self.branch,
480
524
                               'bzrlib':bzrlib,
481
525
                               'rev_id':self.rev_id})
 
526
        # process new style post commit hooks
 
527
        self._process_hooks("post_commit", old_revno, new_revno)
 
528
 
 
529
    def _process_hooks(self, hook_name, old_revno, new_revno):
 
530
        if not Branch.hooks[hook_name]:
 
531
            return
 
532
        
482
533
        # new style commit hooks:
483
534
        if not self.bound_branch:
484
535
            hook_master = self.branch
493
544
            old_revid = self.parents[0]
494
545
        else:
495
546
            old_revid = bzrlib.revision.NULL_REVISION
496
 
        for hook in Branch.hooks['post_commit']:
 
547
        
 
548
        if hook_name == "pre_commit":
 
549
            future_tree = self.builder.revision_tree()
 
550
            tree_delta = future_tree.changes_from(self.basis_tree,
 
551
                                             include_root=True)
 
552
        
 
553
        for hook in Branch.hooks[hook_name]:
497
554
            # show the running hook in the progress bar. As hooks may
498
555
            # end up doing nothing (e.g. because they are not configured by
499
556
            # the user) this is still showing progress, not showing overall
500
557
            # actions - its up to each plugin to show a UI if it want's to
501
558
            # (such as 'Emailing diff to foo@example.com').
502
 
            self.pb_stage_name = "Running post commit hooks [%s]" % \
503
 
                Branch.hooks.get_hook_name(hook)
 
559
            self.pb_stage_name = "Running %s hooks [%s]" % \
 
560
                (hook_name, Branch.hooks.get_hook_name(hook))
504
561
            self._emit_progress()
505
562
            if 'hooks' in debug.debug_flags:
506
563
                mutter("Invoking commit hook: %r", hook)
507
 
            hook(hook_local, hook_master, old_revno, old_revid, new_revno,
508
 
                self.rev_id)
 
564
            if hook_name == "post_commit":
 
565
                hook(hook_local, hook_master, old_revno, old_revid, new_revno,
 
566
                     self.rev_id)
 
567
            elif hook_name == "pre_commit":
 
568
                hook(hook_local, hook_master,
 
569
                     old_revno, old_revid, new_revno, self.rev_id,
 
570
                     tree_delta, future_tree)
509
571
 
510
572
    def _cleanup(self):
511
573
        """Cleanup any open locks, progress bars etc."""
594
656
 
595
657
        specific_files = self.specific_files
596
658
        mutter("Selecting files for commit with filter %s", specific_files)
597
 
        work_inv = self.work_tree.inventory
598
 
        assert work_inv.root is not None
599
 
        self.pb_entries_total = len(work_inv)
600
659
 
601
660
        # Check and warn about old CommitBuilders
602
 
        entries = work_inv.iter_entries()
603
661
        if not self.builder.record_root_entry:
604
662
            symbol_versioning.warn('CommitBuilders should support recording'
605
663
                ' the root entry as of bzr 0.10.', DeprecationWarning, 
606
664
                stacklevel=1)
607
665
            self.builder.new_inventory.add(self.basis_inv.root.copy())
608
 
            entries.next()
609
 
 
 
666
 
 
667
        # Build the new inventory
 
668
        self._populate_from_inventory(specific_files)
 
669
 
 
670
        # If specific files are selected, then all un-selected files must be
 
671
        # recorded in their previous state. For more details, see
 
672
        # https://lists.ubuntu.com/archives/bazaar/2007q3/028476.html.
 
673
        if specific_files:
 
674
            for path, new_ie in self.basis_inv.iter_entries():
 
675
                if new_ie.file_id in self.builder.new_inventory:
 
676
                    continue
 
677
                if is_inside_any(specific_files, path):
 
678
                    continue
 
679
                ie = new_ie.copy()
 
680
                ie.revision = None
 
681
                self.builder.record_entry_contents(ie, self.parent_invs, path,
 
682
                                                   self.basis_tree)
 
683
 
 
684
        # Report what was deleted.
 
685
        if self.reporter.is_verbose():
 
686
            for path, ie in self.basis_inv.iter_entries():
 
687
                if ie.file_id not in self.builder.new_inventory:
 
688
                    self.reporter.deleted(path)
 
689
 
 
690
    def _populate_from_inventory(self, specific_files):
 
691
        """Populate the CommitBuilder by walking the working tree inventory."""
 
692
        if self.strict:
 
693
            # raise an exception as soon as we find a single unknown.
 
694
            for unknown in self.work_tree.unknowns():
 
695
                raise StrictCommitFailed()
 
696
               
 
697
        report_changes = self.reporter.is_verbose()
610
698
        deleted_ids = []
611
699
        deleted_paths = set()
612
 
        for path, new_ie in entries:
613
 
            self._emit_progress_next_entry()
614
 
            file_id = new_ie.file_id
 
700
        work_inv = self.work_tree.inventory
 
701
        assert work_inv.root is not None
 
702
        entries = work_inv.iter_entries()
 
703
        if not self.builder.record_root_entry:
 
704
            entries.next()
 
705
        for path, existing_ie in entries:
 
706
            file_id = existing_ie.file_id
 
707
            name = existing_ie.name
 
708
            parent_id = existing_ie.parent_id
 
709
            kind = existing_ie.kind
 
710
            if kind == 'directory':
 
711
                self._next_progress_entry()
615
712
 
616
713
            # Skip files that have been deleted from the working tree.
617
714
            # The deleted files/directories are also recorded so they
628
725
                    continue
629
726
            try:
630
727
                kind = self.work_tree.kind(file_id)
 
728
                # TODO: specific_files filtering before nested tree processing
631
729
                if kind == 'tree-reference' and self.recursive == 'down':
632
 
                    # nested tree: commit in it
633
 
                    sub_tree = WorkingTree.open(self.work_tree.abspath(path))
634
 
                    # FIXME: be more comprehensive here:
635
 
                    # this works when both trees are in --trees repository,
636
 
                    # but when both are bound to a different repository,
637
 
                    # it fails; a better way of approaching this is to 
638
 
                    # finally implement the explicit-caches approach design
639
 
                    # a while back - RBC 20070306.
640
 
                    if (sub_tree.branch.repository.bzrdir.root_transport.base
641
 
                        ==
642
 
                        self.work_tree.branch.repository.bzrdir.root_transport.base):
643
 
                        sub_tree.branch.repository = \
644
 
                            self.work_tree.branch.repository
645
 
                    try:
646
 
                        sub_tree.commit(message=None, revprops=self.revprops,
647
 
                            recursive=self.recursive,
648
 
                            message_callback=self.message_callback,
649
 
                            timestamp=self.timestamp, timezone=self.timezone,
650
 
                            committer=self.committer,
651
 
                            allow_pointless=self.allow_pointless,
652
 
                            strict=self.strict, verbose=self.verbose,
653
 
                            local=self.local, reporter=self.reporter)
654
 
                    except errors.PointlessCommit:
655
 
                        pass
656
 
                if kind != new_ie.kind:
657
 
                    new_ie = inventory.make_entry(kind, new_ie.name,
658
 
                                                  new_ie.parent_id, file_id)
 
730
                    self._commit_nested_tree(file_id, path)
659
731
            except errors.NoSuchFile:
660
732
                pass
661
 
            # mutter('check %s {%s}', path, file_id)
662
 
            if (not specific_files or 
663
 
                is_inside_or_parent_of_any(specific_files, path)):
664
 
                    # mutter('%s selected for commit', path)
665
 
                    ie = new_ie.copy()
 
733
 
 
734
            # Record an entry for this item
 
735
            # Note: I don't particularly want to have the existing_ie
 
736
            # parameter but the test suite currently (28-Jun-07) breaks
 
737
            # without it thanks to a unicode normalisation issue. :-(
 
738
            definitely_changed = kind != existing_ie.kind 
 
739
            self._record_entry(path, file_id, specific_files, kind, name,
 
740
                parent_id, definitely_changed, existing_ie, report_changes)
 
741
 
 
742
        # Unversion IDs that were found to be deleted
 
743
        self.work_tree.unversion(deleted_ids)
 
744
 
 
745
    def _commit_nested_tree(self, file_id, path):
 
746
        "Commit a nested tree."
 
747
        sub_tree = self.work_tree.get_nested_tree(file_id, path)
 
748
        # FIXME: be more comprehensive here:
 
749
        # this works when both trees are in --trees repository,
 
750
        # but when both are bound to a different repository,
 
751
        # it fails; a better way of approaching this is to 
 
752
        # finally implement the explicit-caches approach design
 
753
        # a while back - RBC 20070306.
 
754
        if sub_tree.branch.repository.has_same_location(
 
755
            self.work_tree.branch.repository):
 
756
            sub_tree.branch.repository = \
 
757
                self.work_tree.branch.repository
 
758
        try:
 
759
            sub_tree.commit(message=None, revprops=self.revprops,
 
760
                recursive=self.recursive,
 
761
                message_callback=self.message_callback,
 
762
                timestamp=self.timestamp, timezone=self.timezone,
 
763
                committer=self.committer,
 
764
                allow_pointless=self.allow_pointless,
 
765
                strict=self.strict, verbose=self.verbose,
 
766
                local=self.local, reporter=self.reporter)
 
767
        except errors.PointlessCommit:
 
768
            pass
 
769
 
 
770
    def _record_entry(self, path, file_id, specific_files, kind, name,
 
771
            parent_id, definitely_changed, existing_ie=None,
 
772
            report_changes=True):
 
773
        "Record the new inventory entry for a path if any."
 
774
        # mutter('check %s {%s}', path, file_id)
 
775
        if (not specific_files or 
 
776
            is_inside_or_parent_of_any(specific_files, path)):
 
777
                # mutter('%s selected for commit', path)
 
778
                if definitely_changed or existing_ie is None:
 
779
                    ie = inventory.make_entry(kind, name, parent_id, file_id)
 
780
                else:
 
781
                    ie = existing_ie.copy()
666
782
                    ie.revision = None
 
783
        else:
 
784
            # mutter('%s not selected for commit', path)
 
785
            if self.basis_inv.has_id(file_id):
 
786
                ie = self.basis_inv[file_id].copy()
667
787
            else:
668
 
                # mutter('%s not selected for commit', path)
669
 
                if self.basis_inv.has_id(file_id):
670
 
                    ie = self.basis_inv[file_id].copy()
671
 
                else:
672
 
                    # this entry is new and not being committed
673
 
                    continue
 
788
                # this entry is new and not being committed
 
789
                ie = None
 
790
        if ie is not None:
674
791
            self.builder.record_entry_contents(ie, self.parent_invs, 
675
792
                path, self.work_tree)
676
 
            # describe the nature of the change that has occurred relative to
677
 
            # the basis inventory.
678
 
            if (self.basis_inv.has_id(ie.file_id)):
679
 
                basis_ie = self.basis_inv[ie.file_id]
680
 
            else:
681
 
                basis_ie = None
682
 
            change = ie.describe_change(basis_ie, ie)
683
 
            if change in (InventoryEntry.RENAMED, 
684
 
                InventoryEntry.MODIFIED_AND_RENAMED):
685
 
                old_path = self.basis_inv.id2path(ie.file_id)
686
 
                self.reporter.renamed(change, old_path, path)
687
 
            else:
688
 
                self.reporter.snapshot_change(change, path)
689
 
 
690
 
        # Unversion IDs that were found to be deleted
691
 
        self.work_tree.unversion(deleted_ids)
692
 
 
693
 
        # If specific files/directories were nominated, it is possible
694
 
        # that some data from outside those needs to be preserved from
695
 
        # the basis tree. For example, if a file x is moved from out of
696
 
        # directory foo into directory bar and the user requests
697
 
        # ``commit foo``, then information about bar/x must also be
698
 
        # recorded.
699
 
        if specific_files:
700
 
            for path, new_ie in self.basis_inv.iter_entries():
701
 
                if new_ie.file_id in work_inv:
702
 
                    continue
703
 
                if is_inside_any(specific_files, path):
704
 
                    continue
705
 
                ie = new_ie.copy()
706
 
                ie.revision = None
707
 
                self.builder.record_entry_contents(ie, self.parent_invs, path,
708
 
                                                   self.basis_tree)
709
 
 
710
 
        # Report what was deleted. We could skip this when no deletes are
711
 
        # detected to gain a performance win, but it arguably serves as a
712
 
        # 'safety check' by informing the user whenever anything disappears.
713
 
        for path, ie in self.basis_inv.iter_entries():
714
 
            if ie.file_id not in self.builder.new_inventory:
715
 
                self.reporter.deleted(path)
716
 
 
717
 
    def _emit_progress_set_stage(self, name, show_entries=False):
 
793
            if report_changes:
 
794
                self._report_change(ie, path)
 
795
        return ie
 
796
 
 
797
    def _report_change(self, ie, path):
 
798
        """Report a change to the user.
 
799
 
 
800
        The change that has occurred is described relative to the basis
 
801
        inventory.
 
802
        """
 
803
        if (self.basis_inv.has_id(ie.file_id)):
 
804
            basis_ie = self.basis_inv[ie.file_id]
 
805
        else:
 
806
            basis_ie = None
 
807
        change = ie.describe_change(basis_ie, ie)
 
808
        if change in (InventoryEntry.RENAMED, 
 
809
            InventoryEntry.MODIFIED_AND_RENAMED):
 
810
            old_path = self.basis_inv.id2path(ie.file_id)
 
811
            self.reporter.renamed(change, old_path, path)
 
812
        else:
 
813
            self.reporter.snapshot_change(change, path)
 
814
 
 
815
    def _set_progress_stage(self, name, entries_title=None):
718
816
        """Set the progress stage and emit an update to the progress bar."""
719
817
        self.pb_stage_name = name
720
818
        self.pb_stage_count += 1
721
 
        self.pb_entries_show = show_entries
722
 
        if show_entries:
 
819
        self.pb_entries_title = entries_title
 
820
        if entries_title is not None:
723
821
            self.pb_entries_count = 0
724
822
            self.pb_entries_total = '?'
725
823
        self._emit_progress()
726
824
 
727
 
    def _emit_progress_next_entry(self):
728
 
        """Emit an update to the progress bar and increment the file count."""
 
825
    def _next_progress_entry(self):
 
826
        """Emit an update to the progress bar and increment the entry count."""
729
827
        self.pb_entries_count += 1
730
828
        self._emit_progress()
731
829
 
732
830
    def _emit_progress(self):
733
 
        if self.pb_entries_show:
734
 
            text = "%s [Entry %d/%s] - Stage" % (self.pb_stage_name,
735
 
                self.pb_entries_count,str(self.pb_entries_total))
 
831
        if self.pb_entries_title:
 
832
            if self.pb_entries_total == '?':
 
833
                text = "%s [%s %d] - Stage" % (self.pb_stage_name,
 
834
                    self.pb_entries_title, self.pb_entries_count)
 
835
            else:
 
836
                text = "%s [%s %d/%s] - Stage" % (self.pb_stage_name,
 
837
                    self.pb_entries_title, self.pb_entries_count,
 
838
                    str(self.pb_entries_total))
736
839
        else:
737
840
            text = "%s - Stage" % (self.pb_stage_name)
738
841
        self.pb.update(text, self.pb_stage_count, self.pb_stage_total)