Show More
@@ -27,7 +27,7 b' def age(x):' | |||||
27 | return "%d %s" % (c, plural(t, c)) |
|
27 | return "%d %s" % (c, plural(t, c)) | |
28 |
|
28 | |||
29 | now = time.time() |
|
29 | now = time.time() | |
30 |
then = x[ |
|
30 | then = x[0] | |
31 | delta = max(1, int(now - then)) |
|
31 | delta = max(1, int(now - then)) | |
32 |
|
32 | |||
33 | scales = [["second", 1], |
|
33 | scales = [["second", 1], | |
@@ -155,13 +155,13 b' class templater:' | |||||
155 | common_filters = { |
|
155 | common_filters = { | |
156 | "escape": cgi.escape, |
|
156 | "escape": cgi.escape, | |
157 | "age": age, |
|
157 | "age": age, | |
158 |
"date": lambda x: util.datestr(x |
|
158 | "date": lambda x: util.datestr(x), | |
159 | "addbreaks": nl2br, |
|
159 | "addbreaks": nl2br, | |
160 | "obfuscate": obfuscate, |
|
160 | "obfuscate": obfuscate, | |
161 | "short": (lambda x: x[:12]), |
|
161 | "short": (lambda x: x[:12]), | |
162 | "firstline": (lambda x: x.splitlines(1)[0]), |
|
162 | "firstline": (lambda x: x.splitlines(1)[0]), | |
163 | "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--"), |
|
163 | "permissions": (lambda x: x and "-rwxr-xr-x" or "-rw-r--r--"), | |
164 |
"rfc822date": lambda x: util.datestr(x |
|
164 | "rfc822date": lambda x: util.datestr(x, "%a, %d %b %Y %H:%M:%S"), | |
165 | } |
|
165 | } | |
166 |
|
166 | |||
167 | class hgweb: |
|
167 | class hgweb: | |
@@ -184,8 +184,8 b' class hgweb:' | |||||
184 | self.maxfiles = int(self.repo.ui.config("web", "maxfiles", 10)) |
|
184 | self.maxfiles = int(self.repo.ui.config("web", "maxfiles", 10)) | |
185 | self.allowpull = self.repo.ui.configbool("web", "allowpull", True) |
|
185 | self.allowpull = self.repo.ui.configbool("web", "allowpull", True) | |
186 |
|
186 | |||
187 |
def date(self, |
|
187 | def date(self, t): | |
188 |
return util.datestr( |
|
188 | return util.datestr(t) | |
189 |
|
189 | |||
190 | def listfiles(self, files, mf): |
|
190 | def listfiles(self, files, mf): | |
191 | for f in files[:self.maxfiles]: |
|
191 | for f in files[:self.maxfiles]: | |
@@ -311,7 +311,7 b' class hgweb:' | |||||
311 | "changelogtag": self.showtag("changelogtag",n), |
|
311 | "changelogtag": self.showtag("changelogtag",n), | |
312 | "manifest": hex(changes[0]), |
|
312 | "manifest": hex(changes[0]), | |
313 | "desc": changes[4], |
|
313 | "desc": changes[4], | |
314 | "date": changes, |
|
314 | "date": changes[2], | |
315 | "files": self.listfilediffs(changes[3], n), |
|
315 | "files": self.listfilediffs(changes[3], n), | |
316 | "rev": i, |
|
316 | "rev": i, | |
317 | "node": hn}) |
|
317 | "node": hn}) | |
@@ -372,7 +372,7 b' class hgweb:' | |||||
372 | changelogtag=self.showtag("changelogtag",n), |
|
372 | changelogtag=self.showtag("changelogtag",n), | |
373 | manifest=hex(changes[0]), |
|
373 | manifest=hex(changes[0]), | |
374 | desc=changes[4], |
|
374 | desc=changes[4], | |
375 | date=changes, |
|
375 | date=changes[2], | |
376 | files=self.listfilediffs(changes[3], n), |
|
376 | files=self.listfilediffs(changes[3], n), | |
377 | rev=i, |
|
377 | rev=i, | |
378 | node=hn) |
|
378 | node=hn) | |
@@ -418,7 +418,7 b' class hgweb:' | |||||
418 | manifest=hex(changes[0]), |
|
418 | manifest=hex(changes[0]), | |
419 | author=changes[1], |
|
419 | author=changes[1], | |
420 | desc=changes[4], |
|
420 | desc=changes[4], | |
421 | date=changes, |
|
421 | date=changes[2], | |
422 | files=files, |
|
422 | files=files, | |
423 | archives=archivelist()) |
|
423 | archives=archivelist()) | |
424 |
|
424 | |||
@@ -443,7 +443,7 b' class hgweb:' | |||||
443 | "file": f, |
|
443 | "file": f, | |
444 | "node": hex(cn), |
|
444 | "node": hex(cn), | |
445 | "author": cs[1], |
|
445 | "author": cs[1], | |
446 | "date": cs, |
|
446 | "date": cs[2], | |
447 | "parent": self.parents("filelogparent", |
|
447 | "parent": self.parents("filelogparent", | |
448 | fl.parents(n), |
|
448 | fl.parents(n), | |
449 | fl.rev, file=f), |
|
449 | fl.rev, file=f), | |
@@ -480,7 +480,7 b' class hgweb:' | |||||
480 | node=hex(cn), |
|
480 | node=hex(cn), | |
481 | manifest=hex(mfn), |
|
481 | manifest=hex(mfn), | |
482 | author=cs[1], |
|
482 | author=cs[1], | |
483 | date=cs, |
|
483 | date=cs[2], | |
484 | parent=self.parents("filerevparent", |
|
484 | parent=self.parents("filerevparent", | |
485 | fl.parents(n), fl.rev, file=f), |
|
485 | fl.parents(n), fl.rev, file=f), | |
486 | permissions=self.repo.manifest.readflags(mfn)[f]) |
|
486 | permissions=self.repo.manifest.readflags(mfn)[f]) | |
@@ -532,7 +532,7 b' class hgweb:' | |||||
532 | node=hex(cn), |
|
532 | node=hex(cn), | |
533 | manifest=hex(mfn), |
|
533 | manifest=hex(mfn), | |
534 | author=cs[1], |
|
534 | author=cs[1], | |
535 | date=cs, |
|
535 | date=cs[2], | |
536 | parent=self.parents("fileannotateparent", |
|
536 | parent=self.parents("fileannotateparent", | |
537 | fl.parents(n), fl.rev, file=f), |
|
537 | fl.parents(n), fl.rev, file=f), | |
538 | permissions=self.repo.manifest.readflags(mfn)[f]) |
|
538 | permissions=self.repo.manifest.readflags(mfn)[f]) |
General Comments 0
You need to be logged in to leave comments.
Login now