[announce] bzrweb seems a bit finished

Chris McCormick chris at mccormick.cx
Wed Jun 1 04:30:56 BST 2005

On Wed, Jun 01, 2005 at 01:55:41PM +1000, Martin Pool wrote:
> On Wed, 2005-06-01 at 10:16 +0800, Chris McCormick wrote:
> > Bzrweb is working against the latest bzr.dev as well, however I think
> > there may be some issues with locking files not owned by the Apache
> > user again because the lock_mode argument was removed from the Branch
> > constructor. 
> There are now lock_read() and lock_write() methods.  I would expect that
> bzrweb wouldn't need to call either of them though, because it's
> presumably only doing readonly access and the relevant branch methods
> take and release locks as needed.

Yep, I saw those new methods and you're right that bzrweb doesn't need
to use them since branch does all the locking itself.

> Locking currently has the bug that it always tries to open the file
> read-write even if it only wants a read lock, which is presumably
> causing the permissions problems.  I am going to change that now so that
> readers only need filesystem read access, which should fix your
> problems.


Incidentally, bzrweb still requires the trivial patch to bzr on
show_diff() which allows the optional argument of target_revision
[attached]. I should probably look at `bzr diff` again to see if it
still uses show_diff().

Best regards,


chris at mccormick.cx
-------------- next part --------------
*** modified file '.bzrignore'
--- .bzrignore 
+++ .bzrignore 
@@ -10,4 +10,3 @@

*** modified file 'bzrlib/diff.py'
--- bzrlib/diff.py 
+++ bzrlib/diff.py 
@@ -147,7 +147,7 @@
-def show_diff(b, revision, specific_files, external_diff_options=None):
+def show_diff(b, revision, specific_files, external_diff_options=None, target_revision=None):
     import sys
     if revision == None:
@@ -155,7 +155,10 @@
         old_tree = b.revision_tree(b.lookup_revision(revision))
-    new_tree = b.working_tree()
+    if (target_revision):
+        new_tree = b.revision_tree(b.lookup_revision(target_revision))
+    else:
+        new_tree = b.working_tree()
     show_diff_trees(old_tree, new_tree, sys.stdout, specific_files,

More information about the bazaar mailing list