Merge with stable
authorMartin Geisler <mg@lazybytes.net>
Tue, 08 Sep 2009 22:58:28 +0200
changeset 9498 744cb8e93936
parent 9497 91b9a06088da (current diff)
parent 9423 1444a42f6052 (diff)
child 9499 bf2732e589a5
Merge with stable
--- a/contrib/win32/mercurial.iss	Thu Aug 13 20:11:16 2009 +0200
+++ b/contrib/win32/mercurial.iss	Tue Sep 08 22:58:28 2009 +0200
@@ -1,9 +1,25 @@
 ; Script generated by the Inno Setup Script Wizard.
 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+#ifndef VERSION
+#define FileHandle
+#define FileLine
+#define VERSION = "unknown"
+#if FileHandle = FileOpen(SourcePath + "\..\..\mercurial\__version__.py")
+  #expr FileLine = FileRead(FileHandle)
+  #expr FileLine = FileRead(FileHandle)
+  #define VERSION = Copy(FileLine, Pos('"', FileLine)+1, Len(FileLine)-Pos('"', FileLine)-1)
+#endif
+#if FileHandle
+  #expr FileClose(FileHandle)
+#endif
+#pragma message "Detected Version: " + VERSION
+#endif
+
 [Setup]
 AppCopyright=Copyright 2005-2009 Matt Mackall and others
 AppName=Mercurial
-AppVerName=Mercurial snapshot
+AppVerName=Mercurial {#VERSION}
 InfoAfterFile=contrib/win32/postinstall.txt
 LicenseFile=COPYING
 ShowLanguageDialog=yes
@@ -13,10 +29,10 @@
 AppUpdatesURL=http://mercurial.selenic.com/
 AppID={{4B95A5F1-EF59-4B08-BED8-C891C46121B3}
 AppContact=mercurial@selenic.com
-OutputBaseFilename=Mercurial-snapshot
+OutputBaseFilename=Mercurial-{#VERSION}
 DefaultDirName={pf}\Mercurial
 SourceDir=..\..
-VersionInfoDescription=Mercurial distributed SCM
+VersionInfoDescription=Mercurial distributed SCM (version {#VERSION})
 VersionInfoCopyright=Copyright 2005-2009 Matt Mackall and others
 VersionInfoCompany=Matt Mackall and others
 InternalCompressLevel=max
@@ -38,8 +54,8 @@
 Source: dist\hg.exe; DestDir: {app}; AfterInstall: Touch('{app}\hg.exe.local')
 Source: dist\python*.dll; Destdir: {app}; Flags: skipifsourcedoesntexist
 Source: dist\library.zip; DestDir: {app}
-Source: dist\mfc*.dll; DestDir: {app}
-Source: dist\msvc*.dll; DestDir: {app}
+Source: dist\mfc*.dll; DestDir: {app}; Flags: skipifsourcedoesntexist
+Source: dist\msvc*.dll; DestDir: {app}; Flags: skipifsourcedoesntexist
 Source: dist\Microsoft.VC*.CRT.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
 Source: dist\Microsoft.VC*.MFC.manifest; DestDir: {app}; Flags: skipifsourcedoesntexist
 Source: dist\w9xpopen.exe; DestDir: {app}
--- a/contrib/win32/win32-build.txt	Thu Aug 13 20:11:16 2009 +0200
+++ b/contrib/win32/win32-build.txt	Tue Sep 08 22:58:28 2009 +0200
@@ -25,7 +25,10 @@
       http://gnuwin32.sourceforge.net/packages/gettext.htm
 
   Inno Setup
-      http://www.jrsoftware.org/isinfo.php
+      http://www.jrsoftware.org/isdl.php#qsp
+
+      Get and install ispack-5.3.4.exe which includes Inno Setup Processor,
+      which is necessary to package Mercurial.
 
   ISTool - optional
       http://www.istool.org/default.aspx/
@@ -89,11 +92,14 @@
 If you use ISTool, you open the C:\hg\hg-release\contrib\win32\mercurial.iss
 file and type Ctrl-F9 to compile the installer file.
 
-Otherwise you run the Inno Setup compiler.  Assuming it's on the path you run:
+Otherwise you run the Inno Setup compiler.  Assuming it's in the path
+you should execute:
 
-  iscc contrib\win32\mercurial.iss
+  iscc contrib\win32\mercurial.iss /DVERSION=foo
 
-The actual installer will be in the C:\hg\hg-release\Output directory.
+Where 'foo' is the version number you would like to see in the
+'Add/Remove Applications' tool.  The installer will be placed into
+a directory named Output/ at the root of your repository.
 
 To automate the steps above you may want to create a batchfile based on the
 following:
@@ -104,6 +110,6 @@
   cd doc
   mingw32-make ASCIIDOC=asciidoc.bat html
   cd ..
-  iscc contrib\win32\mercurial.iss
+  iscc contrib\win32\mercurial.iss /DVERSION=snapshot
 
 and run it from the root of the hg repository (c:\hg\hg-release).
--- a/doc/hgrc.5.txt	Thu Aug 13 20:11:16 2009 +0200
+++ b/doc/hgrc.5.txt	Tue Sep 08 22:58:28 2009 +0200
@@ -91,6 +91,15 @@
 Lines beginning with "`#`" or "`;`" are ignored and may be used to provide
 comments.
 
+A line of the form "`%include file`" will include `file` into the
+current configuration file. The inclusion is recursive, which means
+that included files can include other files. Filenames are relative to
+the configuration file in which the `%include` directive is found.
+
+A line with "`%unset name`" will remove `name` from the current
+section, if it has been set previously.
+
+
 SECTIONS
 --------
 
--- a/hgext/churn.py	Thu Aug 13 20:11:16 2009 +0200
+++ b/hgext/churn.py	Tue Sep 08 22:58:28 2009 +0200
@@ -146,7 +146,8 @@
     sortfn = ((not opts.get('sort')) and (lambda a, b: cmp(b[1], a[1])) or None)
     rate.sort(sortfn)
 
-    maxcount = float(max([v for k, v in rate]))
+    # Be careful not to have a zero maxcount (issue833)
+    maxcount = float(max([v for k, v in rate])) or 1.0
     maxname = max([len(k) for k, v in rate])
 
     ttywidth = util.termwidth()
--- a/mercurial/dirstate.py	Thu Aug 13 20:11:16 2009 +0200
+++ b/mercurial/dirstate.py	Tue Sep 08 22:58:28 2009 +0200
@@ -377,9 +377,9 @@
             gran = int(self._ui.config('dirstate', 'granularity', 1))
         except ValueError:
             gran = 1
-        limit = sys.maxint
         if gran > 0:
-            limit = util.fstat(st).st_mtime - gran
+            hlimit = util.fstat(st).st_mtime
+            llimit = hlimit - gran
 
         cs = cStringIO.StringIO()
         copymap = self._copymap
@@ -389,7 +389,8 @@
         for f, e in self._map.iteritems():
             if f in copymap:
                 f = "%s\0%s" % (f, copymap[f])
-            if e[3] > limit and e[0] == 'n':
+            if gran > 0 and e[0] == 'n' and llimit < e[3] <= hlimit:
+                # file was updated too recently, ignore stat data
                 e = (e[0], 0, -1, -1)
             e = pack(_format, e[0], e[1], e[2], e[3], len(f))
             write(e)
--- a/mercurial/error.py	Thu Aug 13 20:11:16 2009 +0200
+++ b/mercurial/error.py	Tue Sep 08 22:58:28 2009 +0200
@@ -36,6 +36,9 @@
 class RepoError(Exception):
     pass
 
+class RepoLookupError(RepoError):
+    pass
+
 class CapabilityError(RepoError):
     pass
 
--- a/mercurial/help.py	Thu Aug 13 20:11:16 2009 +0200
+++ b/mercurial/help.py	Tue Sep 08 22:58:28 2009 +0200
@@ -426,13 +426,19 @@
     - nonempty: Any text. Returns '(none)' if the string is empty.
     - hgdate: Date. Returns the date as a pair of numbers:
           "1157407993 25200" (Unix timestamp, timezone offset).
-    - isodate: Date. Returns the date in ISO 8601 format.
+    - isodate: Date. Returns the date in ISO 8601 format: "2009-08-18
+          13:00 +0200".
+    - isodatesec: Date. Returns the date in ISO 8601 format, including
+          seconds: "2009-08-18 13:00:13 +0200". See also the
+          rfc3339date filter.
     - localdate: Date. Converts a date to local date.
     - obfuscate: Any text. Returns the input text rendered as a
           sequence of XML entities.
     - person: Any text. Returns the text before an email address.
     - rfc822date: Date. Returns a date using the same format used
-          in email headers.
+          in email headers: "Tue, 18 Aug 2009 13:00:13 +0200".
+    - rfc3339date: Date. Returns a date using the Internet date format
+          specified in RFC 3339: "2009-08-18T13:00:13+02:00".
     - short: Changeset hash. Returns the short form of a changeset
           hash, i.e. a 12-byte hexadecimal string.
     - shortdate: Date. Returns a date like "2006-09-18".
--- a/mercurial/hg.py	Thu Aug 13 20:11:16 2009 +0200
+++ b/mercurial/hg.py	Tue Sep 08 22:58:28 2009 +0200
@@ -137,10 +137,12 @@
         if update is not True:
             checkout = update
         for test in (checkout, 'default', 'tip'):
+            if test is None:
+                continue
             try:
                 uprev = r.lookup(test)
                 break
-            except LookupError:
+            except error.RepoLookupError:
                 continue
         _update(r, uprev)
 
@@ -309,10 +311,12 @@
                 if update is not True:
                     checkout = update
                 for test in (checkout, 'default', 'tip'):
+                    if test is None:
+                        continue
                     try:
                         uprev = dest_repo.lookup(test)
                         break
-                    except:
+                    except error.RepoLookupError:
                         continue
                 _update(dest_repo, uprev)
 
--- a/mercurial/hgweb/webcommands.py	Thu Aug 13 20:11:16 2009 +0200
+++ b/mercurial/hgweb/webcommands.py	Tue Sep 08 22:58:28 2009 +0200
@@ -236,7 +236,11 @@
                           parity=parity.next()))
 
     parity = paritygen(web.stripecount)
-    diffs = webutil.diffs(web.repo, tmpl, ctx, None, parity)
+    style = web.config('web', 'style', 'paper')
+    if 'style' in req.form:
+        style = req.form['style'][0]
+
+    diffs = webutil.diffs(web.repo, tmpl, ctx, None, parity, style)
     return tmpl('changeset',
                 diff=diffs,
                 rev=ctx.rev(),
@@ -474,7 +478,11 @@
         # path already defined in except clause
 
     parity = paritygen(web.stripecount)
-    diffs = webutil.diffs(web.repo, tmpl, fctx or ctx, [path], parity)
+    style = web.config('web', 'style', 'paper')
+    if 'style' in req.form:
+        style = req.form['style'][0]
+
+    diffs = webutil.diffs(web.repo, tmpl, fctx or ctx, [path], parity, style)
     rename = fctx and webutil.renamelink(fctx) or []
     ctx = fctx and fctx or ctx
     return tmpl("filediff",
--- a/mercurial/hgweb/webutil.py	Thu Aug 13 20:11:16 2009 +0200
+++ b/mercurial/hgweb/webutil.py	Tue Sep 08 22:58:28 2009 +0200
@@ -153,7 +153,7 @@
     if len(files) > max:
         yield tmpl('fileellipses')
 
-def diffs(repo, tmpl, ctx, files, parity):
+def diffs(repo, tmpl, ctx, files, parity, style):
 
     def countgen():
         start = 1
@@ -195,7 +195,7 @@
             yield tmpl('diffblock', parity=parity.next(),
                        lines=prettyprintlines(''.join(block)))
             block = []
-        if chunk.startswith('diff'):
+        if chunk.startswith('diff') and style != 'raw':
             chunk = ''.join(chunk.splitlines(True)[1:])
         block.append(chunk)
     yield tmpl('diffblock', parity=parity.next(),
--- a/mercurial/localrepo.py	Thu Aug 13 20:11:16 2009 +0200
+++ b/mercurial/localrepo.py	Tue Sep 08 22:58:28 2009 +0200
@@ -509,7 +509,7 @@
                 key = hex(key)
         except:
             pass
-        raise error.RepoError(_("unknown revision '%s'") % key)
+        raise error.RepoLookupError(_("unknown revision '%s'") % key)
 
     def local(self):
         return True
--- a/mercurial/osutil.c	Thu Aug 13 20:11:16 2009 +0200
+++ b/mercurial/osutil.c	Tue Sep 08 22:58:28 2009 +0200
@@ -23,7 +23,7 @@
 # include <unistd.h>
 #endif
 
-// some platforms lack the PATH_MAX definition (eg. GNU/Hurd)
+/* some platforms lack the PATH_MAX definition (eg. GNU/Hurd) */
 #ifndef PATH_MAX
 #define PATH_MAX 4096
 #endif
--- a/mercurial/util.py	Thu Aug 13 20:11:16 2009 +0200
+++ b/mercurial/util.py	Tue Sep 08 22:58:28 2009 +0200
@@ -84,7 +84,7 @@
     '%b %d %Y',
     '%b %d',
     '%H:%M:%S',
-    '%I:%M:%SP',
+    '%I:%M:%S%p',
     '%H:%M',
     '%I:%M%p',
 )
--- a/tests/test-churn	Thu Aug 13 20:11:16 2009 +0200
+++ b/tests/test-churn	Tue Sep 08 22:58:28 2009 +0200
@@ -48,3 +48,13 @@
 echo % churn by hour
 hg churn -f '%H' -s
 
+cd ..
+
+# issue 833: ZeroDivisionError
+hg init issue-833
+cd issue-833
+touch foo
+hg ci -Am foo
+# this was failing with a ZeroDivisionError
+hg churn
+cd ..
--- a/tests/test-churn.out	Thu Aug 13 20:11:16 2009 +0200
+++ b/tests/test-churn.out	Tue Sep 08 22:58:28 2009 +0200
@@ -28,3 +28,5 @@
 09      2 *********************************
 12      4 ******************************************************************
 13      1 ****************
+adding foo
+test      0 
--- a/tests/test-command-template	Thu Aug 13 20:11:16 2009 +0200
+++ b/tests/test-command-template	Tue Sep 08 22:58:28 2009 +0200
@@ -43,15 +43,15 @@
 echo '#  normal'
 hg log > log.out
 hg log --style default > style.out
-diff -u log.out style.out
+cmp log.out style.out || diff -u log.out style.out
 echo '#  verbose'
 hg log -v > log.out
 hg log -v --style default > style.out
-diff -u log.out style.out
+cmp log.out style.out || diff -u log.out style.out
 echo '#  debug'
 hg log --debug > log.out
 hg log --debug --style default > style.out
-diff -u log.out style.out
+cmp log.out style.out || diff -u log.out style.out
 
 echo '# revision with no copies (used to print a traceback)'
 hg tip -v --template '\n'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dirstate-future	Tue Sep 08 22:58:28 2009 +0200
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+hg init
+echo a > a
+hg add
+hg ci -m1
+
+# set mtime of a into the future
+touch -t 202101011200 a
+
+# status must not set a's entry to unset (issue1790)
+hg status
+hg debugstate
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-dirstate-future.out	Tue Sep 08 22:58:28 2009 +0200
@@ -0,0 +1,2 @@
+adding a
+n 644          2 2021-01-01 12:00:00 a
--- a/tests/test-hgweb-commands.out	Thu Aug 13 20:11:16 2009 +0200
+++ b/tests/test-hgweb-commands.out	Tue Sep 08 22:58:28 2009 +0200
@@ -337,6 +337,7 @@
 # Parent  2ef0ac749a14e4f57a5a822464a0902c6f7f448f
 Added tag 1.0 for changeset 2ef0ac749a14
 
+diff -r 2ef0ac749a14 -r a4f92ed23982 .hgtags
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
 +++ b/.hgtags	Thu Jan 01 00:00:00 1970 +0000
 @@ -0,0 +1,1 @@
@@ -451,6 +452,7 @@
 200 Script output follows
 
 
+diff -r 000000000000 -r a4f92ed23982 foo
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
 +++ b/foo	Thu Jan 01 00:00:00 1970 +0000
 @@ -0,0 +1,1 @@
--- a/tests/test-hgweb-diffs	Thu Aug 13 20:11:16 2009 +0200
+++ b/tests/test-hgweb-diffs	Tue Sep 08 22:58:28 2009 +0200
@@ -18,6 +18,9 @@
 echo % revision
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
 
+echo % raw revision
+"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0'
+
 echo % diff removed file
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
 
@@ -29,6 +32,9 @@
 echo % revision
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0'
 
+echo % revision
+"$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0'
+
 echo % diff removed file
 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a'
 
--- a/tests/test-hgweb-diffs.out	Thu Aug 13 20:11:16 2009 +0200
+++ b/tests/test-hgweb-diffs.out	Tue Sep 08 22:58:28 2009 +0200
@@ -95,6 +95,28 @@
 </body>
 </html>
 
+% raw revision
+200 Script output follows
+
+
+# HG changeset patch
+# User test
+# Date 0 0
+# Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
+
+a
+
+diff -r 000000000000 -r 0cd96de13884 a
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/a	Thu Jan 01 00:00:00 1970 +0000
+@@ -0,0 +1,1 @@
++a
+diff -r 000000000000 -r 0cd96de13884 b
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/b	Thu Jan 01 00:00:00 1970 +0000
+@@ -0,0 +1,1 @@
++b
+
 % diff removed file
 200 Script output follows
 
@@ -279,6 +301,30 @@
 </body>
 </html>
 
+% revision
+200 Script output follows
+
+
+# HG changeset patch
+# User test
+# Date 0 0
+# Node ID 0cd96de13884b090099512d4794ae87ad067ea8e
+
+a
+
+diff --git a/a b/a
+new file mode 100644
+--- /dev/null
++++ b/a
+@@ -0,0 +1,1 @@
++a
+diff --git a/b b/b
+new file mode 100644
+--- /dev/null
++++ b/b
+@@ -0,0 +1,1 @@
++b
+
 % diff removed file
 200 Script output follows
 
--- a/tests/test-keyword.out	Thu Aug 13 20:11:16 2009 +0200
+++ b/tests/test-keyword.out	Tue Sep 08 22:58:28 2009 +0200
@@ -419,6 +419,7 @@
 # Parent  bb948857c743469b22bbf51f7ec8112279ca5d83
 xa
 
+diff -r bb948857c743 -r cfa68229c116 x/a
 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
 +++ b/x/a	Thu Jan 01 00:00:03 1970 +0000
 @@ -0,0 +1,4 @@
@@ -431,6 +432,7 @@
 200 Script output follows
 
 
+diff -r ef63ca68695b -r bb948857c743 a
 --- a/a	Thu Jan 01 00:00:00 1970 +0000
 +++ b/a	Thu Jan 01 00:00:02 1970 +0000
 @@ -1,3 +1,4 @@
--- a/tests/test-parse-date	Thu Aug 13 20:11:16 2009 +0200
+++ b/tests/test-parse-date	Tue Sep 08 22:58:28 2009 +0200
@@ -44,6 +44,10 @@
 hg debugdate "Sat Sep 08 21:16:40 2001 +0430"
 hg debugdate "Sat Sep 08 21:16:40 2001 -0430"
 
+# Test 12-hours times
+hg debugdate "2006-02-01 1:00:30PM +0000"
+hg debugdate "1:00:30PM" > /dev/null || echo 'failed'
+
 #Test date formats with '>' or '<' accompanied by space characters
 hg log -d '>' --template '{date|date}\n'
 hg log -d '<' hg log -d '>' --template '{date|date}\n'
--- a/tests/test-parse-date.out	Thu Aug 13 20:11:16 2009 +0200
+++ b/tests/test-parse-date.out	Tue Sep 08 22:58:28 2009 +0200
@@ -34,6 +34,8 @@
 standard: Sat Sep 08 21:16:40 2001 +0430
 internal: 1000000000 16200
 standard: Sat Sep 08 21:16:40 2001 -0430
+internal: 1138798830 0
+standard: Wed Feb 01 13:00:30 2006 +0000
 Sun Jan 15 13:30:00 2006 +0500
 Sun Jan 15 13:30:00 2006 -0800
 Sat Jul 15 13:30:00 2006 +0500