##// END OF EJS Templates
Merge with crew.
Bryan O'Sullivan -
r4494:649dd249 merge default
parent child Browse files
Show More
@@ -1594,7 +1594,7 b' def clone(ui, source, dest=None, **opts)'
1594 destrev = heads.keys()
1594 destrev = heads.keys()
1595 destrev.append(sr.changelog.parents(qbase)[0])
1595 destrev.append(sr.changelog.parents(qbase)[0])
1596 ui.note(_('cloning main repo\n'))
1596 ui.note(_('cloning main repo\n'))
1597 sr, dr = hg.clone(ui, sr, dest,
1597 sr, dr = hg.clone(ui, sr.url(), dest,
1598 pull=opts['pull'],
1598 pull=opts['pull'],
1599 rev=destrev,
1599 rev=destrev,
1600 update=False,
1600 update=False,
@@ -32,7 +32,7 b' from mercurial.i18n import _'
32 import os
32 import os
33
33
34 def dopurge(ui, repo, dirs=None, act=True, abort_on_err=False, eol='\n',
34 def dopurge(ui, repo, dirs=None, act=True, abort_on_err=False, eol='\n',
35 force=False):
35 force=False, include=None, exclude=None):
36 def error(msg):
36 def error(msg):
37 if abort_on_err:
37 if abort_on_err:
38 raise util.Abort(msg)
38 raise util.Abort(msg)
@@ -51,7 +51,8 b' def dopurge(ui, repo, dirs=None, act=Tru'
51 directories = []
51 directories = []
52 files = []
52 files = []
53 missing = []
53 missing = []
54 roots, match, anypats = util.cmdmatcher(repo.root, repo.getcwd(), dirs)
54 roots, match, anypats = util.cmdmatcher(repo.root, repo.getcwd(), dirs,
55 include, exclude)
55 for src, f, st in repo.dirstate.statwalk(files=roots, match=match,
56 for src, f, st in repo.dirstate.statwalk(files=roots, match=match,
56 ignored=True, directories=True):
57 ignored=True, directories=True):
57 if src == 'd':
58 if src == 'd':
@@ -71,7 +72,7 b' def dopurge(ui, repo, dirs=None, act=Tru'
71 remove(os.remove, f)
72 remove(os.remove, f)
72
73
73 for f in directories[::-1]:
74 for f in directories[::-1]:
74 if not os.listdir(repo.wjoin(f)):
75 if match(f) and not os.listdir(repo.wjoin(f)):
75 ui.note(_('Removing directory %s\n') % f)
76 ui.note(_('Removing directory %s\n') % f)
76 remove(os.rmdir, f)
77 remove(os.rmdir, f)
77
78
@@ -144,7 +145,9 b' def purge(ui, repo, *dirs, **opts):'
144 # --print0 implies --print
145 # --print0 implies --print
145 act = False
146 act = False
146 force = bool(opts['force'])
147 force = bool(opts['force'])
147 dopurge(ui, repo, dirs, act, abort_on_err, eol, force)
148 include = opts['include']
149 exclude = opts['exclude']
150 dopurge(ui, repo, dirs, act, abort_on_err, eol, force, include, exclude)
148
151
149
152
150 cmdtable = {
153 cmdtable = {
@@ -154,6 +157,8 b' cmdtable = {'
154 ('f', 'force', None, _('purge even when missing files are detected')),
157 ('f', 'force', None, _('purge even when missing files are detected')),
155 ('p', 'print', None, _('print the file names instead of deleting them')),
158 ('p', 'print', None, _('print the file names instead of deleting them')),
156 ('0', 'print0', None, _('end filenames with NUL, for use with xargs'
159 ('0', 'print0', None, _('end filenames with NUL, for use with xargs'
157 ' (implies -p)'))],
160 ' (implies -p)')),
161 ('I', 'include', [], _('include names matching the given patterns')),
162 ('X', 'exclude', [], _('exclude names matching the given patterns'))],
158 _('hg purge [OPTION]... [DIR]...'))
163 _('hg purge [OPTION]... [DIR]...'))
159 }
164 }
@@ -11,6 +11,15 b' import os, sys, mdiff, bdiff, util, temp'
11
11
12 revrangesep = ':'
12 revrangesep = ':'
13
13
14 def parseurl(url, revs):
15 '''parse url#branch, returning url, branch + revs'''
16
17 if '#' not in url:
18 return url, (revs or None)
19
20 url, rev = url.split('#', 1)
21 return url, revs + [rev]
22
14 def revpair(repo, revs):
23 def revpair(repo, revs):
15 '''return pair of nodes, given list of revisions. second item can
24 '''return pair of nodes, given list of revisions. second item can
16 be None, meaning use working dir.'''
25 be None, meaning use working dir.'''
@@ -160,9 +169,11 b' def findrenames(repo, added=None, remove'
160 for line in alines[x1:x2]:
169 for line in alines[x1:x2]:
161 equal += len(line)
170 equal += len(line)
162
171
163 myscore = equal*2.0 / (len(aa)+len(rr))
172 lengths = len(aa) + len(rr)
164 if myscore >= bestscore:
173 if lengths:
165 bestname, bestscore = r, myscore
174 myscore = equal*2.0 / lengths
175 if myscore >= bestscore:
176 bestname, bestscore = r, myscore
166 if bestname:
177 if bestname:
167 yield bestname, a, bestscore
178 yield bestname, a, bestscore
168
179
@@ -336,7 +336,8 b' def bundle(ui, repo, fname, dest=None, *'
336 visit.append(p)
336 visit.append(p)
337 else:
337 else:
338 setremoteconfig(ui, opts)
338 setremoteconfig(ui, opts)
339 dest = ui.expandpath(dest or 'default-push', dest or 'default')
339 dest, revs = cmdutil.parseurl(
340 ui.expandpath(dest or 'default-push', dest or 'default'), revs)
340 other = hg.repository(ui, dest)
341 other = hg.repository(ui, dest)
341 o = repo.findoutgoing(other, force=opts['force'])
342 o = repo.findoutgoing(other, force=opts['force'])
342
343
@@ -407,7 +408,7 b' def clone(ui, source, dest=None, **opts)'
407 about ssh:// URLs.
408 about ssh:// URLs.
408 """
409 """
409 setremoteconfig(ui, opts)
410 setremoteconfig(ui, opts)
410 hg.clone(ui, ui.expandpath(source), dest,
411 hg.clone(ui, source, dest,
411 pull=opts['pull'],
412 pull=opts['pull'],
412 stream=opts['uncompressed'],
413 stream=opts['uncompressed'],
413 rev=opts['rev'],
414 rev=opts['rev'],
@@ -1583,12 +1584,18 b' def incoming(ui, repo, source="default",'
1583
1584
1584 See pull for valid source format details.
1585 See pull for valid source format details.
1585 """
1586 """
1586 source = ui.expandpath(source)
1587 source, revs = cmdutil.parseurl(ui.expandpath(source), opts['rev'])
1587 setremoteconfig(ui, opts)
1588 setremoteconfig(ui, opts)
1588
1589
1589 other = hg.repository(ui, source)
1590 other = hg.repository(ui, source)
1590 ui.status(_('comparing with %s\n') % source)
1591 ui.status(_('comparing with %s\n') % source)
1591 incoming = repo.findincoming(other, force=opts["force"])
1592 if revs:
1593 if 'lookup' in other.capabilities:
1594 revs = [other.lookup(rev) for rev in revs]
1595 else:
1596 error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.")
1597 raise util.Abort(error)
1598 incoming = repo.findincoming(other, heads=revs, force=opts["force"])
1592 if not incoming:
1599 if not incoming:
1593 try:
1600 try:
1594 os.unlink(opts["bundle"])
1601 os.unlink(opts["bundle"])
@@ -1602,7 +1609,12 b' def incoming(ui, repo, source="default",'
1602 fname = opts["bundle"]
1609 fname = opts["bundle"]
1603 if fname or not other.local():
1610 if fname or not other.local():
1604 # create a bundle (uncompressed if other repo is not local)
1611 # create a bundle (uncompressed if other repo is not local)
1605 cg = other.changegroup(incoming, "incoming")
1612 if revs is None:
1613 cg = other.changegroup(incoming, "incoming")
1614 else:
1615 if 'changegroupsubset' not in other.capabilities:
1616 raise util.Abort(_("Partial incoming cannot be done because other repository doesn't support changegroupsubset."))
1617 cg = other.changegroupsubset(incoming, revs, 'incoming')
1606 bundletype = other.local() and "HG10BZ" or "HG10UN"
1618 bundletype = other.local() and "HG10BZ" or "HG10UN"
1607 fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
1619 fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
1608 # keep written bundle?
1620 # keep written bundle?
@@ -1612,9 +1624,6 b' def incoming(ui, repo, source="default",'
1612 # use the created uncompressed bundlerepo
1624 # use the created uncompressed bundlerepo
1613 other = bundlerepo.bundlerepository(ui, repo.root, fname)
1625 other = bundlerepo.bundlerepository(ui, repo.root, fname)
1614
1626
1615 revs = None
1616 if opts['rev']:
1617 revs = [other.lookup(rev) for rev in opts['rev']]
1618 o = other.changelog.nodesbetween(incoming, revs)[0]
1627 o = other.changelog.nodesbetween(incoming, revs)[0]
1619 if opts['newest_first']:
1628 if opts['newest_first']:
1620 o.reverse()
1629 o.reverse()
@@ -1877,11 +1886,11 b' def outgoing(ui, repo, dest=None, **opts'
1877
1886
1878 See pull for valid destination format details.
1887 See pull for valid destination format details.
1879 """
1888 """
1880 dest = ui.expandpath(dest or 'default-push', dest or 'default')
1889 dest, revs = cmdutil.parseurl(
1890 ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev'])
1881 setremoteconfig(ui, opts)
1891 setremoteconfig(ui, opts)
1882 revs = None
1892 if revs:
1883 if opts['rev']:
1893 revs = [repo.lookup(rev) for rev in revs]
1884 revs = [repo.lookup(rev) for rev in opts['rev']]
1885
1894
1886 other = hg.repository(ui, dest)
1895 other = hg.repository(ui, dest)
1887 ui.status(_('comparing with %s\n') % dest)
1896 ui.status(_('comparing with %s\n') % dest)
@@ -1975,6 +1984,9 b' def pull(ui, repo, source="default", **o'
1975 allows access to a Mercurial repository where you simply use a web
1984 allows access to a Mercurial repository where you simply use a web
1976 server to publish the .hg directory as static content.
1985 server to publish the .hg directory as static content.
1977
1986
1987 An optional identifier after # indicates a particular branch, tag,
1988 or changeset to pull.
1989
1978 Some notes about using SSH with Mercurial:
1990 Some notes about using SSH with Mercurial:
1979 - SSH requires an accessible shell account on the destination machine
1991 - SSH requires an accessible shell account on the destination machine
1980 and a copy of hg in the remote path or specified with as remotecmd.
1992 and a copy of hg in the remote path or specified with as remotecmd.
@@ -1990,18 +2002,18 b' def pull(ui, repo, source="default", **o'
1990 Alternatively specify "ssh -C" as your ssh command in your hgrc or
2002 Alternatively specify "ssh -C" as your ssh command in your hgrc or
1991 with the --ssh command line option.
2003 with the --ssh command line option.
1992 """
2004 """
1993 source = ui.expandpath(source)
2005 source, revs = cmdutil.parseurl(ui.expandpath(source), opts['rev'])
1994 setremoteconfig(ui, opts)
2006 setremoteconfig(ui, opts)
1995
2007
1996 other = hg.repository(ui, source)
2008 other = hg.repository(ui, source)
1997 ui.status(_('pulling from %s\n') % (source))
2009 ui.status(_('pulling from %s\n') % (source))
1998 revs = None
2010 if revs:
1999 if opts['rev']:
2000 if 'lookup' in other.capabilities:
2011 if 'lookup' in other.capabilities:
2001 revs = [other.lookup(rev) for rev in opts['rev']]
2012 revs = [other.lookup(rev) for rev in revs]
2002 else:
2013 else:
2003 error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.")
2014 error = _("Other repository doesn't support revision lookup, so a rev cannot be specified.")
2004 raise util.Abort(error)
2015 raise util.Abort(error)
2016
2005 modheads = repo.pull(other, heads=revs, force=opts['force'])
2017 modheads = repo.pull(other, heads=revs, force=opts['force'])
2006 return postincoming(ui, repo, modheads, opts['update'])
2018 return postincoming(ui, repo, modheads, opts['update'])
2007
2019
@@ -2026,20 +2038,23 b' def push(ui, repo, dest=None, **opts):'
2026 http://[user@]host[:port]/[path]
2038 http://[user@]host[:port]/[path]
2027 https://[user@]host[:port]/[path]
2039 https://[user@]host[:port]/[path]
2028
2040
2041 An optional identifier after # indicates a particular branch, tag,
2042 or changeset to push.
2043
2029 Look at the help text for the pull command for important details
2044 Look at the help text for the pull command for important details
2030 about ssh:// URLs.
2045 about ssh:// URLs.
2031
2046
2032 Pushing to http:// and https:// URLs is only possible, if this
2047 Pushing to http:// and https:// URLs is only possible, if this
2033 feature is explicitly enabled on the remote Mercurial server.
2048 feature is explicitly enabled on the remote Mercurial server.
2034 """
2049 """
2035 dest = ui.expandpath(dest or 'default-push', dest or 'default')
2050 dest, revs = cmdutil.parseurl(
2051 ui.expandpath(dest or 'default-push', dest or 'default'), opts['rev'])
2036 setremoteconfig(ui, opts)
2052 setremoteconfig(ui, opts)
2037
2053
2038 other = hg.repository(ui, dest)
2054 other = hg.repository(ui, dest)
2039 ui.status('pushing to %s\n' % (dest))
2055 ui.status('pushing to %s\n' % (dest))
2040 revs = None
2056 if revs:
2041 if opts['rev']:
2057 revs = [repo.lookup(rev) for rev in revs]
2042 revs = [repo.lookup(rev) for rev in opts['rev']]
2043 r = repo.push(other, opts['force'], revs=revs)
2058 r = repo.push(other, opts['force'], revs=revs)
2044 return r == 0
2059 return r == 0
2045
2060
@@ -10,7 +10,7 b' from node import *'
10 from repo import *
10 from repo import *
11 from i18n import _
11 from i18n import _
12 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
12 import localrepo, bundlerepo, httprepo, sshrepo, statichttprepo
13 import errno, lock, os, shutil, util
13 import errno, lock, os, shutil, util, cmdutil
14 import merge as _merge
14 import merge as _merge
15 import verify as _verify
15 import verify as _verify
16
16
@@ -97,6 +97,10 b' def clone(ui, source, dest=None, pull=Fa'
97 update: update working directory after clone completes, if
97 update: update working directory after clone completes, if
98 destination is local repository
98 destination is local repository
99 """
99 """
100
101 origsource = source
102 source, rev = cmdutil.parseurl(ui.expandpath(source), rev)
103
100 if isinstance(source, str):
104 if isinstance(source, str):
101 src_repo = repository(ui, source)
105 src_repo = repository(ui, source)
102 else:
106 else:
@@ -134,10 +138,10 b' def clone(ui, source, dest=None, pull=Fa'
134 if islocal(dest):
138 if islocal(dest):
135 dir_cleanup = DirCleanup(dest)
139 dir_cleanup = DirCleanup(dest)
136
140
137 abspath = source
141 abspath = origsource
138 copy = False
142 copy = False
139 if src_repo.local() and islocal(dest):
143 if src_repo.local() and islocal(dest):
140 abspath = os.path.abspath(source)
144 abspath = os.path.abspath(origsource)
141 copy = not pull and not rev
145 copy = not pull and not rev
142
146
143 src_lock, dest_lock = None, None
147 src_lock, dest_lock = None, None
@@ -218,7 +222,11 b' def clone(ui, source, dest=None, pull=Fa'
218 dest_lock.release()
222 dest_lock.release()
219
223
220 if update:
224 if update:
221 _update(dest_repo, dest_repo.changelog.tip())
225 try:
226 checkout = dest_repo.lookup("default")
227 except:
228 checkout = dest_repo.changelog.tip()
229 _update(dest_repo, checkout)
222 if dir_cleanup:
230 if dir_cleanup:
223 dir_cleanup.close()
231 dir_cleanup.close()
224
232
@@ -60,3 +60,19 b' def style_map(templatepath, style):'
60 return mapfile
60 return mapfile
61 raise RuntimeError("No hgweb templates found in %r" % templatepath)
61 raise RuntimeError("No hgweb templates found in %r" % templatepath)
62
62
63 def paritygen(stripecount, offset=0):
64 """count parity of horizontal stripes for easier reading"""
65 if stripecount and offset:
66 # account for offset, e.g. due to building the list in reverse
67 count = (stripecount + offset) % stripecount
68 parity = (stripecount + offset) / stripecount & 1
69 else:
70 count = 0
71 parity = 0
72 while True:
73 yield parity
74 count += 1
75 if stripecount and count >= stripecount:
76 parity = 1 - parity
77 count = 0
78
@@ -12,7 +12,7 b' from mercurial.node import *'
12 from mercurial.i18n import gettext as _
12 from mercurial.i18n import gettext as _
13 from mercurial import mdiff, ui, hg, util, archival, streamclone, patch
13 from mercurial import mdiff, ui, hg, util, archival, streamclone, patch
14 from mercurial import revlog, templater
14 from mercurial import revlog, templater
15 from common import get_mtime, staticfile, style_map
15 from common import get_mtime, staticfile, style_map, paritygen
16
16
17 def _up(p):
17 def _up(p):
18 if p[0] != "/":
18 if p[0] != "/":
@@ -147,14 +147,13 b' class hgweb(object):'
147 l += [x for x in files if x.startswith(t)]
147 l += [x for x in files if x.startswith(t)]
148 return l
148 return l
149
149
150 parity = [0]
150 parity = paritygen(self.stripecount)
151 def diffblock(diff, f, fn):
151 def diffblock(diff, f, fn):
152 yield self.t("diffblock",
152 yield self.t("diffblock",
153 lines=prettyprintlines(diff),
153 lines=prettyprintlines(diff),
154 parity=parity[0],
154 parity=parity.next(),
155 file=f,
155 file=f,
156 filenode=hex(fn or nullid))
156 filenode=hex(fn or nullid))
157 parity[0] = 1 - parity[0]
158
157
159 def prettyprintlines(diff):
158 def prettyprintlines(diff):
160 for l in diff.splitlines(1):
159 for l in diff.splitlines(1):
@@ -197,14 +196,13 b' class hgweb(object):'
197
196
198 def changelog(self, ctx, shortlog=False):
197 def changelog(self, ctx, shortlog=False):
199 def changelist(**map):
198 def changelist(**map):
200 parity = (start - end) & 1
201 cl = self.repo.changelog
199 cl = self.repo.changelog
202 l = [] # build a list in forward order for efficiency
200 l = [] # build a list in forward order for efficiency
203 for i in xrange(start, end):
201 for i in xrange(start, end):
204 ctx = self.repo.changectx(i)
202 ctx = self.repo.changectx(i)
205 n = ctx.node()
203 n = ctx.node()
206
204
207 l.insert(0, {"parity": parity,
205 l.insert(0, {"parity": parity.next(),
208 "author": ctx.user(),
206 "author": ctx.user(),
209 "parent": self.siblings(ctx.parents(), i - 1),
207 "parent": self.siblings(ctx.parents(), i - 1),
210 "child": self.siblings(ctx.children(), i + 1),
208 "child": self.siblings(ctx.children(), i + 1),
@@ -214,7 +212,6 b' class hgweb(object):'
214 "files": self.listfilediffs(ctx.files(), n),
212 "files": self.listfilediffs(ctx.files(), n),
215 "rev": i,
213 "rev": i,
216 "node": hex(n)})
214 "node": hex(n)})
217 parity = 1 - parity
218
215
219 for e in l:
216 for e in l:
220 yield e
217 yield e
@@ -226,6 +223,7 b' class hgweb(object):'
226 start = max(0, pos - maxchanges + 1)
223 start = max(0, pos - maxchanges + 1)
227 end = min(count, start + maxchanges)
224 end = min(count, start + maxchanges)
228 pos = end - 1
225 pos = end - 1
226 parity = paritygen(self.stripecount, offset=start-end)
229
227
230 changenav = revnavgen(pos, maxchanges, count, self.repo.changectx)
228 changenav = revnavgen(pos, maxchanges, count, self.repo.changectx)
231
229
@@ -267,7 +265,7 b' class hgweb(object):'
267 n = ctx.node()
265 n = ctx.node()
268
266
269 yield self.t('searchentry',
267 yield self.t('searchentry',
270 parity=self.stripes(count),
268 parity=parity.next(),
271 author=ctx.user(),
269 author=ctx.user(),
272 parent=self.siblings(ctx.parents()),
270 parent=self.siblings(ctx.parents()),
273 child=self.siblings(ctx.children()),
271 child=self.siblings(ctx.children()),
@@ -282,11 +280,13 b' class hgweb(object):'
282 break
280 break
283
281
284 cl = self.repo.changelog
282 cl = self.repo.changelog
283 parity = paritygen(self.stripecount)
285
284
286 yield self.t('search',
285 yield self.t('search',
287 query=query,
286 query=query,
288 node=hex(cl.tip()),
287 node=hex(cl.tip()),
289 entries=changelist)
288 entries=changelist,
289 archives=self.archivelist("tip"))
290
290
291 def changeset(self, ctx):
291 def changeset(self, ctx):
292 n = ctx.node()
292 n = ctx.node()
@@ -294,12 +294,11 b' class hgweb(object):'
294 p1 = parents[0].node()
294 p1 = parents[0].node()
295
295
296 files = []
296 files = []
297 parity = 0
297 parity = paritygen(self.stripecount)
298 for f in ctx.files():
298 for f in ctx.files():
299 files.append(self.t("filenodelink",
299 files.append(self.t("filenodelink",
300 node=hex(n), file=f,
300 node=hex(n), file=f,
301 parity=parity))
301 parity=parity.next()))
302 parity = 1 - parity
303
302
304 def diff(**map):
303 def diff(**map):
305 yield self.diff(p1, n, None)
304 yield self.diff(p1, n, None)
@@ -326,16 +325,16 b' class hgweb(object):'
326 start = max(0, pos - pagelen + 1)
325 start = max(0, pos - pagelen + 1)
327 end = min(count, start + pagelen)
326 end = min(count, start + pagelen)
328 pos = end - 1
327 pos = end - 1
328 parity = paritygen(self.stripecount, offset=start-end)
329
329
330 def entries(**map):
330 def entries(**map):
331 l = []
331 l = []
332 parity = (count - 1) & 1
333
332
334 for i in xrange(start, end):
333 for i in xrange(start, end):
335 ctx = fctx.filectx(i)
334 ctx = fctx.filectx(i)
336 n = fl.node(i)
335 n = fl.node(i)
337
336
338 l.insert(0, {"parity": parity,
337 l.insert(0, {"parity": parity.next(),
339 "filerev": i,
338 "filerev": i,
340 "file": f,
339 "file": f,
341 "node": hex(ctx.node()),
340 "node": hex(ctx.node()),
@@ -345,7 +344,6 b' class hgweb(object):'
345 "parent": self.siblings(fctx.parents()),
344 "parent": self.siblings(fctx.parents()),
346 "child": self.siblings(fctx.children()),
345 "child": self.siblings(fctx.children()),
347 "desc": ctx.description()})
346 "desc": ctx.description()})
348 parity = 1 - parity
349
347
350 for e in l:
348 for e in l:
351 yield e
349 yield e
@@ -360,6 +358,7 b' class hgweb(object):'
360 text = fctx.data()
358 text = fctx.data()
361 fl = fctx.filelog()
359 fl = fctx.filelog()
362 n = fctx.filenode()
360 n = fctx.filenode()
361 parity = paritygen(self.stripecount)
363
362
364 mt = mimetypes.guess_type(f)[0]
363 mt = mimetypes.guess_type(f)[0]
365 rawtext = text
364 rawtext = text
@@ -372,7 +371,7 b' class hgweb(object):'
372 for l, t in enumerate(text.splitlines(1)):
371 for l, t in enumerate(text.splitlines(1)):
373 yield {"line": t,
372 yield {"line": t,
374 "linenumber": "% 6d" % (l + 1),
373 "linenumber": "% 6d" % (l + 1),
375 "parity": self.stripes(l)}
374 "parity": parity.next()}
376
375
377 yield self.t("filerevision",
376 yield self.t("filerevision",
378 file=f,
377 file=f,
@@ -394,19 +393,18 b' class hgweb(object):'
394 f = fctx.path()
393 f = fctx.path()
395 n = fctx.filenode()
394 n = fctx.filenode()
396 fl = fctx.filelog()
395 fl = fctx.filelog()
396 parity = paritygen(self.stripecount)
397
397
398 def annotate(**map):
398 def annotate(**map):
399 parity = 0
400 last = None
399 last = None
401 for f, l in fctx.annotate(follow=True):
400 for f, l in fctx.annotate(follow=True):
402 fnode = f.filenode()
401 fnode = f.filenode()
403 name = self.repo.ui.shortuser(f.user())
402 name = self.repo.ui.shortuser(f.user())
404
403
405 if last != fnode:
404 if last != fnode:
406 parity = 1 - parity
407 last = fnode
405 last = fnode
408
406
409 yield {"parity": parity,
407 yield {"parity": parity.next(),
410 "node": hex(f.node()),
408 "node": hex(f.node()),
411 "rev": f.rev(),
409 "rev": f.rev(),
412 "author": name,
410 "author": name,
@@ -432,6 +430,7 b' class hgweb(object):'
432 node = ctx.node()
430 node = ctx.node()
433
431
434 files = {}
432 files = {}
433 parity = paritygen(self.stripecount)
435
434
436 if path and path[-1] != "/":
435 if path and path[-1] != "/":
437 path += "/"
436 path += "/"
@@ -450,7 +449,6 b' class hgweb(object):'
450 files[short] = (f, n)
449 files[short] = (f, n)
451
450
452 def filelist(**map):
451 def filelist(**map):
453 parity = 0
454 fl = files.keys()
452 fl = files.keys()
455 fl.sort()
453 fl.sort()
456 for f in fl:
454 for f in fl:
@@ -459,14 +457,12 b' class hgweb(object):'
459 continue
457 continue
460
458
461 yield {"file": full,
459 yield {"file": full,
462 "parity": self.stripes(parity),
460 "parity": parity.next(),
463 "basename": f,
461 "basename": f,
464 "size": ctx.filectx(full).size(),
462 "size": ctx.filectx(full).size(),
465 "permissions": mf.execf(full)}
463 "permissions": mf.execf(full)}
466 parity += 1
467
464
468 def dirlist(**map):
465 def dirlist(**map):
469 parity = 0
470 fl = files.keys()
466 fl = files.keys()
471 fl.sort()
467 fl.sort()
472 for f in fl:
468 for f in fl:
@@ -474,16 +470,16 b' class hgweb(object):'
474 if fnode:
470 if fnode:
475 continue
471 continue
476
472
477 yield {"parity": self.stripes(parity),
473 yield {"parity": parity.next(),
478 "path": os.path.join(abspath, f),
474 "path": os.path.join(abspath, f),
479 "basename": f[:-1]}
475 "basename": f[:-1]}
480 parity += 1
481
476
482 yield self.t("manifest",
477 yield self.t("manifest",
483 rev=ctx.rev(),
478 rev=ctx.rev(),
484 node=hex(node),
479 node=hex(node),
485 path=abspath,
480 path=abspath,
486 up=_up(abspath),
481 up=_up(abspath),
482 upparity=parity.next(),
487 fentries=filelist,
483 fentries=filelist,
488 dentries=dirlist,
484 dentries=dirlist,
489 archives=self.archivelist(hex(node)))
485 archives=self.archivelist(hex(node)))
@@ -491,17 +487,16 b' class hgweb(object):'
491 def tags(self):
487 def tags(self):
492 i = self.repo.tagslist()
488 i = self.repo.tagslist()
493 i.reverse()
489 i.reverse()
490 parity = paritygen(self.stripecount)
494
491
495 def entries(notip=False, **map):
492 def entries(notip=False, **map):
496 parity = 0
497 for k, n in i:
493 for k, n in i:
498 if notip and k == "tip":
494 if notip and k == "tip":
499 continue
495 continue
500 yield {"parity": self.stripes(parity),
496 yield {"parity": parity.next(),
501 "tag": k,
497 "tag": k,
502 "date": self.repo.changectx(n).date(),
498 "date": self.repo.changectx(n).date(),
503 "node": hex(n)}
499 "node": hex(n)}
504 parity += 1
505
500
506 yield self.t("tags",
501 yield self.t("tags",
507 node=hex(self.repo.changelog.tip()),
502 node=hex(self.repo.changelog.tip()),
@@ -513,7 +508,7 b' class hgweb(object):'
513 i.reverse()
508 i.reverse()
514
509
515 def tagentries(**map):
510 def tagentries(**map):
516 parity = 0
511 parity = paritygen(self.stripecount)
517 count = 0
512 count = 0
518 for k, n in i:
513 for k, n in i:
519 if k == "tip": # skip tip
514 if k == "tip": # skip tip
@@ -524,15 +519,14 b' class hgweb(object):'
524 break;
519 break;
525
520
526 yield self.t("tagentry",
521 yield self.t("tagentry",
527 parity=self.stripes(parity),
522 parity=parity.next(),
528 tag=k,
523 tag=k,
529 node=hex(n),
524 node=hex(n),
530 date=self.repo.changectx(n).date())
525 date=self.repo.changectx(n).date())
531 parity += 1
532
526
533
527
534 def branches(**map):
528 def branches(**map):
535 parity = 0
529 parity = paritygen(self.stripecount)
536
530
537 b = self.repo.branchtags()
531 b = self.repo.branchtags()
538 l = [(-self.repo.changelog.rev(n), n, t) for t, n in b.items()]
532 l = [(-self.repo.changelog.rev(n), n, t) for t, n in b.items()]
@@ -541,14 +535,13 b' class hgweb(object):'
541 for r,n,t in l:
535 for r,n,t in l:
542 ctx = self.repo.changectx(n)
536 ctx = self.repo.changectx(n)
543
537
544 yield {'parity': self.stripes(parity),
538 yield {'parity': parity.next(),
545 'branch': t,
539 'branch': t,
546 'node': hex(n),
540 'node': hex(n),
547 'date': ctx.date()}
541 'date': ctx.date()}
548 parity += 1
549
542
550 def changelist(**map):
543 def changelist(**map):
551 parity = 0
544 parity = paritygen(self.stripecount, offset=start-end)
552 l = [] # build a list in forward order for efficiency
545 l = [] # build a list in forward order for efficiency
553 for i in xrange(start, end):
546 for i in xrange(start, end):
554 ctx = self.repo.changectx(i)
547 ctx = self.repo.changectx(i)
@@ -556,13 +549,12 b' class hgweb(object):'
556
549
557 l.insert(0, self.t(
550 l.insert(0, self.t(
558 'shortlogentry',
551 'shortlogentry',
559 parity=parity,
552 parity=parity.next(),
560 author=ctx.user(),
553 author=ctx.user(),
561 desc=ctx.description(),
554 desc=ctx.description(),
562 date=ctx.date(),
555 date=ctx.date(),
563 rev=i,
556 rev=i,
564 node=hn))
557 node=hn))
565 parity = 1 - parity
566
558
567 yield l
559 yield l
568
560
@@ -845,13 +837,6 b' class hgweb(object):'
845
837
846 return fctx
838 return fctx
847
839
848 def stripes(self, parity):
849 "make horizontal stripes for easier reading"
850 if self.stripecount:
851 return (1 + parity / self.stripecount) & 1
852 else:
853 return 0
854
855 def do_log(self, req):
840 def do_log(self, req):
856 if req.form.has_key('file') and req.form['file'][0]:
841 if req.form.has_key('file') and req.form['file'][0]:
857 self.do_filelog(req)
842 self.do_filelog(req)
@@ -10,7 +10,7 b' from mercurial import demandimport; dema'
10 import os, mimetools, cStringIO
10 import os, mimetools, cStringIO
11 from mercurial.i18n import gettext as _
11 from mercurial.i18n import gettext as _
12 from mercurial import ui, hg, util, templater
12 from mercurial import ui, hg, util, templater
13 from common import get_mtime, staticfile, style_map
13 from common import get_mtime, staticfile, style_map, paritygen
14 from hgweb_mod import hgweb
14 from hgweb_mod import hgweb
15
15
16 # This is a stopgap
16 # This is a stopgap
@@ -22,6 +22,7 b' class hgwebdir(object):'
22 self.parentui = parentui
22 self.parentui = parentui
23 self.motd = None
23 self.motd = None
24 self.style = None
24 self.style = None
25 self.stripecount = None
25 self.repos_sorted = ('name', False)
26 self.repos_sorted = ('name', False)
26 if isinstance(config, (list, tuple)):
27 if isinstance(config, (list, tuple)):
27 self.repos = cleannames(config)
28 self.repos = cleannames(config)
@@ -41,6 +42,8 b' class hgwebdir(object):'
41 self.motd = cp.get('web', 'motd')
42 self.motd = cp.get('web', 'motd')
42 if cp.has_option('web', 'style'):
43 if cp.has_option('web', 'style'):
43 self.style = cp.get('web', 'style')
44 self.style = cp.get('web', 'style')
45 if cp.has_option('web', 'stripes'):
46 self.stripecount = int(cp.get('web', 'stripes'))
44 if cp.has_section('paths'):
47 if cp.has_section('paths'):
45 self.repos.extend(cleannames(cp.items('paths')))
48 self.repos.extend(cleannames(cp.items('paths')))
46 if cp.has_section('collections'):
49 if cp.has_section('collections'):
@@ -97,6 +100,8 b' class hgwebdir(object):'
97 style = config('web', 'style', '')
100 style = config('web', 'style', '')
98 if req.form.has_key('style'):
101 if req.form.has_key('style'):
99 style = req.form['style'][0]
102 style = req.form['style'][0]
103 if self.stripecount is None:
104 self.stripecount = int(config('web', 'stripes', 1))
100 mapfile = style_map(templater.templatepath(), style)
105 mapfile = style_map(templater.templatepath(), style)
101 tmpl = templater.templater(mapfile, templater.common_filters,
106 tmpl = templater.templater(mapfile, templater.common_filters,
102 defaults={"header": header,
107 defaults={"header": header,
@@ -127,7 +132,7 b' class hgwebdir(object):'
127 separator = ';'
132 separator = ';'
128
133
129 rows = []
134 rows = []
130 parity = 0
135 parity = paritygen(self.stripecount)
131 for name, path in self.repos:
136 for name, path in self.repos:
132 u = ui.ui(parentui=parentui)
137 u = ui.ui(parentui=parentui)
133 try:
138 try:
@@ -165,8 +170,7 b' class hgwebdir(object):'
165 if (not sortcolumn
170 if (not sortcolumn
166 or (sortcolumn, descending) == self.repos_sorted):
171 or (sortcolumn, descending) == self.repos_sorted):
167 # fast path for unsorted output
172 # fast path for unsorted output
168 row['parity'] = parity
173 row['parity'] = parity.next()
169 parity = 1 - parity
170 yield row
174 yield row
171 else:
175 else:
172 rows.append((row["%s_sort" % sortcolumn], row))
176 rows.append((row["%s_sort" % sortcolumn], row))
@@ -175,8 +179,7 b' class hgwebdir(object):'
175 if descending:
179 if descending:
176 rows.reverse()
180 rows.reverse()
177 for key, row in rows:
181 for key, row in rows:
178 row['parity'] = parity
182 row['parity'] = parity.next()
179 parity = 1 - parity
180 yield row
183 yield row
181
184
182 try:
185 try:
@@ -1006,6 +1006,12 b' class localrepository(repo.repository):'
1006 for f in list:
1006 for f in list:
1007 p = self.wjoin(f)
1007 p = self.wjoin(f)
1008 islink = os.path.islink(p)
1008 islink = os.path.islink(p)
1009 size = os.lstat(p).st_size
1010 if size > 10000000:
1011 self.ui.warn(_("%s: files over 10MB may cause memory and"
1012 " performance problems\n"
1013 "(use 'hg revert %s' to unadd the file)\n")
1014 % (f, f))
1009 if not islink and not os.path.exists(p):
1015 if not islink and not os.path.exists(p):
1010 self.ui.warn(_("%s does not exist!\n") % f)
1016 self.ui.warn(_("%s does not exist!\n") % f)
1011 elif not islink and not os.path.isfile(p):
1017 elif not islink and not os.path.isfile(p):
@@ -18,7 +18,7 b''
18 </div>
18 </div>
19
19
20 <div class="page_nav">
20 <div class="page_nav">
21 <a href="{url}summary{sessionvars%urlparameter}">summary</a> | <a href="{url}shortlog/#rev#{sessionvars%urlparameter}">shortlog</a> | changelog | <a href="{url}tags{sessionvars%urlparameter}">tags</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a>#archives%archiveentry#<br/>
21 <a href="{url}summary{sessionvars%urlparameter}">summary</a> | <a href="{url}shortlog/#rev#{sessionvars%urlparameter}">shortlog</a> | changelog | <a href="{url}tags{sessionvars%urlparameter}">tags</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a>#archives%archiveentry#
22 <br/>
22 <br/>
23 #changenav%naventry#<br/>
23 #changenav%naventry#<br/>
24 </div>
24 </div>
@@ -21,7 +21,6 b''
21 <tr><td>author</td><td>#author|obfuscate#</td></tr>
21 <tr><td>author</td><td>#author|obfuscate#</td></tr>
22 <tr><td></td><td>#date|date# (#date|age# ago)</td></tr>
22 <tr><td></td><td>#date|date# (#date|age# ago)</td></tr>
23 <tr><td>changeset {rev}</td><td style="font-family:monospace">{node|short}</td></tr>
23 <tr><td>changeset {rev}</td><td style="font-family:monospace">{node|short}</td></tr>
24 <tr><td>manifest</td><td style="font-family:monospace"><a class="list" href="{url}file/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>
25 #parent%changesetparent#
24 #parent%changesetparent#
26 #child%changesetchild#
25 #child%changesetchild#
27 #changesettag#
26 #changesettag#
@@ -26,24 +26,21 b' annotate |'
26 <div class="title">#file|escape#</div>
26 <div class="title">#file|escape#</div>
27
27
28 <div class="title_text">
28 <div class="title_text">
29 <table>
29 <table cellspacing="0">
30 <tr>
31 <td>author</td>
32 <td>#author|obfuscate#</td></tr>
30 <tr>
33 <tr>
31 <td class="metatag">changeset #rev#:</td>
34 <td></td>
32 <td><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>
35 <td>#date|date# (#date|age# ago)</td></tr>
36 <tr>
37 <td>changeset {rev}</td>
38 <td style="font-family:monospace"><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>
33 #parent%fileannotateparent#
39 #parent%fileannotateparent#
34 #child%fileannotatechild#
40 #child%fileannotatechild#
35 <tr>
41 <tr>
36 <td class="metatag">manifest:</td>
42 <td>permissions</td>
37 <td><a href="{url}file/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>
43 <td style="font-family:monospace">#permissions|permissions#</td></tr>
38 <tr>
39 <td class="metatag">author:</td>
40 <td>#author|obfuscate#</td></tr>
41 <tr>
42 <td class="metatag">date:</td>
43 <td>#date|date# (#date|age# ago)</td></tr>
44 <tr>
45 <td class="metatag">permissions:</td>
46 <td>#permissions|permissions#</td></tr>
47 </table>
44 </table>
48 </div>
45 </div>
49
46
@@ -6,7 +6,7 b''
6 <body>
6 <body>
7
7
8 <div class="page_header">
8 <div class="page_header">
9 <a href="http://www.selenic.com/mercurial/" title="Mercurial"><div style="float:right;">Mercurial</div></a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / annotate
9 <a href="http://www.selenic.com/mercurial/" title="Mercurial"><div style="float:right;">Mercurial</div></a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / diff
10 </div>
10 </div>
11
11
12 <div class="page_nav">
12 <div class="page_nav">
@@ -27,21 +27,16 b' diff |'
27
27
28 <table>
28 <table>
29 <tr>
29 <tr>
30 <td class="metatag">changeset {rev}:</td>
30 <td>changeset {rev}</td>
31 <td><a href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
31 <td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
32 </tr>
33 {parent%filediffparent}
32 {parent%filediffparent}
34 {child%filediffchild}
33 {child%filediffchild}
35 <tr>
36 <td class="metatag">manifest:</td>
37 <td><a href="{url}file/{node|short}{sessionvars%urlparameter}">{node|short}</a></td>
38 </tr>
39 </table>
34 </table>
40
35
36 <div class="list_head"></div>
37
41 <div class="page_body">
38 <div class="page_body">
42 <table>
43 {diff}
39 {diff}
44 </table>
45 </div>
40 </div>
46
41
47 {footer}
42 {footer}
@@ -18,10 +18,9 b''
18 revisions |
18 revisions |
19 <a href="{url}annotate/{node|short}/#file|urlescape#{sessionvars%urlparameter}">annotate</a> |
19 <a href="{url}annotate/{node|short}/#file|urlescape#{sessionvars%urlparameter}">annotate</a> |
20 <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
20 <a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a> |
21 <a href="{url}rss-log/#node|short#/#file|urlescape#">rss</a><br/>
21 <a href="{url}rss-log/#node|short#/#file|urlescape#">rss</a>
22
23 <br/>
22 <br/>
24 {nav%filenaventry}<br/>
23 {nav%filenaventry}
25 </div>
24 </div>
26
25
27 <div class="title" >#file|urlescape#</div>
26 <div class="title" >#file|urlescape#</div>
@@ -30,4 +29,8 b' revisions |'
30 #entries%filelogentry#
29 #entries%filelogentry#
31 </table>
30 </table>
32
31
32 <div class="page_nav">
33 {nav%filenaventry}
34 </div>
35
33 #footer#
36 #footer#
@@ -26,24 +26,21 b' file |'
26 <div class="title">#file|escape#</div>
26 <div class="title">#file|escape#</div>
27
27
28 <div class="title_text">
28 <div class="title_text">
29 <table>
29 <table cellspacing="0">
30 <tr>
31 <td>author</td>
32 <td>#author|obfuscate#</td></tr>
30 <tr>
33 <tr>
31 <td class="metatag">changeset #rev#:</td>
34 <td></td>
32 <td><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>
35 <td>#date|date# (#date|age# ago)</td></tr>
36 <tr>
37 <td>changeset {rev}</td>
38 <td style="font-family:monospace"><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>
33 #parent%filerevparent#
39 #parent%filerevparent#
34 #child%filerevchild#
40 #child%filerevchild#
35 <tr>
41 <tr>
36 <td class="metatag">manifest:</td>
42 <td>permissions</td>
37 <td><a href="{url}file/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>
43 <td style="font-family:monospace">#permissions|permissions#</td></tr>
38 <tr>
39 <td class="metatag">author:</td>
40 <td>#author|obfuscate#</td></tr>
41 <tr>
42 <td class="metatag">date:</td>
43 <td>#date|date# (#date|age# ago)</td></tr>
44 <tr>
45 <td class="metatag">permissions:</td>
46 <td>#permissions|permissions#</td></tr>
47 </table>
44 </table>
48 </div>
45 </div>
49
46
@@ -19,9 +19,8 b' manifest |'
19 </div>
19 </div>
20
20
21 <div class="title" >#path|escape#</div>
21 <div class="title" >#path|escape#</div>
22 <div class="page_body">
23 <table cellspacing="0">
22 <table cellspacing="0">
24 <tr class="light">
23 <tr class="parity#upparity#">
25 <td style="font-family:monospace">drwxr-xr-x</td>
24 <td style="font-family:monospace">drwxr-xr-x</td>
26 <td style="font-family:monospace"></td>
25 <td style="font-family:monospace"></td>
27 <td><a href="{url}file/#node|short##up|urlescape#{sessionvars%urlparameter}">[up]</a></td>
26 <td><a href="{url}file/#node|short##up|urlescape#{sessionvars%urlparameter}">[up]</a></td>
@@ -30,4 +29,5 b' manifest |'
30 #dentries%manifestdirentry#
29 #dentries%manifestdirentry#
31 #fentries%manifestfileentry#
30 #fentries%manifestfileentry#
32 </table>
31 </table>
32
33 #footer#
33 #footer#
@@ -15,7 +15,7 b' changelogentry = changelogentry.tmpl'
15 searchentry = changelogentry.tmpl
15 searchentry = changelogentry.tmpl
16 changeset = changeset.tmpl
16 changeset = changeset.tmpl
17 manifest = manifest.tmpl
17 manifest = manifest.tmpl
18 manifestdirentry = '<tr class="parity#parity#"><td style="font-family:monospace">drwxr-xr-x</td><td style="font-family:monospace"></td><td><a href="#url#file/#node|short##path|urlescape#{sessionvars%urlparameter}">#basename|escape#/</a></td><td class="link"><a href="#url#file/#node|short##path|urlescape#{sessionvars%urlparameter}">manifest</a></td></tr>'
18 manifestdirentry = '<tr class="parity#parity#"><td style="font-family:monospace">drwxr-xr-x</td><td style="font-family:monospace"></td><td><a href="#url#file/#node|short##path|urlescape#{sessionvars%urlparameter}">#basename|escape#</a></td><td class="link"><a href="#url#file/#node|short##path|urlescape#{sessionvars%urlparameter}">manifest</a></td></tr>'
19 manifestfileentry = '<tr class="parity#parity#"><td style="font-family:monospace">#permissions|permissions#</td><td style="font-family:monospace" align=right>#size#</td><td class="list"><a class="list" href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#basename|escape#</a></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="#url#log/#node|short#/#file|urlescape#{sessionvars%urlparameter}">revisions</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a></td></tr>'
19 manifestfileentry = '<tr class="parity#parity#"><td style="font-family:monospace">#permissions|permissions#</td><td style="font-family:monospace" align=right>#size#</td><td class="list"><a class="list" href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">#basename|escape#</a></td><td class="link"><a href="#url#file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a> | <a href="#url#log/#node|short#/#file|urlescape#{sessionvars%urlparameter}">revisions</a> | <a href="#url#annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a></td></tr>'
20 filerevision = filerevision.tmpl
20 filerevision = filerevision.tmpl
21 fileannotate = fileannotate.tmpl
21 fileannotate = fileannotate.tmpl
@@ -29,23 +29,23 b' difflineat = \'<div style="color:#990099;'
29 diffline = '<div>#line|escape#</div>'
29 diffline = '<div>#line|escape#</div>'
30 changelogparent = '<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="#url#rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
30 changelogparent = '<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="#url#rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
31 changesetparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
31 changesetparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
32 filerevparent = '<tr><td class="metatag">parent {rev}:</td><td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a></td></tr>'
32 filerevparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a></td></tr>'
33 filerename = '{file|escape}@'
33 filerename = '{file|escape}@'
34 filelogrename = '| <a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">base</a>'
34 filelogrename = '| <a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">base</a>'
35 fileannotateparent = '<tr><td class="metatag">parent {rev}:</td><td><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a></td></tr>'
35 fileannotateparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a></td></tr>'
36 changelogchild = '<tr><th class="child">child #rev#:</th><td class="child"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
36 changelogchild = '<tr><th class="child">child #rev#:</th><td class="child"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
37 changesetchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
37 changesetchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
38 filerevchild = '<tr><td class="metatag">child {rev}:</td><td><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
38 filerevchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
39 fileannotatechild = '<tr><td class="metatag">child {rev}:</td><td><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
39 fileannotatechild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
40 tags = tags.tmpl
40 tags = tags.tmpl
41 tagentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>#tag|escape#</b></a></td><td class="link"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/#node|short#{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>'
41 tagentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>#tag|escape#</b></a></td><td class="link"><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/#node|short#{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>'
42 branchentry = '<tr class="parity{parity}"><td class="age"><i>{date|age} ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>{node|short}</b></td><td>{branch|escape}</td><td class="link"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/{node|short}{sessionvars%urlparameter}">manifest</a></td></tr>'
42 branchentry = '<tr class="parity{parity}"><td class="age"><i>{date|age} ago</i></td><td><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}"><b>{node|short}</b></td><td>{branch|escape}</td><td class="link"><a href="{url}rev/{node|short}{sessionvars%urlparameter}">changeset</a> | <a href="{url}log/{node|short}{sessionvars%urlparameter}">changelog</a> | <a href="{url}file/{node|short}{sessionvars%urlparameter}">manifest</a></td></tr>'
43 diffblock = '<pre>#lines#</pre>'
43 diffblock = '<pre>#lines#</pre>'
44 changelogtag = '<tr><th class="tag">tag:</th><td class="tag">#tag|escape#</td></tr>'
44 changelogtag = '<tr><th class="tag">tag:</th><td class="tag">#tag|escape#</td></tr>'
45 changesettag = '<tr><td>tag</td><td>#tag|escape#</td></tr>'
45 changesettag = '<tr><td>tag</td><td>#tag|escape#</td></tr>'
46 filediffparent = '<tr><th class="parent">parent {rev}:</th><td class="parent"><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
46 filediffparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
47 filelogparent = '<tr><td align="right">parent #rev#:&nbsp;</td><td><a href="{url}file/{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
47 filelogparent = '<tr><td align="right">parent #rev#:&nbsp;</td><td><a href="{url}file/{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
48 filediffchild = '<tr><th class="child">child {rev}:</th><td class="child"><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
48 filediffchild = '<tr><td>child {rev}</td><td style="font-family:monospace"><a class="list" href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
49 filelogchild = '<tr><td align="right">child #rev#:&nbsp;</td><td><a href="{url}file{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
49 filelogchild = '<tr><td align="right">child #rev#:&nbsp;</td><td><a href="{url}file{node|short}/#file|urlescape#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
50 shortlog = shortlog.tmpl
50 shortlog = shortlog.tmpl
51 shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>'
51 shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a></td></tr>'
@@ -1,27 +1,32 b''
1 #header#
1 #header#
2 <title>#repo|escape#: Search</title>
3 <link rel="alternate" type="application/rss+xml"
4 href="{url}rss-log" title="RSS feed for #repo|escape#">
5 </head>
6 <body>
7
8 <div class="page_header">
9 <a href="http://www.selenic.com/mercurial/" title="Mercurial"><div style="float:right;">Mercurial</div></a><a href="{url}summary{sessionvars%urlparameter}">#repo|escape#</a> / search
10
11 <form action="{url}log">
12 {sessionvars%hiddenformentry}
13 <div class="search">
14 <input type="text" name="rev" value="#query|escape#" />
15 </div>
16 </form>
17 </div>
18
2 <div class="page_nav">
19 <div class="page_nav">
3 <a href="{url}summary{sessionvars%urlparameter}">summary</a> |
20 <a href="{url}summary{sessionvars%urlparameter}">summary</a> |
4 <a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
21 <a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
5 <a href="{url}log{sessionvars%urlparameter}">changelog</a> |
22 <a href="{url}log{sessionvars%urlparameter}">changelog</a> |
6 <a href="{url}tags{sessionvars%urlparameter}">tags</a> |
23 <a href="{url}tags{sessionvars%urlparameter}">tags</a> |
7 <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a><br/>
24 <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a>#archives%archiveentry#
25 <br/>
8 </div>
26 </div>
9
27
10 <h2>searching for #query|escape#</h2>
28 <div class="title">searching for #query|escape#</div>
11
12 <form action="{url}log">
13 {sessionvars%hiddenformentry}
14 search:
15 <input name="rev" type="text" width="30" value="#query|escape#">
16 </form>
17
29
18 #entries#
30 #entries#
19
31
20 <form action="{url}log">
21 {sessionvars%hiddenformentry}
22 search:
23 <input type="hidden" name="style" value="gitweb">
24 <input name="rev" type="text" width="30">
25 </form>
26
27 #footer#
32 #footer#
@@ -21,14 +21,18 b''
21 shortlog |
21 shortlog |
22 <a href="{url}log/#rev#{sessionvars%urlparameter}">changelog</a> |
22 <a href="{url}log/#rev#{sessionvars%urlparameter}">changelog</a> |
23 <a href="{url}tags{sessionvars%urlparameter}">tags</a> |
23 <a href="{url}tags{sessionvars%urlparameter}">tags</a> |
24 <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a>#archives%archiveentry#<br/>
24 <a href="{url}file/#node|short#{sessionvars%urlparameter}">manifest</a>#archives%archiveentry#
25 <br/>
25 <br/>
26
27 #changenav%navshortentry#<br/>
26 #changenav%navshortentry#<br/>
28 </div>
27 </div>
29
28
29 <div class="title">&nbsp;</div>
30 <table cellspacing="0">
30 <table cellspacing="0">
31 #entries%shortlogentry#
31 #entries%shortlogentry#
32 </table>
32 </table>
33
33
34 <div class="page_nav">
35 #changenav%navshortentry#
36 </div>
37
34 #footer#
38 #footer#
@@ -7,7 +7,15 b''
7
7
8 <div class="page_header">
8 <div class="page_header">
9 <a href="http://www.selenic.com/mercurial/" title="Mercurial"><div style="float:right;">Mercurial</div></a><a href="{url}summary{sessionvars%urlparameter}">#repo|escape#</a> / summary
9 <a href="http://www.selenic.com/mercurial/" title="Mercurial"><div style="float:right;">Mercurial</div></a><a href="{url}summary{sessionvars%urlparameter}">#repo|escape#</a> / summary
10
11 <form action="{url}log">
12 {sessionvars%hiddenformentry}
13 <div class="search">
14 <input type="text" name="rev" />
10 </div>
15 </div>
16 </form>
17 </div>
18
11 <div class="page_nav">
19 <div class="page_nav">
12 summary |
20 summary |
13 <a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
21 <a href="{url}shortlog{sessionvars%urlparameter}">shortlog</a> |
@@ -27,7 +35,7 b' summary |'
27 <div><a class="title" href="{url}log{sessionvars%urlparameter}">changes</a></div>
35 <div><a class="title" href="{url}log{sessionvars%urlparameter}">changes</a></div>
28 <table cellspacing="0">
36 <table cellspacing="0">
29 #shortlog#
37 #shortlog#
30 <tr class="light"><td colspan="3"><a class="list" href="{url}log{sessionvars%urlparameter}">...</a></td></tr>
38 <tr class="light"><td colspan="4"><a class="list" href="{url}log{sessionvars%urlparameter}">...</a></td></tr>
31 </table>
39 </table>
32
40
33 <div><a class="title" href="{url}tags{sessionvars%urlparameter}">tags</a></div>
41 <div><a class="title" href="{url}tags{sessionvars%urlparameter}">tags</a></div>
@@ -40,7 +48,7 b' summary |'
40 <table cellspacing="0">
48 <table cellspacing="0">
41 {branches%branchentry}
49 {branches%branchentry}
42 <tr class="light">
50 <tr class="light">
43 <td colspan="3"><a class="list" href="#">...</a></td>
51 <td colspan="4"><a class="list" href="#">...</a></td>
44 </tr>
52 </tr>
45 </table>
53 </table>
46 #footer#
54 #footer#
@@ -18,6 +18,7 b' tags |'
18 <br/>
18 <br/>
19 </div>
19 </div>
20
20
21 <div class="title">&nbsp;</div>
21 <table cellspacing="0">
22 <table cellspacing="0">
22 #entries%tagentry#
23 #entries%tagentry#
23 </table>
24 </table>
@@ -14,7 +14,7 b''
14 <h2>manifest for changeset #node|short#: #path|escape#</h2>
14 <h2>manifest for changeset #node|short#: #path|escape#</h2>
15
15
16 <table cellpadding="0" cellspacing="0">
16 <table cellpadding="0" cellspacing="0">
17 <tr class="parity1">
17 <tr class="parity#upparity#">
18 <td><tt>drwxr-xr-x</tt>&nbsp;
18 <td><tt>drwxr-xr-x</tt>&nbsp;
19 <td>&nbsp;
19 <td>&nbsp;
20 <td><a href="#url#file/#node|short##up|urlescape#{sessionvars%urlparameter}">[up]</a>
20 <td><a href="#url#file/#node|short##up|urlescape#{sessionvars%urlparameter}">[up]</a>
@@ -8,6 +8,7 b''
8 <a href="#url#shortlog{sessionvars%urlparameter}">shortlog</a>
8 <a href="#url#shortlog{sessionvars%urlparameter}">shortlog</a>
9 <a href="#url#tags{sessionvars%urlparameter}">tags</a>
9 <a href="#url#tags{sessionvars%urlparameter}">tags</a>
10 <a href="#url#file/#node|short#{sessionvars%urlparameter}">manifest</a>
10 <a href="#url#file/#node|short#{sessionvars%urlparameter}">manifest</a>
11 #archives%archiveentry#
11 </div>
12 </div>
12
13
13 <h2>searching for #query|escape#</h2>
14 <h2>searching for #query|escape#</h2>
@@ -22,5 +22,5 b' hg commit -Ama'
22 mv a b
22 mv a b
23 rm c
23 rm c
24 echo d > d
24 echo d > d
25 hg addremove -s 0.5
25 hg addremove -s 50
26 hg commit -mb
26 hg commit -mb
@@ -16,6 +16,12 b' hg addremove -s50'
16
16
17 hg commit -m B
17 hg commit -m B
18
18
19 echo % comparing two empty files caused ZeroDivisionError in the past
20 hg update -C 0
21 rm empty-file
22 touch another-empty-file
23 hg addremove -s50
24
19 cd ..
25 cd ..
20
26
21 hg init rep2; cd rep2
27 hg init rep2; cd rep2
@@ -4,6 +4,10 b' adding another-file'
4 removing empty-file
4 removing empty-file
5 removing large-file
5 removing large-file
6 recording removal of large-file as rename to another-file (99% similar)
6 recording removal of large-file as rename to another-file (99% similar)
7 % comparing two empty files caused ZeroDivisionError in the past
8 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
9 adding another-empty-file
10 removing empty-file
7 adding large-file
11 adding large-file
8 adding tiny-file
12 adding tiny-file
9 adding small-file
13 adding small-file
@@ -73,6 +73,7 b' date: Mon Jan 12 13:46:40 1970 +0'
73 summary: 3
73 summary: 3
74
74
75 changeset: 4:1f3a964b6022
75 changeset: 4:1f3a964b6022
76 tag: tip
76 user: test
77 user: test
77 date: Mon Jan 12 13:46:40 1970 +0000
78 date: Mon Jan 12 13:46:40 1970 +0000
78 summary: 4
79 summary: 4
@@ -97,3 +97,34 b' fi'
97 hg purge -v --force
97 hg purge -v --force
98 hg revert --all --quiet
98 hg revert --all --quiet
99 ls
99 ls
100
101 echo % skip excluded files
102 touch excluded_file
103 hg purge -p -X excluded_file
104 hg purge -v -X excluded_file
105 ls
106 rm excluded_file
107
108 echo % skip files in excluded dirs
109 mkdir excluded_dir
110 touch excluded_dir/file
111 hg purge -p -X excluded_dir
112 hg purge -v -X excluded_dir
113 ls
114 ls excluded_dir
115 rm -R excluded_dir
116
117 echo % skip excluded empty dirs
118 mkdir excluded_dir
119 hg purge -p -X excluded_dir
120 hg purge -v -X excluded_dir
121 ls
122 rmdir excluded_dir
123
124 echo % skip patterns
125 mkdir .svn
126 touch .svn/foo
127 mkdir directory/.svn
128 touch directory/.svn/foo
129 hg purge -p -X .svn -X '*/.svn'
130 hg purge -p -X re:.*.svn
@@ -56,3 +56,17 b' untracked_file still around'
56 Removing file untracked_file
56 Removing file untracked_file
57 directory
57 directory
58 r1
58 r1
59 % skip excluded files
60 directory
61 excluded_file
62 r1
63 % skip files in excluded dirs
64 directory
65 excluded_dir
66 r1
67 file
68 % skip excluded empty dirs
69 directory
70 excluded_dir
71 r1
72 % skip patterns
General Comments 0
You need to be logged in to leave comments. Login now