# HG changeset patch # User Dirkjan Ochtman # Date 1221644077 -7200 # Node ID f29b674cc2210126c2899d94d882c367a8ea64bc # Parent aafe12bd7174141f0c4c04cfb3ec146249cdbbd4# Parent d1c82127573ed221fce6af570cc7d3df1eead923 merge with crew-stable diff -r aafe12bd7174 -r f29b674cc221 mercurial/bdiff.c --- a/mercurial/bdiff.c Mon Sep 15 23:39:11 2008 +0100 +++ b/mercurial/bdiff.c Wed Sep 17 11:34:37 2008 +0200 @@ -34,7 +34,7 @@ } #else #include -#ifdef __BEOS__ +#if defined __BEOS__ && !defined __HAIKU__ #include #else #include diff -r aafe12bd7174 -r f29b674cc221 mercurial/changelog.py --- a/mercurial/changelog.py Mon Sep 15 23:39:11 2008 +0100 +++ b/mercurial/changelog.py Wed Sep 17 11:34:37 2008 +0200 @@ -6,7 +6,8 @@ # of the GNU General Public License, incorporated herein by reference. from node import bin, hex, nullid -from revlog import revlog +from revlog import revlog, RevlogError +from i18n import _ import util def _string_escape(text): @@ -176,6 +177,9 @@ def add(self, manifest, files, desc, transaction, p1=None, p2=None, user=None, date=None, extra={}): + user = user.strip() + if "\n" in user: + raise RevlogError(_("username %s contains a newline") % `user`) user, desc = util.fromlocal(user), util.fromlocal(desc) if date: diff -r aafe12bd7174 -r f29b674cc221 mercurial/commands.py --- a/mercurial/commands.py Mon Sep 15 23:39:11 2008 +0100 +++ b/mercurial/commands.py Wed Sep 17 11:34:37 2008 +0200 @@ -2814,7 +2814,8 @@ """update working directory Update the repository's working directory to the specified revision, - or the tip of the current branch if none is specified. + or the tip of the current branch if none is specified. Use null as + the revision to remove the working copy (like 'hg clone -U'). If the requested revision is a descendant of the working directory, any outstanding changes in the working directory will diff -r aafe12bd7174 -r f29b674cc221 mercurial/mpatch.c --- a/mercurial/mpatch.c Mon Sep 15 23:39:11 2008 +0100 +++ b/mercurial/mpatch.c Wed Sep 17 11:34:37 2008 +0200 @@ -52,7 +52,7 @@ #else /* not windows */ # include -# ifdef __BEOS__ +# if defined __BEOS__ && !defined __HAIKU__ # include # else # include diff -r aafe12bd7174 -r f29b674cc221 tests/test-highlight --- a/tests/test-highlight Mon Sep 15 23:39:11 2008 +0100 +++ b/tests/test-highlight Wed Sep 17 11:34:37 2008 +0200 @@ -20,11 +20,11 @@ echo % hgweb filerevision, html ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/file/tip/get-with-headers.py') \ - | sed "s/[0-9]* years ago/long ago/g" + | sed "s/[0-9]* years ago/long ago/g" | sed "s/class=\"k\"/class=\"kn\"/g" echo % hgweb fileannotate, html ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py') \ - | sed "s/[0-9]* years ago/long ago/g" + | sed "s/[0-9]* years ago/long ago/g" | sed "s/class=\"k\"/class=\"kn\"/g" echo % hgweb fileannotate, raw ("$TESTDIR/get-with-headers.py" localhost:$HGPORT '/annotate/tip/get-with-headers.py?style=raw') \ diff -r aafe12bd7174 -r f29b674cc221 tests/test-highlight.out --- a/tests/test-highlight.out Mon Sep 15 23:39:11 2008 +0100 +++ b/tests/test-highlight.out Wed Sep 17 11:34:37 2008 +0200 @@ -51,7 +51,7 @@
-
1#!/usr/bin/env python
3__doc__ = """This does HTTP get requests given a host:port and path and returns
4a subset of the headers plus the body of the result."""
6import httplib, sys
7headers = [h.lower() for h in sys.argv[3:]]
8conn = httplib.HTTPConnection(sys.argv[1])
9conn.request("GET", sys.argv[2])
10response = conn.getresponse()
11print response.status, response.reason
12for h in headers:
13 if response.getheader(h, None) is not None:
14 print "%s: %s" % (h, response.getheader(h))
15print
16sys.stdout.write(response.read())
18if 200 <= response.status <= 299:
19 sys.exit(0)
20sys.exit(1)
+
1#!/usr/bin/env python
3__doc__ = """This does HTTP get requests given a host:port and path and returns
4a subset of the headers plus the body of the result."""
6import httplib, sys
7headers = [h.lower() for h in sys.argv[3:]]
8conn = httplib.HTTPConnection(sys.argv[1])
9conn.request("GET", sys.argv[2])
10response = conn.getresponse()
11print response.status, response.reason
12for h in headers:
13 if response.getheader(h, None) is not None:
14 print "%s: %s" % (h, response.getheader(h))
15print
16sys.stdout.write(response.read())
18if 200 <= response.status <= 299:
19 sys.exit(0)
20sys.exit(1)
@@ -118,7 +118,7 @@
- +
test@0 1
#!/usr/bin/env python
test@0 2
test@0 3
__doc__ = """This does HTTP get requests given a host:port and path and returns
test@0 4
a subset of the headers plus the body of the result."""
test@0 5
test@0 6
import httplib, sys
test@0 7
headers = [h.lower() for h in sys.argv[3:]]
test@0 8
conn = httplib.HTTPConnection(sys.argv[1])
test@0 9
conn.request("GET", sys.argv[2])
test@0 10
response = conn.getresponse()
test@0 11
print response.status, response.reason
test@0 12
for h in headers:
test@0 13
    if response.getheader(h, None) is not None:
test@0 14
        print "%s: %s" % (h, response.getheader(h))
test@0 15
print
test@0 16
sys.stdout.write(response.read())
test@0 17
test@0 18
if 200 <= response.status <= 299:
test@0 19
    sys.exit(0)
test@0 20
sys.exit(1)
test@0 1
#!/usr/bin/env python
test@0 2
test@0 3
__doc__ = """This does HTTP get requests given a host:port and path and returns
test@0 4
a subset of the headers plus the body of the result."""
test@0 5
test@0 6
import httplib, sys
test@0 7
headers = [h.lower() for h in sys.argv[3:]]
test@0 8
conn = httplib.HTTPConnection(sys.argv[1])
test@0 9
conn.request("GET", sys.argv[2])
test@0 10
response = conn.getresponse()
test@0 11
print response.status, response.reason
test@0 12
for h in headers:
test@0 13
    if response.getheader(h, None) is not None:
test@0 14
        print "%s: %s" % (h, response.getheader(h))
test@0 15
print
test@0 16
sys.stdout.write(response.read())
test@0 17
test@0 18
if 200 <= response.status <= 299:
test@0 19
    sys.exit(0)
test@0 20
sys.exit(1)
diff -r aafe12bd7174 -r f29b674cc221 tests/test-username-newline --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-username-newline Wed Sep 17 11:34:37 2008 +0200 @@ -0,0 +1,22 @@ +#!/bin/sh +# + +hg init foo +cd foo +touch a + + +unset HGUSER +echo "[ui]" >> .hg/hgrc +echo "username= foo" >> .hg/hgrc +echo " bar1" >> .hg/hgrc + +hg ci -Am m + +rm .hg/hgrc + +HGUSER=`(echo foo; echo bar2)` hg ci -Am m + +hg ci -Am m -u "`(echo foo; echo bar3)`" + +true diff -r aafe12bd7174 -r f29b674cc221 tests/test-username-newline.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-username-newline.out Wed Sep 17 11:34:37 2008 +0200 @@ -0,0 +1,8 @@ +adding a +abort: username 'foo\nbar1' contains a newline + +abort: username 'foo\nbar2' contains a newline + +transaction abort! +rollback completed +abort: username 'foo\nbar3' contains a newline!