darcs

Patch 1921 add a test for applying a patch with an unclean tag

Title add a test for applying a patch with an unclean tag
Superseder Nosy List ganesh
Related Issues
Status accepted Assigned To
Milestone

Created on 2019-09-18.17:01:45 by ganesh, last changed 2019-09-26.18:08:51 by bfrk.

Files
File name Status Uploaded Type Edit Remove
add-a-test-for-applying-a-patch-with-an-unclean-tag.dpatch dead ganesh, 2019-09-18.17:01:45 application/x-darcs-patch
add-a-test-for-applying-a-patch-with-an-unclean-tag.dpatch ganesh, 2019-09-22.20:28:31 application/x-darcs-patch
patch-preview.txt ganesh, 2019-09-18.17:01:45 text/x-darcs-patch
patch-preview.txt ganesh, 2019-09-22.20:28:31 text/x-darcs-patch
unnamed ganesh, 2019-09-18.17:01:45 text/plain
unnamed ganesh, 2019-09-22.20:28:31 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg21448 (view) Author: ganesh Date: 2019-09-18.17:01:45
I was trying to construct a test for the problem that
patch1901 fixes. In this case, darcs (pre-patch1901)
fails if the tag in the context of the bundle is unclean.

I didn't manage to construct a case where it breaks if
tag is missing, rather than just reporting its absence.

1 patch for repository darcs-unstable@darcs.net:screened:

patch 4ff33b06e4dd5ad34c216233b230de58baca4129
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Wed Sep 18 17:57:35 BST 2019
  * add a test for applying a patch with an unclean tag
Attachments
msg21456 (view) Author: bfrk Date: 2019-09-19.13:39:18
> I didn't manage to construct a case where it breaks if
> tag is missing, rather than just reporting its absence.

I think this is because in case of a missing tag it is pretty unlikely
to actually crash. What it does in this case is to unwrap all
tags/inventories and then merge the complete history with the new
patches (plus their bogus context). If that doesn't already crash then
we detect the missing tag and fail cleanly.

To get a crash you need to ensure that there are common patches (in the
context of the bundle and our repo) that depend on patches that are not
in the bundle so their can't be commuted to the common trunk.
msg21457 (view) Author: bfrk Date: 2019-09-19.13:43:22
> patch 4ff33b06e4dd5ad34c216233b230de58baca4129
> Author: Ganesh Sittampalam <ganesh@earth.li>
> Date:   Wed Sep 18 17:57:35 BST 2019
>   * add a test for applying a patch with an unclean tag

Please remember to always rm -rf any file or directory created by a test
before creating them, otherwise we cannot easily re-run the test.
msg21458 (view) Author: bfrk Date: 2019-09-19.13:49:18
Last remark: I find it clearer and mroe reliable to use a match flag and
--all instead of echo yyyd | ... even if in your case this means we have
to do two pulls:

echo 'yyyd' | darcs pull ../R

->

darcs pull ../R -a --tag=initial
darcs pull ../R -a -p 'A'
msg21535 (view) Author: ganesh Date: 2019-09-22.20:28:31
Updated version, I'll screen it now.

It was a real pain to get the patch matching options right.
Unless I get better at doing it quickly I am skeptical
it is worth the effort.

1 patch for repository darcs-unstable@darcs.net:screened:

patch 4d3777ada9102e3b15a91612a2d160712e92f409
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Sun Sep 22 21:33:04 BST 2019
  * add a test for applying a patch with an unclean tag
Attachments
msg21545 (view) Author: bfrk Date: 2019-09-23.12:11:23
> It was a real pain to get the patch matching options right.
> Unless I get better at doing it quickly I am skeptical
> it is worth the effort.

Sorry about that. For the future, please regard my comment as a mere
recommendation not a strict requirement. More tests are always a good thing.
msg21620 (view) Author: bfrk Date: 2019-09-26.18:08:51
I also checked that without the recent fix for this the test fails.

One more comment re matching options: using them should be easy.
I know it isn't, currently, and I think we should work on that.
History
Date User Action Args
2019-09-18 17:01:45ganeshcreate
2019-09-18 17:02:04ganeshsetstatus: needs-screening -> in-discussion
2019-09-19 13:39:19bfrksetmessages: + msg21456
2019-09-19 13:43:22bfrksetmessages: + msg21457
2019-09-19 13:49:18bfrksetmessages: + msg21458
2019-09-22 20:28:31ganeshsetfiles: + patch-preview.txt, add-a-test-for-applying-a-patch-with-an-unclean-tag.dpatch, unnamed
messages: + msg21535
2019-09-22 20:29:09ganeshsetstatus: in-discussion -> needs-review
2019-09-23 12:11:23bfrksetmessages: + msg21545
2019-09-26 18:08:51bfrksetstatus: needs-review -> accepted
messages: + msg21620