Testing fastimport: changeset IDs changed unexpectedly

Matt Mackall mpm at selenic.com
Thu May 14 17:02:41 CDT 2009


On Thu, May 14, 2009 at 05:58:00PM -0400, Greg Ward wrote:
> I'm overhauling hg-fastimport to use the convert extension as its
> backend, rather than reinventing the wheel.  It's coming along nicely,
> but I'm confused by a test failure.  (The hg-fastimport tests are in
> the same style as Mercurial's own tests, down to using run-tests.py --
> so this should be familiar.)
> 
> One of my simpler tests imports this fastimport dump:
> 
> """
> # define the contents of file foo.txt in commit :3
> blob
> mark :1
> data 12
> hello there
> 
> # contents of file ooga in commit :3
> blob
> mark :2
> data 11
> ooga booga
> 
> # and here is commit :3 itself
> commit refs/heads/master
> mark :3
> author Example <example at example.org> 1200000060 -0400
> committer Example <example at example.org> 1200000060 -0400
> data 17
> initial revision
> M 100644 :1 foo.txt
> M 100644 :2 ooga
> """
> 
> Note how everything that hg uses to compute the changeset ID is
> included in the fastimport stream.  Because of that, my test*.out
> files include changeset IDs, since they are the same every time the
> same stream is fastimported.  Or so I thought.  My test is failing
> like this:
> 
>  % hg log
> -o  changeset:   0:56c9f26e6c12
> +o  changeset:   0:9a4b81675bd1
>     user:        Example <example at example.org>
>     date:        Fri Jan 11 01:21:00 2008 +0400
>     files:       foo.txt ooga
> 
> The test script runs "hg manifest" and "hg cat" to test the contents
> of the changeset, not just the metadata.  And that all matches.
> 
> Is there a good reason why the changeset ID would change?  Granted,
> I've replaced the entire backend of hg-fastimport, so it's possible
> that something is subtly different.  But this test is pure ASCII, so
> it can't be encoding.  And I've only ever run it on Unix, so I doubt
> line endings are the culprit.  And whitespace stripping of the commit
> message is done in localrepo.commitctx(), and I'm pretty sure that
> both the old code and the new code goes through commitctx().
> 
> More curious than concerned,

Is this using the revamped commit code that showed up just now?

You should probably try hg debugdata .hg/store/00changelog.i <rev> to
get a precise dump of what's going into the changeset hash.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list