[Pkg-bazaar-commits] ./bzr-gtk/unstable r464: Fixes Bug #136530

Martin Albisetti argentina at gmail.com
Fri Apr 10 07:44:52 UTC 2009


------------------------------------------------------------
revno: 464
committer: Martin Albisetti <argentina at gmail.com>
branch nick: gtk.javierder
timestamp: Fri 2008-04-18 12:01:47 -0300
message:
  Fixes Bug #136530
modified:
  __init__.py
  status.py
    ------------------------------------------------------------
    revno: 463.1.1
    committer: Javier Derderian <javierder at gmail.com>
    branch nick: bug.136530
    timestamp: Tue 2008-04-15 21:00:41 -0300
    message:
      Added revision option to gstatus. Bug #136530
    modified:
      __init__.py
      status.py
    ------------------------------------------------------------
    revno: 463.1.2
    committer: Javier Derderian <javierder at gmail.com>
    branch nick: bug.136530
    timestamp: Wed 2008-04-16 14:23:57 -0300
    message:
      Added 'Revision # doesn't exist' message
    modified:
      __init__.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py	2008-04-01 10:18:53 +0000
+++ b/__init__.py	2008-04-16 17:23:57 +0000
@@ -383,14 +383,24 @@
     
     aliases = [ "gst" ]
     takes_args = ['PATH?']
-    takes_options = []
+    takes_options = ['revision']
 
-    def run(self, path='.'):
+    def run(self, path='.', revision=None):
         import os
         gtk = self.open_display()
         from status import StatusDialog
         (wt, wt_path) = workingtree.WorkingTree.open_containing(path)
-        status = StatusDialog(wt, wt_path)
+        
+        if revision is not None:
+            try:
+                revision_id = revision[0].in_history(wt.branch).rev_id
+            except:
+                from bzrlib.errors import BzrError
+                raise BzrError('Revision %r doesn\'t exist' % revision[0].user_spec )
+        else:
+            revision_id = None
+
+        status = StatusDialog(wt, wt_path, revision_id)
         status.connect("destroy", gtk.main_quit)
         status.run()
 

=== modified file 'status.py'
--- a/status.py	2007-05-14 10:54:40 +0000
+++ b/status.py	2008-04-16 00:00:41 +0000
@@ -24,15 +24,19 @@
 
 class StatusDialog(gtk.Dialog):
     """ Display Status window and perform the needed actions. """
-    def __init__(self, wt, wtpath):
+    def __init__(self, wt, wtpath, revision=None):
         """ Initialize the Status window. """
         super(StatusDialog, self).__init__(flags=gtk.DIALOG_MODAL, buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
         self.set_title("Working tree changes")
         self._create()
         self.wt = wt
         self.wtpath = wtpath
+        
+        if revision is None:
+            revision = self.wt.branch.last_revision()
+            
         # Set the old working tree
-        self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
+        self.old_tree = self.wt.branch.repository.revision_tree(revision)
         # Generate status output
         self._generate_status()
 



More information about the Pkg-bazaar-commits mailing list