[PATCH STABLE] import: mark --exact as experimental

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Feb 26 23:18:35 UTC 2016



On 02/26/2016 09:17 PM, Matt Mackall wrote:
> On Thu, 2016-02-25 at 11:12 -0500, Augie Fackler wrote:
>> On Thu, Feb 25, 2016 at 10:53:26AM +0100, Pierre-Yves David wrote:
>>> # HG changeset patch
>>> # User Pierre-Yves David <pierre-yves.david at fb.com>
>>> # Date 1456060026 -3600
>>> #      Sun Feb 21 14:07:06 2016 +0100
>>> # Branch stable
>>> # Node ID a412b87ce53add0d4304de0170140bff1dc266b3
>>> # Parent  cb6a952efbf48d306a7c82d7fe46115f072cbb1d
>>> # EXP-Topic expexact
>>> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
>>> #              hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r
>>> a412b87ce53a
>>> import: mark --exact as experimental
>>
>> +1, but I'm unsure if it belongs on stable. Matt?
>
> I don't like this at all, sorry.
>
> It works as advertised:
>
>     If --exact is specified, import will set the working directory to the
>      parent of each patch before applying it, and will abort if the resulting
>      changeset has a different ID than the one recorded in the patch. This may
>      happen due to character set problems or other deficiencies in the text
>      patch format.
>
> This feature has never been a promise to perfectly transfer every possible
> changeset. We've never been able to do that and it's unlikely that we ever will.
> And extra fields aren't even a significant obstacle to that.
>
> Instead this feature is a promise to perfectly transfer OR REJECT anything that
> isn't perfectly transferred. So everything you apparently think is a bug is
> actually it doing its data-integrity-protecting job.

Okay, that precise feature work as advertised "A perfect importer with 
integrity check". And integrity check are cool, their are not what I'm 
calling a bug here. The issue lies in the fact that this perfect 
importer is pretty much useless to anyone because we don't really have a 
perfect exported. 'hg export' is the best patch generator around, and it 
is unable to produce a patch that will pass 'hg import --exact' in most 
case.

'hg import --exact' does not exists in the vacum, people who attempt to 
use it pretty much always try to use it in conjunction with 'hg export'. 
As 'hg export' does not produce good content -for-simple-case-, this 
whole feature line breaks. It is useless and frustrating to all users 
I've seen trying to use this feature.

Of course there will be corner case with various encoding stuff or other 
special case where 'hg export | hg import --exact' might break. But we 
are talking about common case here.

And, I insist, the common case is broken. 'hg export' does not convey 
the content of the 'extra' fields (except for a couple of exception). 
This make the generated patch omit important information that are part 
of the node idea. Dooming the patch to never pass 'hg import --exact'. 
And such extra field are not corner cases. In the last 1000 changesets 
in main, there is 872 usage of unexpected extra. This make less that 15% 
of the last changesets in Mercurial own repository able to pass a simple 
'hg export | hg import --exact'.

To conclude, this feature chain is currently broken in the common case. 
Extra are currently the most significant reason for this breakage. There 
is various way to solve the extra problem once and for all and reinstall 
this feature chain to its full glory. In the mean time I would like to 
mark this flag as EXPERIMENTAL to prevent unsuspecting user to find it, 
expect it to be useful and finally, be deceived

Cheers,

-- 
Pierre-Yves David



More information about the Mercurial-devel mailing list