Patchwork [1,of,2,evolve-ext] test-evolve-bumped: improve tests legibility

login
register
mail settings
Submitter Laurent Charignon
Date June 20, 2015, 1:38 a.m.
Message ID <bd83396dd93f1c13efdb.1434764303@schmidt-mbp.dhcp.thefacebook.com>
Download mbox | patch
Permalink /patch/9723/
State Accepted
Delegated to: Pierre-Yves David
Headers show

Comments

Laurent Charignon - June 20, 2015, 1:38 a.m.
# HG changeset patch
# User Laurent Charignon <lcharignon@fb.com>
# Date 1434762991 25200
#      Fri Jun 19 18:16:31 2015 -0700
# Node ID bd83396dd93f1c13efdba3140c2a92c6aed2be9f
# Parent  8794a4680bdd78fe9e452611797f9b018fc031df
test-evolve-bumped: improve tests legibility

This patch introduces in test-evolve-bumped some of the test helpers that we
use in other tests to make the code more legible.
Pierre-Yves David - June 22, 2015, 10:07 p.m.
On 06/19/2015 06:38 PM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon@fb.com>
> # Date 1434762991 25200
> #      Fri Jun 19 18:16:31 2015 -0700
> # Node ID bd83396dd93f1c13efdba3140c2a92c6aed2be9f
> # Parent  8794a4680bdd78fe9e452611797f9b018fc031df
> test-evolve-bumped: improve tests legibility
>
> This patch introduces in test-evolve-bumped some of the test helpers that we
> use in other tests to make the code more legible.
>
> diff --git a/tests/test-evolve-bumped.t b/tests/test-evolve-bumped.t
> --- a/tests/test-evolve-bumped.t
> +++ b/tests/test-evolve-bumped.t
> @@ -1,6 +1,11 @@
>     $ hg init public
>     $ cd public
>     $ echo a > a
> +  $ mkcommit() {
> +  >    echo "$1" > "$1"
> +  >    hg add "$1"
> +  >    hg ci -m "add $1"
> +  > }

This want to be in the next changesets, doesn't it?
Laurent Charignon - June 22, 2015, 10:16 p.m.
> On Jun 22, 2015, at 3:07 PM, Pierre-Yves David <pierre-yves.david@ens-lyon.org> wrote:
> 
> 
> 
> On 06/19/2015 06:38 PM, Laurent Charignon wrote:
>> # HG changeset patch
>> # User Laurent Charignon <lcharignon@fb.com>
>> # Date 1434762991 25200
>> #      Fri Jun 19 18:16:31 2015 -0700
>> # Node ID bd83396dd93f1c13efdba3140c2a92c6aed2be9f
>> # Parent  8794a4680bdd78fe9e452611797f9b018fc031df
>> test-evolve-bumped: improve tests legibility
>> 
>> This patch introduces in test-evolve-bumped some of the test helpers that we
>> use in other tests to make the code more legible.
>> 
>> diff --git a/tests/test-evolve-bumped.t b/tests/test-evolve-bumped.t
>> --- a/tests/test-evolve-bumped.t
>> +++ b/tests/test-evolve-bumped.t
>> @@ -1,6 +1,11 @@
>>    $ hg init public
>>    $ cd public
>>    $ echo a > a
>> +  $ mkcommit() {
>> +  >    echo "$1" > "$1"
>> +  >    hg add "$1"
>> +  >    hg ci -m "add $1"
>> +  > }
> 
> This want to be in the next changesets, doesn't it?

Sure, if you want to.
I put it here because it was in the theme of "adding new helpers" so that the next patch only adds a test.

Thanks,

Laurent

> 
> -- 
> Pierre-Yves David

Patch

diff --git a/tests/test-evolve-bumped.t b/tests/test-evolve-bumped.t
--- a/tests/test-evolve-bumped.t
+++ b/tests/test-evolve-bumped.t
@@ -1,6 +1,11 @@ 
   $ hg init public
   $ cd public
   $ echo a > a
+  $ mkcommit() {
+  >    echo "$1" > "$1"
+  >    hg add "$1"
+  >    hg ci -m "add $1"
+  > }
   $ hg commit -A -m init
   adding a
   $ cd ..
@@ -11,6 +16,8 @@ 
   $ cat >> .hg/hgrc <<EOF
   > [extensions]
   > evolve = $evolvepath
+  > [ui]
+  > logtemplate = {rev}:{node|short}@{branch}({phase}) {desc|firstline}\n
   > [phases]
   > publish = false
   > EOF
@@ -32,12 +39,7 @@ 
   adding file changes
   added 1 changesets with 1 changes to 1 files
   $ hg log -r 'draft()'
-  changeset:   1:4d1169d82e47
-  tag:         tip
-  user:        alice
-  date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     modify a
-  
+  1:4d1169d82e47@default(draft) modify a
 
   $ cd ../bob
   $ hg pull ../private
@@ -49,12 +51,7 @@ 
   added 1 changesets with 1 changes to 1 files
   (run 'hg update' to get a working copy)
   $ hg log -r 'draft()'
-  changeset:   1:4d1169d82e47
-  tag:         tip
-  user:        alice
-  date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     modify a
-  
+  1:4d1169d82e47@default(draft) modify a
   $ hg push ../public
   pushing to ../public
   searching for changes