monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] viewmtn patch


From: Eric Anderson
Subject: [Monotone-devel] viewmtn patch
Date: Wed, 9 Aug 2006 22:52:01 -0700

Attached is a cumulative patch for all the fixes that I had to make to
get the current viewmtn head working on Debian stable.  Should I
a) commit these (in more pieces) into the net.angrygoats.viewmtn branch; or
b) commit these (in more pieces) into the usi.hpl.hp.com/viewmtn branch; or
c) have someone else apply the patch and commit?
        -Eric

wrapper.py: BUGFIX: query variable not defined, meant id, similarly
  fileid should have been file_id. Migrate back to syntax that works
  in python2.3 as that's all debian stable has a mod_python for.
  mod_python bugfix workaround. Write tarfile out as a pipe and
  incrementally so that on a large tarfile apache doesn't timeout and
  we don't buffer the entire tarfile in memory before transmitting.

fileinbranch.psp: BUGFIX: version was in array[3], not a array[0]

revision.psp: Bump ancestry limit to 1000

monotone.py: Remove --merges option as it is not in 0.28

# 
# old_revision [f89ea6a9c3161707d3c6b44cbdd2087e861ede7e]
# 
# patch "fileinbranch.psp"
#  from [4f01b7f1260ca7a9c756047ea0dcfaa5fabc4b0c]
#    to [c32126664f41c5d86f3a83e3d5897de4c0eccdb0]
# 
# patch "monotone.py"
#  from [f8211dca24b2b5e48c89d5e88d95388a683282b7]
#    to [7a49d40e757446fa186a98730c7a1c0ac8f4250f]
# 
# patch "revision.psp"
#  from [b5b23a31a00ed137eaa2d46681966ad758efc90b]
#    to [9da1d3661435b8433852bddfe0f2e9863f184e1e]
# 
# patch "wrapper.py"
#  from [dbbc871353ddfec1b56bf57b743a6b5cd70688c2]
#    to [04913d58e925c2f85a164fa82fe4feb5178a3e6d]
# 
============================================================
--- fileinbranch.psp    4f01b7f1260ca7a9c756047ea0dcfaa5fabc4b0c
+++ fileinbranch.psp    c32126664f41c5d86f3a83e3d5897de4c0eccdb0
@@ -31,7 +31,7 @@ for id in heads:
     if len(file_revisions) > 1:
         raise Exception("More than one file matches path?")
     elif len(file_revisions) == 1:
-        file_version[id] = file_revisions[0][0]
+        file_version[id] = file_revisions[0][3]
 if len(file_version.values()) == 0:
     raise Exception("No file such file found in this branch.")
 
============================================================
--- monotone.py f8211dca24b2b5e48c89d5e88d95388a683282b7
+++ monotone.py 7a49d40e757446fa186a98730c7a1c0ac8f4250f
@@ -285,7 +285,7 @@ class Monotone:
     def log(self, ids, limit=0):
         rv = []
         entry = None
-        command = self.base_command + " --merges log " + ' '.join(map(lambda 
x: '-r ' + pipes.quote(x), ids))
+        command = self.base_command + " log " + ' '.join(map(lambda x: '-r ' + 
pipes.quote(x), ids))
         if limit > 0: command += " --last=%d" % (limit)
         iterator = utility.iter_command(command)
         for line in iterator:
============================================================
--- revision.psp        b5b23a31a00ed137eaa2d46681966ad758efc90b
+++ revision.psp        9da1d3661435b8433852bddfe0f2e9863f184e1e
@@ -57,7 +57,7 @@ ancestry_limit = 10
 
 # generate the revision graph
 ancestry_limit = 10
-ancestry_maximum = 100
+ancestry_maximum = 1000
 try:
     if form.has_key('ancestry_limit'):
         ancestry_limit = int(form['ancestry_limit'])
============================================================
--- wrapper.py  dbbc871353ddfec1b56bf57b743a6b5cd70688c2
+++ wrapper.py  04913d58e925c2f85a164fa82fe4feb5178a3e6d
@@ -1,5 +1,8 @@
-
-from mod_python import apache,psp,util
+from mod_python import apache
+# bug workaround from:
+# http://issues.apache.org/jira/browse/MODPYTHON-12
+psp = apache.import_module("mod_python.psp")
+from mod_python import util
 from common import parse_timecert, ago_string, determine_date
 import mimetypes
 import monotone
@@ -102,7 +105,8 @@ def get_json(req, vars):
        rv['type'] = 'manifest'
        dir_seen = {} # would use a set, but need python2.4 really
        rv['file_count'] = 0
-       for file_id, filename in ((t[3], t[1]) for t in 
mt.manifest_of(query['id'])['file']):
+       tmp = [[t[3],t[1]] for t in mt.manifest_of(query['id'])['file']]
+       for file_id, filename in tmp:
            fsp = filename.rsplit('/', 1)
            if len(fsp) == 2 and not dir_seen.has_key(fsp[1]):
                dir_seen[fsp[1]] = True
@@ -125,7 +129,7 @@ def get_tar(req, vars):
             self.buf = nb
             return rv
         def write(self, s):
-            self.buf += s
+            req.write(s)
     mt = vars['mt'] 
     form = util.FieldStorage(req)
     if not form.has_key('id'):
@@ -135,9 +139,10 @@ def get_tar(req, vars):
     tar_file_name = "%s.tar" % (id)
     req.content_type = 'application/x-tar; charset=utf-8'
     req.headers_out["Content-Disposition"] = "attachment; filename=%s" % 
tar_file_name
-    tf = tarfile.open(mode="w", fileobj=tar_file)
-    for fileid, filename in ((t[3], t[1]) for t in mt.manifest_of(id)['file']):
-        data = mt.file(fileid)
+    tf = tarfile.open(mode="w|", fileobj=tar_file)
+    tmp = [[t[3],t[1]] for t in mt.manifest_of(id)['file']]
+    for file_id, filename in tmp:
+        data = mt.file(file_id)
         ti = tarfile.TarInfo()
         ti.mode = 00700
         ti.mtime = 0

reply via email to

[Prev in Thread] Current Thread [Next in Thread]