contrib/plan9/9mail
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 06 May 2017 11:15:56 -0700
changeset 32231 954f63391d71
parent 19613 4bfd3c7160d9
permissions -rw-r--r--
perf: clear revlog caches on every iteration cmdutil.openrevlog() may return a cached revlog instance. This /may/ be a recent "regression" due to refactoring of the manifest API. I'm not sure. Either way, this perf command was broken for at least manifests because subsequent invocations of the perf function would get cache hits from previous invocations, invalidating results. In the extreme case, testing the last revision in the revlog resulted in near-instantanous execution of subsequent runs (since the fulltext is cached). A time of ~1us would be reported in this case.

#!/bin/rc
# 9mail - Mercurial email wrapper for upas/marshal

fn usage {
	echo >[1=2] usage: mercurial/9mail -f from to [cc]
	exit usage
}

from=()
cc=()
to=()

switch($1){
case -f
	from=$2
case *
	usage
}

to=($3)
if(~ $#* 4)
	cc=(-C $4)

upasname=$from
upas/marshal $cc $to