--- a/contrib/wix/mercurial.wxs Tue Mar 16 11:31:08 2010 -0300
+++ b/contrib/wix/mercurial.wxs Fri Mar 19 16:04:00 2010 -0500
@@ -9,7 +9,7 @@
<?define ComponentMainExecutableGUID = D102B8FA-059B-4ACC-9FA3-8C78C3B58EEF ?>
<?define ProductUpgradeCode = A1CC6134-E945-4399-BE36-EB0017FDF7CF ?>
- <Product Name='Mercurial' Id='*'
+ <Product Name='Mercurial $(var.Version)' Id='*'
UpgradeCode='$(var.ProductUpgradeCode)'
Language='1033' Codepage='1252' Version='$(var.Version)' Manufacturer='Matt Mackall and others.'>
@@ -80,12 +80,12 @@
<Directory Id="DesktopFolder" Name="Desktop" />
<Merge Id='VCRuntime' DiskId='1' Language='1033'
- SourceFile='C:\Program Files\Microsoft SDKs\Windows\v7.0\Redist\VC\microsoft.vcxx.crt.x86_msm.msm' />
+ SourceFile='$(var.VCRedistSrcDir)\microsoft.vcxx.crt.x86_msm.msm' />
<Merge Id='VCRuntimePolicy' DiskId='1' Language='1033'
- SourceFile='C:\Program Files\Microsoft SDKs\Windows\v7.0\Redist\VC\policy.x.xx.microsoft.vcxx.crt.x86_msm.msm' />
+ SourceFile='$(var.VCRedistSrcDir)\policy.x.xx.microsoft.vcxx.crt.x86_msm.msm' />
</Directory>
- <Feature Id='Complete' Title='Mercurial $(var.Version)' Description='The complete package'
+ <Feature Id='Complete' Title='Mercurial' Description='The complete package'
Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR' >
<Feature Id='MainProgram' Title='Program' Description='Mercurial command line app'
Level='1' Absent='disallow' >
--- a/hgext/mq.py Tue Mar 16 11:31:08 2010 -0300
+++ b/hgext/mq.py Fri Mar 19 16:04:00 2010 -0500
@@ -96,13 +96,11 @@
for line in file(pf):
line = line.rstrip()
- if line.startswith('diff --git'):
+ if (line.startswith('diff --git')
+ or (diffstart and line.startswith('+++ '))):
diffstart = 2
break
- if diffstart:
- if line.startswith('+++ '):
- diffstart = 2
- break
+ diffstart = 0 # reset
if line.startswith("--- "):
diffstart = 1
continue
--- a/mercurial/filelog.py Tue Mar 16 11:31:08 2010 -0300
+++ b/mercurial/filelog.py Fri Mar 19 16:04:00 2010 -0500
@@ -61,7 +61,7 @@
"""compare text with a given file revision"""
# for renames, we have to go the slow way
- if self.renamed(node):
+ if text.startswith('\1\n') or self.renamed(node):
t2 = self.read(node)
return t2 != text
--- a/mercurial/hg.py Tue Mar 16 11:31:08 2010 -0300
+++ b/mercurial/hg.py Fri Mar 19 16:04:00 2010 -0500
@@ -209,6 +209,7 @@
src_repo = repository(ui, source)
else:
src_repo = source
+ branch = None
origsource = source = src_repo.url()
rev, checkout = addbranchrevs(src_repo, src_repo, branch, rev)
--- a/mercurial/localrepo.py Tue Mar 16 11:31:08 2010 -0300
+++ b/mercurial/localrepo.py Fri Mar 19 16:04:00 2010 -0500
@@ -1091,10 +1091,11 @@
rejected.append(f)
continue
if st.st_size > 10000000:
- self.ui.warn(_("%s: files over 10MB may cause memory and"
- " performance problems\n"
- "(use 'hg revert %s' to unadd the file)\n")
- % (f, f))
+ self.ui.warn(_("%s: up to %d MB of RAM may be required "
+ "to manage this file\n"
+ "(use 'hg revert %s' to cancel the "
+ "pending addition)\n")
+ % (f, 3 * st.st_size // 1000000, f))
if not (stat.S_ISREG(st.st_mode) or stat.S_ISLNK(st.st_mode)):
self.ui.warn(_("%s not added: only files and symlinks "
"supported currently\n") % f)
--- a/mercurial/patch.py Tue Mar 16 11:31:08 2010 -0300
+++ b/mercurial/patch.py Fri Mar 19 16:04:00 2010 -0500
@@ -178,7 +178,8 @@
# (this heuristic is borrowed from quilt)
diffre = re.compile(r'^(?:Index:[ \t]|diff[ \t]|RCS file: |'
r'retrieving revision [0-9]+(\.[0-9]+)*$|'
- r'(---|\*\*\*)[ \t])', re.MULTILINE)
+ r'---[ \t].*?^\+\+\+[ \t]|'
+ r'\*\*\*[ \t].*?^---[ \t])', re.MULTILINE|re.DOTALL)
fd, tmpname = tempfile.mkstemp(prefix='hg-patch-')
tmpfp = os.fdopen(fd, 'w')
--- a/tests/test-import Tue Mar 16 11:31:08 2010 -0300
+++ b/tests/test-import Fri Mar 19 16:04:00 2010 -0500
@@ -375,6 +375,25 @@
hg parents -v
cd ..
+echo % '--- in commit message'
+hg init commitconfusion
+cd commitconfusion
+cat > a.patch <<EOF
+module: summary
+
+--- description
+
+diff --git a/a b/a
+new file mode 100644
+--- /dev/null
++++ b/a
+@@ -0,0 +1,1 @@
++a
+EOF
+hg import -d '0 0' a.patch
+hg parents -v
+cd ..
+
echo '% tricky header splitting'
cat > trickyheaders.patch <<EOF
From: User A <user@a>
--- a/tests/test-import.out Tue Mar 16 11:31:08 2010 -0300
+++ b/tests/test-import.out Fri Mar 19 16:04:00 2010 -0500
@@ -318,6 +318,17 @@
description
+% --- in commit message
+applying a.patch
+changeset: 0:f34d9187897d
+tag: tip
+user: test
+date: Thu Jan 01 00:00:00 1970 +0000
+files: a
+description:
+module: summary
+
+
% tricky header splitting
applying ../trickyheaders.patch
# HG changeset patch
--- a/tests/test-mq Tue Mar 16 11:31:08 2010 -0300
+++ b/tests/test-mq Fri Mar 19 16:04:00 2010 -0500
@@ -86,6 +86,11 @@
hg init --mq
cd ..
+echo '% init --mq with repo path'
+hg init g
+hg init --mq g
+test -d g/.hg/patches/.hg && echo "ok" || echo "failed"
+
echo '% init --mq with nonexistent directory'
hg init --mq nonexistentdir
--- a/tests/test-mq-qimport Tue Mar 16 11:31:08 2010 -0300
+++ b/tests/test-mq-qimport Fri Mar 19 16:04:00 2010 -0500
@@ -43,6 +43,7 @@
First line of commit message.
More text in commit message.
+--- confuse the diff detection
diff --git a/x b/x
new file mode 100644
--- a/tests/test-mq.out Tue Mar 16 11:31:08 2010 -0300
+++ b/tests/test-mq.out Fri Mar 19 16:04:00 2010 -0500
@@ -91,6 +91,8 @@
B
% init --mq without repo
abort: There is no Mercurial repository here (.hg not found)
+% init --mq with repo path
+ok
% init --mq with nonexistent directory
abort: repository nonexistentdir not found!
% init --mq with bundle (non "local")