changeset 12968:609edbc7853f

merge with stable
author Martin Geisler <mg@lazybytes.net>
date Thu, 11 Nov 2010 07:23:38 +0100
parents 34034e55424f (current diff) 70b043405400 (diff)
children 91cbba199d8b
files mercurial/commands.py
diffstat 4 files changed, 157 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/gpg.py	Thu Nov 11 00:08:09 2010 +0100
+++ b/hgext/gpg.py	Thu Nov 11 07:23:38 2010 +0100
@@ -227,7 +227,7 @@
         data = node2txt(repo, n, sigver)
         sig = mygpg.sign(data)
         if not sig:
-            raise util.abort(_("error while signing"))
+            raise util.Abort(_("error while signing"))
         sig = binascii.b2a_base64(sig)
         sig = sig.replace("\n", "")
         sigmessage += "%s %s %s\n" % (hexnode, sigver, sig)
--- a/mercurial/commands.py	Thu Nov 11 00:08:09 2010 +0100
+++ b/mercurial/commands.py	Thu Nov 11 07:23:38 2010 +0100
@@ -1273,7 +1273,7 @@
 
     format = opts.get('format', 0)
     if format not in (0, 1):
-        raise util.abort("unknown format %d" % format)
+        raise util.Abort("unknown format %d" % format)
 
     if not r:
         r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_)
--- a/mercurial/win32.py	Thu Nov 11 00:08:09 2010 +0100
+++ b/mercurial/win32.py	Thu Nov 11 07:23:38 2010 +0100
@@ -102,12 +102,7 @@
 
 def system_rcpath_win32():
     '''return default os-specific hgrc search path'''
-    proc = win32api.GetCurrentProcess()
-    try:
-        # This will fail on windows < NT
-        filename = win32process.GetModuleFileNameEx(proc, 0)
-    except:
-        filename = win32api.GetModuleFileName(0)
+    filename = win32api.GetModuleFileName(0)
     # Use mercurial.ini found in directory with hg.exe
     progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini')
     if os.path.isfile(progrc):
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-hardlinks.t	Thu Nov 11 07:23:38 2010 +0100
@@ -0,0 +1,154 @@
+  $ cat > nlinks.py <<EOF
+  > import os, sys
+  > for f in sorted(sys.stdin.readlines()):
+  >     f = f[:-1]
+  >     print os.lstat(f).st_nlink, f
+  > EOF
+
+  $ nlinksdir()
+  > {
+  >     find $1 -type f | python $TESTTMP/nlinks.py
+  > }
+
+Prepare repo r1:
+
+  $ mkdir r1
+  $ cd r1
+  $ hg init
+
+  $ echo c1 > f1
+  $ hg add f1
+  $ hg ci -m0
+
+  $ mkdir d1
+  $ cd d1
+  $ echo c2 > f2
+  $ hg add f2
+  $ hg ci -m1
+  $ cd ../..
+
+  $ nlinksdir r1/.hg/store
+  1 r1/.hg/store/00changelog.i
+  1 r1/.hg/store/00manifest.i
+  1 r1/.hg/store/data/d1/f2.i
+  1 r1/.hg/store/data/f1.i
+  1 r1/.hg/store/fncache
+  1 r1/.hg/store/undo
+
+
+Create hardlinked clone r2:
+
+  $ hg clone -U --debug r1 r2
+  linked 7 files
+
+Create non-hardlinked clone r3:
+
+  $ hg clone --pull r1 r3
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 2 changes to 2 files
+  updating to branch default
+  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+
+Repos r1 and r2 should now contain hardlinked files:
+
+  $ nlinksdir r1/.hg/store
+  2 r1/.hg/store/00changelog.i
+  2 r1/.hg/store/00manifest.i
+  2 r1/.hg/store/data/d1/f2.i
+  2 r1/.hg/store/data/f1.i
+  2 r1/.hg/store/fncache
+  1 r1/.hg/store/undo
+
+  $ nlinksdir r2/.hg/store
+  2 r2/.hg/store/00changelog.i
+  2 r2/.hg/store/00manifest.i
+  2 r2/.hg/store/data/d1/f2.i
+  2 r2/.hg/store/data/f1.i
+  2 r2/.hg/store/fncache
+
+Repo r3 should not be hardlinked:
+
+  $ nlinksdir r3/.hg/store
+  1 r3/.hg/store/00changelog.i
+  1 r3/.hg/store/00manifest.i
+  1 r3/.hg/store/data/d1/f2.i
+  1 r3/.hg/store/data/f1.i
+  1 r3/.hg/store/fncache
+  1 r3/.hg/store/undo
+
+
+Create a non-inlined filelog in r3:
+
+  $ cd r3/d1
+  $ python -c 'for x in range(10000): print x' >> data1
+  $ for j in 0 1 2 3 4 5 6 7 8 9; do
+  >   cat data1 >> f2
+  >   hg commit -m$j
+  > done
+  $ cd ../..
+
+  $ nlinksdir r3/.hg/store
+  1 r3/.hg/store/00changelog.i
+  1 r3/.hg/store/00manifest.i
+  1 r3/.hg/store/data/d1/f2.d
+  1 r3/.hg/store/data/d1/f2.i
+  1 r3/.hg/store/data/f1.i
+  1 r3/.hg/store/fncache
+  1 r3/.hg/store/undo
+
+Push to repo r1 should break up most hardlinks in r2:
+
+  $ hg -R r2 verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 2 changesets, 2 total revisions
+
+  $ cd r3
+  $ hg push
+  pushing to $TESTTMP/r1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 10 changesets with 10 changes to 1 files
+
+  $ cd ..
+
+  $ nlinksdir r2/.hg/store
+  1 r2/.hg/store/00changelog.i
+  1 r2/.hg/store/00manifest.i
+  1 r2/.hg/store/data/d1/f2.i
+  2 r2/.hg/store/data/f1.i
+  1 r2/.hg/store/fncache
+
+  $ hg -R r2 verify
+  checking changesets
+  checking manifests
+  crosschecking files in changesets and manifests
+  checking files
+  2 files, 2 changesets, 2 total revisions
+
+
+  $ cd r1
+  $ hg up
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+Committing a change to f1 in r1 must break up hardlink f1.i in r2:
+
+  $ echo c1c1 >> f1
+  $ hg ci -m00
+  $ cd ..
+
+  $ nlinksdir r2/.hg/store
+  1 r2/.hg/store/00changelog.i
+  1 r2/.hg/store/00manifest.i
+  1 r2/.hg/store/data/d1/f2.i
+  1 r2/.hg/store/data/f1.i
+  1 r2/.hg/store/fncache
+