[PATCH] test-revert: add revert --all case when nothing changed

Adrian Buehlmann adrian at cadifra.com
Tue Jun 28 00:54:08 CDT 2011


On 2011-06-28 01:14, Augie Fackler wrote:
> On Jun 27, 2011, at 6:04 PM, Adrian Buehlmann wrote:
>>
>> # HG changeset patch
>> # User Adrian Buehlmann <adrian at cadifra.com>
>> # Date 1309215393 -7200
>> # Branch stable
>> # Node ID 67c7e452fcc21bdd9b5b5aca0f0926650336ab1e
>> # Parent  1e6661e098182cbb8e3cf90c9d77d27d277a2823
>> test-revert: add revert --all case when nothing changed
>>
>> supposed to succeed without notice
>>
>> diff --git a/tests/test-revert.t b/tests/test-revert.t
>> --- a/tests/test-revert.t
>> +++ b/tests/test-revert.t
>> @@ -12,6 +12,7 @@
>>   abort: no files or directories specified
>>   (use --all to revert all files)
>>   [255]
> 
> I might be inclined to put a little comment here that you're expecting no change and success, just for completeness so future readers don't have to do a blame to figure out why this line is here.
> 
>> +  $ hg revert --all

IMHO, such a comment is quite pointless noise since

<excerpt>
  $ hg commit -m "first" a c e

nothing changed

  $ hg revert
  abort: no files or directories specified
  (use --all to discard all changes)
  [255]
  $ hg revert --all

  $ echo 123 > b

should show b unknown
</excerpt>

is explicit enough.

Why do you want to repeat in text again that 'hg revert --all' is
supposed to succeed without notice if the test documents that explicitly
already?

If I see

  $ hg revert --all
  <blank line>

in this .t file what else is supposed to happen than succeeding without
notice?

It's both already documented and automatically checked.

Such a comment adds nothing than the danger that it will become async in
the future.

A burden to maintain without any gain.






More information about the Mercurial-devel mailing list