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