# HG changeset patch # User Matt Mackall # Date 1280264622 18000 # Node ID 708291e9389cb4c84c4f86935fd77fe9a717f5a6 # Parent ee8f36a6c766c2cfd3afb4b0e0074dd489d0214e# Parent b6360a113478bddee042bdec11328f1f71936970 Merge with crew diff -r b6360a113478 -r 708291e9389c contrib/perf.py --- a/contrib/perf.py Sun Jul 25 21:20:05 2010 -0500 +++ b/contrib/perf.py Tue Jul 27 16:03:42 2010 -0500 @@ -133,6 +133,16 @@ title = 'diffopts: %s' % (diffopt and ('-' + diffopt) or 'none') timer(d, title) +def perfrevlog(ui, repo, file_, **opts): + from mercurial import revlog + dist = opts['dist'] + def d(): + r = revlog.revlog(lambda fn: open(fn, 'rb'), file_) + for x in xrange(0, len(r), dist): + r.revision(r.node(x)) + + timer(d) + cmdtable = { 'perflookup': (perflookup, []), 'perfparents': (perfparents, []), @@ -149,4 +159,5 @@ [('', 'rename', False, 'ask log to follow renames')]), 'perftemplating': (perftemplating, []), 'perfdiffwd': (perfdiffwd, []), + 'perfrevlog': (perfrevlog, [('d', 'dist', 100, 'distance between the revisions')],"[INDEXFILE]"), } diff -r b6360a113478 -r 708291e9389c mercurial/dispatch.py --- a/mercurial/dispatch.py Sun Jul 25 21:20:05 2010 -0500 +++ b/mercurial/dispatch.py Tue Jul 27 16:03:42 2010 -0500 @@ -223,6 +223,18 @@ cmd = args.pop(0) args = map(util.expandpath, args) + for invalidarg in ("--cwd", "-R", "--repository", "--repo"): + if _earlygetopt([invalidarg], args): + def fn(ui, *args): + ui.warn(_("error in definition for alias '%s': %s may only " + "be given on the command line\n") + % (self.name, invalidarg)) + return 1 + + self.fn = fn + self.badalias = True + return + try: tableentry = cmdutil.findcmd(cmd, cmdtable, False)[1] if len(tableentry) > 2: diff -r b6360a113478 -r 708291e9389c mercurial/revlog.py --- a/mercurial/revlog.py Sun Jul 25 21:20:05 2010 -0500 +++ b/mercurial/revlog.py Tue Jul 27 16:03:42 2010 -0500 @@ -533,6 +533,8 @@ return self.index[rev][1] def base(self, rev): return self.index[rev][3] + def flags(self, rev): + return self.index[rev][0] & 0xFFFF def size(self, rev): """return the length of the uncompressed text for a given revision""" @@ -1020,9 +1022,9 @@ base = self.base(rev) # check rev flags - if self.index[rev][0] & 0xFFFF: + if self.flags(rev): raise RevlogError(_('incompatible revision flag %x') % - (self.index[rev][0] & 0xFFFF)) + (self.flags(rev))) # do we have useful data cached? if self._cache and self._cache[1] >= base and self._cache[1] < rev: diff -r b6360a113478 -r 708291e9389c tests/test-alias --- a/tests/test-alias Sun Jul 25 21:20:05 2010 -0500 +++ b/tests/test-alias Tue Jul 27 16:03:42 2010 -0500 @@ -8,6 +8,10 @@ ambiguous = s recursive = recursive nodefinition = +no--cwd = status --cwd elsewhere +no-R = status -R elsewhere +no--repo = status --repo elsewhere +no--repository = status --repository elsewhere mylog = log lognull = log -r null shortlog = log --template '{rev} {node|short} | {date|isodate}\n' @@ -42,6 +46,16 @@ hg nodef hg help nodef +echo '% invalid options' +hg no--cwd +hg help no--cwd +hg no-R +hg help no-R +hg no--repo +hg help no--repo +hg no--repository +hg help no--repository + cd alias echo '% no usage' diff -r b6360a113478 -r 708291e9389c tests/test-alias.out --- a/tests/test-alias.out Sun Jul 25 21:20:05 2010 -0500 +++ b/tests/test-alias.out Tue Jul 27 16:03:42 2010 -0500 @@ -11,6 +11,15 @@ % no definition no definition for alias 'nodefinition' no definition for alias 'nodefinition' +% invalid options +error in definition for alias 'no--cwd': --cwd may only be given on the command line +error in definition for alias 'no--cwd': --cwd may only be given on the command line +error in definition for alias 'no-R': -R may only be given on the command line +error in definition for alias 'no-R': -R may only be given on the command line +error in definition for alias 'no--repo': --repo may only be given on the command line +error in definition for alias 'no--repo': --repo may only be given on the command line +error in definition for alias 'no--repository': --repository may only be given on the command line +error in definition for alias 'no--repository': --repository may only be given on the command line % no usage no rollback information available adding foo