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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-12-01 18:02:11 UTC
  • mfrom: (66.2.6 trunk)
  • Revision ID: szilveszter.farkas@gmail.com-20061201180211-hakaxu53l6eodq2i
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
        Option("all", help="show annotations on all lines"),
144
144
        Option("plain", help="don't highlight annotation lines"),
145
145
        Option("line", type=int, argname="lineno",
146
 
               help="jump to specified line number")
 
146
               help="jump to specified line number"),
 
147
        "revision",
147
148
    ]
148
149
    aliases = ["gblame", "gpraise"]
149
150
    
150
 
    def run(self, filename, all=False, plain=False, line='1'):
 
151
    def run(self, filename, all=False, plain=False, line='1', revision=None):
151
152
        import pygtk
152
153
        pygtk.require("2.0")
153
154
 
173
174
 
174
175
        if file_id is None:
175
176
            raise NotVersionedError(filename)
 
177
        if revision is not None:
 
178
            if len(revision) != 1:
 
179
                raise BzrCommandError("Only 1 revion may be specified.")
 
180
            revision_id = revision[0].in_history(branch).rev_id
 
181
        else:
 
182
            revision_id = None
176
183
 
177
184
        window = GAnnotateWindow(all, plain)
178
185
        window.connect("destroy", lambda w: gtk.main_quit())
181
188
        window.show()
182
189
        branch.lock_read()
183
190
        try:
184
 
            window.annotate(branch, file_id)
 
191
            window.annotate(branch, file_id, revision_id)
185
192
        finally:
186
193
            branch.unlock()
187
194
        window.jump_to_line(line)