Patchwork [STABLE] generaldelta: make test platform-independent

login
register
mail settings
Submitter Christian Ebert
Date Oct. 21, 2013, 7:26 a.m.
Message ID <4ae43f52046fa8309f9c.1382340404@1.0.0.127.in-addr.arpa>
Download mbox | patch
Permalink /patch/2795/
State Rejected
Headers show

Comments

Christian Ebert - Oct. 21, 2013, 7:26 a.m.
# HG changeset patch
# User Christian Ebert <blacktrash@gmx.net>
# Date 1382340303 -7200
#      Mon Oct 21 09:25:03 2013 +0200
# Node ID 4ae43f52046fa8309f9ce9b2427939049177ad33
# Parent  1c58e368fbfd0baa3113ef728a67b53655db3c4e
generaldelta: make test platform-independent

du -b option illegal on Mac OS and probably other BSD-like systems.
Matt Mackall - Oct. 21, 2013, 10:13 p.m.
On Mon, 2013-10-21 at 09:26 +0200, Christian Ebert wrote:
> # HG changeset patch
> # User Christian Ebert <blacktrash@gmx.net>
> # Date 1382340303 -7200
> #      Mon Oct 21 09:25:03 2013 +0200
> # Node ID 4ae43f52046fa8309f9ce9b2427939049177ad33
> # Parent  1c58e368fbfd0baa3113ef728a67b53655db3c4e
> generaldelta: make test platform-independent
> 
> du -b option illegal on Mac OS and probably other BSD-like systems.

Already fixed a few hours ago:

http://www.selenic.com/hg/rev/2c886dedd902

Patch

diff --git a/tests/test-generaldelta.t b/tests/test-generaldelta.t
--- a/tests/test-generaldelta.t
+++ b/tests/test-generaldelta.t
@@ -16,8 +16,7 @@ 
   >   hg pull . -q -r $r -R ../gdrepo
   > done
   $ cd ..
-  $ regsize=`du -s -b repo/.hg/store/00manifest.i | cut -f 1`
-  $ gdsize=`du -s -b gdrepo/.hg/store/00manifest.i | cut -f 1`
-  $ if [ $regsize -lt $gdsize ]; then
-  >   echo 'generaldelta increased size of a revlog!'
-  > fi
+  >>> import os.path
+  >>> regsize = os.path.getsize('repo/.hg/store/00manifest.i')
+  >>> gdsize = os.path.getsize('gdrepo/.hg/store/00manifest.i')
+  >>> if regsize < gdsize: print 'generaldelta increased size of a revlog!'