merge with brendan.
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -65,7 +65,7 @@
from mercurial.demandload import *
demandload(globals(), '''email.MIMEMultipart email.MIMEText email.Utils
- mercurial:commands,hg,ui
+ mercurial:commands,hg,mail,ui
os errno popen2 socket sys tempfile time''')
from mercurial.i18n import gettext as _
from mercurial.node import *
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1526,7 +1526,6 @@ def grep(ui, repo, pattern, *pats, **opt
if st == 'window':
incrementing = rev
matches.clear()
- copies.clear()
elif st == 'add':
change = repo.changelog.read(repo.lookup(str(rev)))
mf = repo.manifest.read(change[0])
@@ -1535,20 +1534,19 @@ def grep(ui, repo, pattern, *pats, **opt
if fn in skip:
continue
fstate.setdefault(fn, {})
- copies.setdefault(rev, {})
try:
grepbody(fn, rev, getfile(fn).read(mf[fn]))
if follow:
copied = getfile(fn).renamed(mf[fn])
if copied:
- copies[rev][fn] = copied[0]
+ copies.setdefault(rev, {})[fn] = copied[0]
except KeyError:
pass
elif st == 'iter':
states = matches[rev].items()
states.sort()
for fn, m in states:
- copy = copies[rev].get(fn)
+ copy = copies.get(rev, {}).get(fn)
if fn in skip:
if copy:
skip[copy] = True
@@ -1571,7 +1569,7 @@ def grep(ui, repo, pattern, *pats, **opt
for fn, state in fstate:
if fn in skip:
continue
- if fn not in copies[prev[fn]]:
+ if fn not in copies.get(prev[fn], {}):
display(fn, rev, {}, state)
return (count == 0 and 1) or 0
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -134,7 +134,7 @@ class hgweb(object):
modified, added, removed = map(lambda x: filterfiles(files, x),
(modified, added, removed))
- diffopts = patch.diffopts(ui)
+ diffopts = patch.diffopts(self.repo.ui)
for f in modified:
to = r.file(f).read(mmap1[f])
tn = r.file(f).read(mmap2[f])
--- a/mercurial/mail.py
+++ b/mercurial/mail.py
@@ -60,9 +60,9 @@ def connect(ui):
method = ui.config('email', 'method', 'smtp')
if method == 'smtp':
- return smtp(ui)
+ return _smtp(ui)
- return sendmail(ui, method)
+ return _sendmail(ui, method)
def sendmail(ui, sender, recipients, msg):
return connect(ui).sendmail(sender, recipients, msg)
--- a/tests/test-bisect
+++ b/tests/test-bisect
@@ -17,7 +17,7 @@ while test $count -lt 32 ; do
test $count -eq 0 && hg add
hg ci -m "msg $count" -d "$count 0"
echo % committed changeset $count
- count=$(( $count + 1 ))
+ count=`expr $count + 1`
done
echo % log
--- a/tests/test-extdiff
+++ b/tests/test-extdiff
@@ -8,7 +8,11 @@ hg init a
cd a
echo a > a
hg add
-hg extdiff -o -Nr
+diff -N /dev/null /dev/null 2> /dev/null
+if [ $? -ne 0 ]; then
+ opt="-p gdiff"
+fi
+hg extdiff -o -Nr $opt
echo "[extdiff]" >> $HGTMP/.hgrc
echo "cmd.falabala=echo" >> $HGTMP/.hgrc