/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 status.py

  • Committer: Vincent Ladeuil
  • Date: 2008-06-10 15:25:47 UTC
  • mto: This revision was merged to the branch mainline in revision 504.
  • Revision ID: v.ladeuil+lp@free.fr-20080610152547-dwmil1p8pd0mfpnl
Fix third failing test (thanks to jam).

* tests/test_commit.py:
(TestPendingRevisions.test_pending_revisions_multi_merge): Fix
provided by jam: bzr we now filter the pending merges so that only
the 'heads()' are included. We just ensure that the pending merges
contain the unique tips for the ancestries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    pass
22
22
 
23
23
import gtk
 
24
from bzrlib.plugins.gtk import _i18n
 
25
 
24
26
 
25
27
class StatusDialog(gtk.Dialog):
26
28
    """ Display Status window and perform the needed actions. """
27
 
    def __init__(self, wt, wtpath):
 
29
    def __init__(self, wt, wtpath, revision=None):
28
30
        """ Initialize the Status window. """
29
31
        super(StatusDialog, self).__init__(flags=gtk.DIALOG_MODAL, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
30
32
        self.set_title("Working tree changes")
31
33
        self._create()
32
34
        self.wt = wt
33
35
        self.wtpath = wtpath
 
36
        
 
37
        if revision is None:
 
38
            revision = self.wt.branch.last_revision()
 
39
            
34
40
        # Set the old working tree
35
 
        self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
 
41
        self.old_tree = self.wt.branch.repository.revision_tree(revision)
36
42
        # Generate status output
37
43
        self._generate_status()
38
44
 
75
81
        
76
82
        if len(delta.added):
77
83
            changes = True
78
 
            titer = self.model.append(None, [ _('Added'), None ])
 
84
            titer = self.model.append(None, [ _i18n('Added'), None ])
79
85
            for path, id, kind in delta.added:
80
86
                self.model.append(titer, [ path, path ])
81
87
 
82
88
        if len(delta.removed):
83
89
            changes = True
84
 
            titer = self.model.append(None, [ _('Removed'), None ])
 
90
            titer = self.model.append(None, [ _i18n('Removed'), None ])
85
91
            for path, id, kind in delta.removed:
86
92
                self.model.append(titer, [ path, path ])
87
93
 
88
94
        if len(delta.renamed):
89
95
            changes = True
90
 
            titer = self.model.append(None, [ _('Renamed'), None ])
 
96
            titer = self.model.append(None, [ _i18n('Renamed'), None ])
91
97
            for oldpath, newpath, id, kind, text_modified, meta_modified \
92
98
                    in delta.renamed:
93
99
                self.model.append(titer, [ oldpath, newpath ])
94
100
 
95
101
        if len(delta.modified):
96
102
            changes = True
97
 
            titer = self.model.append(None, [ _('Modified'), None ])
 
103
            titer = self.model.append(None, [ _i18n('Modified'), None ])
98
104
            for path, id, kind, text_modified, meta_modified in delta.modified:
99
105
                self.model.append(titer, [ path, path ])
100
106
        
102
108
        for path in self.wt.unknowns():
103
109
            changes = True
104
110
            if not done_unknown:
105
 
                titer = self.model.append(None, [ _('Unknown'), None ])
 
111
                titer = self.model.append(None, [ _i18n('Unknown'), None ])
106
112
                done_unknown = True
107
113
            self.model.append(titer, [ path, path ])
108
114
 
109
115
        if not changes:
110
 
            self.model.append(None, [ _('No changes.'), None ])
 
116
            self.model.append(None, [ _i18n('No changes.'), None ])
111
117
 
112
118
        self.treeview.expand_all()
113
119