Mercurial > hg > pyhgsh
comparison mercurial/hgweb.py @ 1333:901c645c1943
hgweb: fix date bug in hgweb diff generation
author | mpm@selenic.com |
---|---|
date | Fri, 23 Sep 2005 17:08:45 -0700 |
parents | 77cd8068dbf4 |
children | b8c82bf3da21 |
comparison
equal
deleted
inserted
replaced
1332:404484c9628e | 1333:901c645c1943 |
---|---|
182 self.repo = hg.repository(self.repo.ui, self.repo.root) | 182 self.repo = hg.repository(self.repo.ui, self.repo.root) |
183 self.maxchanges = int(self.repo.ui.config("web", "maxchanges", 10)) | 183 self.maxchanges = int(self.repo.ui.config("web", "maxchanges", 10)) |
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, t): | |
188 return util.datestr(t) | |
189 | |
190 def listfiles(self, files, mf): | 187 def listfiles(self, files, mf): |
191 for f in files[:self.maxfiles]: | 188 for f in files[:self.maxfiles]: |
192 yield self.t("filenodelink", node=hex(mf[f]), file=f) | 189 yield self.t("filenodelink", node=hex(mf[f]), file=f) |
193 if len(files) > self.maxfiles: | 190 if len(files) > self.maxfiles: |
194 yield self.t("fileellipses") | 191 yield self.t("fileellipses") |
245 mf = r.manifest | 242 mf = r.manifest |
246 change1 = cl.read(node1) | 243 change1 = cl.read(node1) |
247 change2 = cl.read(node2) | 244 change2 = cl.read(node2) |
248 mmap1 = mf.read(change1[0]) | 245 mmap1 = mf.read(change1[0]) |
249 mmap2 = mf.read(change2[0]) | 246 mmap2 = mf.read(change2[0]) |
250 date1 = self.date(change1) | 247 date1 = util.datestr(change1[2]) |
251 date2 = self.date(change2) | 248 date2 = util.datestr(change2[2]) |
252 | 249 |
253 c, a, d, u = r.changes(node1, node2) | 250 c, a, d, u = r.changes(node1, node2) |
254 if files: | 251 if files: |
255 c, a, d = map(lambda x: filterfiles(x, files), (c, a, d)) | 252 c, a, d = map(lambda x: filterfiles(x, files), (c, a, d)) |
256 | 253 |