/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: Vincent Ladeuil
  • Date: 2007-02-17 09:02:59 UTC
  • mto: (157.1.8 trunk)
  • mto: This revision was merged to the branch mainline in revision 160.
  • Revision ID: v.ladeuil+lp@free.fr-20070217090259-kmay8g9eu688qw0l
Rename variable 'branch' to 'br' where it conflicts with 'branch' module

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
    
137
137
    """
138
138
    takes_args = [ "location?" ]
139
 
    
 
139
 
140
140
    def run(self, location="."):
141
 
        (branch, path) = branch.Branch.open_containing(location)
142
 
        
 
141
        (br, path) = branch.Branch.open_containing(location)
 
142
 
143
143
        pygtk = import_pygtk()
144
144
        try:
145
145
            import gtk
150
150
        from push import PushDialog
151
151
 
152
152
        set_ui_factory()
153
 
        dialog = PushDialog(branch)
 
153
        dialog = PushDialog(br)
154
154
        dialog.run()
155
155
 
156
156
register_command(cmd_gpush)
221
221
 
222
222
    def run(self, location=".", revision=None, limit=None):
223
223
        set_ui_factory()
224
 
        (branch, path) = branch.Branch.open_containing(location)
225
 
        branch.lock_read()
226
 
        branch.repository.lock_read()
 
224
        (br, path) = branch.Branch.open_containing(location)
 
225
        br.lock_read()
 
226
        br.repository.lock_read()
227
227
        try:
228
228
            if revision is None:
229
 
                revid = branch.last_revision()
 
229
                revid = br.last_revision()
230
230
                if revid is None:
231
231
                    return
232
232
            else:
233
 
                (revno, revid) = revision[0].in_history(branch)
 
233
                (revno, revid) = revision[0].in_history(br)
234
234
 
235
235
            from viz.branchwin import BranchWindow
236
236
            import gtk
237
237
                
238
238
            pp = BranchWindow()
239
 
            pp.set_branch(branch, revid, limit)
 
239
            pp.set_branch(br, revid, limit)
240
240
            pp.connect("destroy", lambda w: gtk.main_quit())
241
241
            pp.show()
242
242
            gtk.main()
243
243
        finally:
244
 
            branch.repository.unlock()
245
 
            branch.unlock()
 
244
            br.repository.unlock()
 
245
            br.unlock()
246
246
 
247
247
 
248
248
register_command(cmd_visualise)
284
284
 
285
285
        try:
286
286
            (tree, path) = workingtree.WorkingTree.open_containing(filename)
287
 
            branch = tree.branch
 
287
            br = tree.branch
288
288
        except errors.NoWorkingTree:
289
 
            (branch, path) = branch.Branch.open_containing(filename)
290
 
            tree = branch.basis_tree()
 
289
            (br, path) = branch.Branch.open_containing(filename)
 
290
            tree = br.basis_tree()
291
291
 
292
292
        file_id = tree.path2id(path)
293
293
 
296
296
        if revision is not None:
297
297
            if len(revision) != 1:
298
298
                raise BzrCommandError("Only 1 revion may be specified.")
299
 
            revision_id = revision[0].in_history(branch).rev_id
300
 
            tree = branch.repository.revision_tree(revision_id)
 
299
            revision_id = revision[0].in_history(br).rev_id
 
300
            tree = br.repository.revision_tree(revision_id)
301
301
        else:
302
302
            revision_id = getattr(tree, 'get_revision_id', lambda: None)()
303
303
 
306
306
        window.set_title(path + " - gannotate")
307
307
        config = GAnnotateConfig(window)
308
308
        window.show()
309
 
        branch.lock_read()
 
309
        br.lock_read()
310
310
        try:
311
 
            window.annotate(tree, branch, file_id)
 
311
            window.annotate(tree, br, file_id)
312
312
        finally:
313
 
            branch.unlock()
 
313
            br.unlock()
314
314
        window.jump_to_line(line)
315
315
        
316
316
        gtk.main()
347
347
                                   StrictCommitFailed)
348
348
 
349
349
        wt = None
350
 
        branch = None
 
350
        br = None
351
351
        try:
352
352
            (wt, path) = workingtree.WorkingTree.open_containing(filename)
353
 
            branch = wt.branch
 
353
            br = wt.branch
354
354
        except NotBranchError, e:
355
355
            path = e.path
356
356
        except NoWorkingTree, e:
357
357
            path = e.base
358
358
            try:
359
 
                (branch, path) = branch.Branch.open_containing(path)
 
359
                (br, path) = branch.Branch.open_containing(path)
360
360
            except NotBranchError, e:
361
361
                path = e.path
362
362
 
363
363
 
364
 
        commit = CommitDialog(wt, path, not branch)
 
364
        commit = CommitDialog(wt, path, not br)
365
365
        commit.run()
366
366
 
367
367
register_command(cmd_gcommit)