Patchwork [1,of,4] tests: simplify command script in 'test-push-r.t'

login
register
mail settings
Submitter Pierre-Yves David
Date Nov. 3, 2016, 8:35 a.m.
Message ID <88c6789dedad1ca6bf4d.1478162118@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/17313/
State Accepted
Headers show

Comments

Pierre-Yves David - Nov. 3, 2016, 8:35 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1478145934 -3600
#      Thu Nov 03 05:05:34 2016 +0100
# Node ID 88c6789dedad1ca6bf4d4323b7332e76f233b531
# Parent  6a8aff737a17ada068b8ce4501184eacc66e827f
# EXP-Topic pushtest
tests: simplify command script in 'test-push-r.t'

I came across this code by chance. The script of this test is a bit messy with a
lot of unnecessary intermediate commands. We simplify the script and unify
repository access through '-R'.

In the process the update after the unbundle is dropped as it does not add
anything to the tests.
Yuya Nishihara - Nov. 4, 2016, 4:05 a.m.
On Thu, 03 Nov 2016 09:35:18 +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1478145934 -3600
> #      Thu Nov 03 05:05:34 2016 +0100
> # Node ID 88c6789dedad1ca6bf4d4323b7332e76f233b531
> # Parent  6a8aff737a17ada068b8ce4501184eacc66e827f
> # EXP-Topic pushtest
> tests: simplify command script in 'test-push-r.t'

Seems fine. Queued the series, thanks.

Patch

diff --git a/tests/test-push-r.t b/tests/test-push-r.t
--- a/tests/test-push-r.t
+++ b/tests/test-push-r.t
@@ -1,23 +1,16 @@ 
   $ hg init test
-  $ cd test
-  $ hg unbundle "$TESTDIR/bundles/remote.hg"
+  $ hg -R test unbundle "$TESTDIR/bundles/remote.hg"
   adding changesets
   adding manifests
   adding file changes
   added 9 changesets with 7 changes to 4 files (+1 heads)
   (run 'hg heads' to see heads, 'hg merge' to merge)
-  $ hg up tip
-  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ cd ..
 
   $ for i in 0 1 2 3 4 5 6 7 8; do
   >    echo
-  >    mkdir test-"$i"
-  >    hg --cwd test-"$i" init
+  >    hg init test-"$i"
   >    hg -R test push -r "$i" test-"$i"
-  >    cd test-"$i"
-  >    hg verify
-  >    cd ..
+  >    hg -R test-"$i" verify
   > done
   
   pushing to test-0