Patchwork D6079: tests: simplify test-uncommit.t by removing an unnecessary commit

login
register
mail settings
Submitter phabricator
Date March 6, 2019, 11:50 p.m.
Message ID <differential-rev-PHID-DREV-wzycs7ecqambp4t44zpj-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/39114/
State Superseded
Headers show

Comments

phabricator - March 6, 2019, 11:50 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  I don't see what value the first commit adds in the test for issue
  5977, so let's remove it.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6079

AFFECTED FILES
  tests/test-uncommit.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - March 7, 2019, 12:30 p.m.
pulkit added inline comments.

INLINE COMMENTS

> test-uncommit.t:483
> -  A b
> -  $ hg unc a
> -  note: keeping empty commit

I skimmed through the whole file and could not find a case where we do `hg uncommit PATH` on a dirty wdir and PATH is not dirty in wdir. So I think it's better to have this test.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6079

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - March 7, 2019, 4:41 p.m.
martinvonz added inline comments.

INLINE COMMENTS

> pulkit wrote in test-uncommit.t:483
> I skimmed through the whole file and could not find a case where we do `hg uncommit PATH` on a dirty wdir and PATH is not dirty in wdir. So I think it's better to have this test.

Ohh, I didn't even realize that was allowed! :) And I obviously agree with testing that in that case.  Could we have a separate test description for that then (so it's not just part of "--allow-dirty-working-copy should also work on a dirty PATH")?

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6079

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel

Patch

diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t
--- a/tests/test-uncommit.t
+++ b/tests/test-uncommit.t
@@ -474,42 +474,21 @@ 
   $ hg init issue5977
   $ cd issue5977
   $ echo 'super critical info!' > a
-  $ hg ci -Am 'add a'
+  $ echo 'foo' > b
+  $ hg ci -Am 'add b'
   adding a
-  $ echo 'foo' > b
-  $ hg add b
-  $ hg status
-  A b
-  $ hg unc a
-  note: keeping empty commit
-  $ cat a
-  super critical info!
-  $ hg log
-  changeset:   1:656ba143d384
-  tag:         tip
-  parent:      -1:000000000000
-  user:        test
-  date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     add a
-  
-  $ hg ci -Am 'add b'
+  adding b
   $ echo 'foo bar' > b
   $ hg unc b
   abort: uncommitted changes
   (requires --allow-dirty-working-copy to uncommit)
   [255]
   $ hg unc --allow-dirty-working-copy b
   $ hg log
-  changeset:   3:30fa958635b2
+  changeset:   1:0aa852043fdc
   tag:         tip
-  parent:      1:656ba143d384
+  parent:      -1:000000000000
   user:        test
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     add b
   
-  changeset:   1:656ba143d384
-  parent:      -1:000000000000
-  user:        test
-  date:        Thu Jan 01 00:00:00 1970 +0000
-  summary:     add a
-