changeset 1112:87cbfaf79124

hgweb: add mdiff / fix sorting of archives
author mpm@selenic.com
date Sat, 27 Aug 2005 18:40:25 -0700
parents addcb77fe500
children 6130de75bb2a
files mercurial/hgweb.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb.py	Sat Aug 27 18:27:45 2005 -0700
+++ b/mercurial/hgweb.py	Sat Aug 27 18:40:25 2005 -0700
@@ -7,6 +7,7 @@
 # of the GNU General Public License, incorporated herein by reference.
 
 import os, cgi, time, re, socket, sys, zlib
+import mdiff
 from hg import *
 from ui import *
 
@@ -649,6 +650,9 @@
         reponame = re.sub(r"\W+", "-", self.reponame)
         name = "%s-%s/" % (reponame, short(cnode))
 
+        files = mf.keys()
+        files.sort()
+
         if type == 'zip':
             import zipfile
 
@@ -656,7 +660,7 @@
                 tmp = tempfile.mkstemp()[1]
                 zf = zipfile.ZipFile(tmp, "w", zipfile.ZIP_DEFLATED)
 
-                for f in mf.keys():
+                for f in files:
                     zf.writestr(name + f, self.repo.file(f).read(mf[f]))
                 zf.close()
 
@@ -678,7 +682,7 @@
             mtime = int(time.time())
 
             httphdr('application/octet-stream', name[:-1] + '.tar.' + type)
-            for fname in mf.keys():
+            for fname in files:
                 rcont = self.repo.file(fname).read(mf[fname])
                 finfo = tarfile.TarInfo(name + fname)
                 finfo.mtime = mtime