This is an archive of the discontinued Mercurial Phabricator instance.

narrow: validate spec files are well-formed during clone (BC)
ClosedPublic

Authored by indygreg on Sep 11 2018, 2:52 PM.

Details

Summary

Previously, specfiles would get read then normalized. We want
specfiles to be normalized on read so there is no confusion about
what the format of specfiles should be.

This commit validates the parsed result of --specfile. If entries
aren't prefixed, an error is raised.

Previously, validation would occur at exchange time, hence why we
dropped a line of test output related to server iteraction.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Sep 11 2018, 2:52 PM
martinvonz added inline comments.
tests/test-narrow-clone-no-ellipsis.t
133

Maybe "file:" was just a typo for "path:" so it's better to replace it by "path:" (instead of having both)?

tests/test-narrow-clone.t
281

Any idea why this changed? Should it actually change in this patch?

indygreg updated this revision to Diff 10898.Sep 11 2018, 6:29 PM
indygreg added inline comments.Sep 11 2018, 6:36 PM
tests/test-narrow-clone-no-ellipsis.t
133

I was wondering about that too. I agree it feels wrong. I didn't feel like spending the brain cycles on it.

tests/test-narrow-clone.t
281

It changed because there are multiple layers of validation. And the layer added by this patch occurs before the validation is performed in the exchange layer (the exchange layer is what's printing the removed line).

The new behavior feels better to me because it fails faster.

martinvonz accepted this revision.Sep 11 2018, 6:38 PM
This revision is now accepted and ready to land.Sep 11 2018, 6:38 PM
This revision was automatically updated to reflect the committed changes.