[PATCH 1 of 5] Add a test for the Branch header being in hg export
Eric Hopper
hopper at omnifarious.org
Thu May 17 21:29:56 UTC 2007
On Thu, May 17, 2007 at 02:13:56PM -0700, Eric Hopper wrote:
> On Thu, May 17, 2007 at 11:26:07AM -0700, Eric Hopper wrote:
> > On 5/17/07, Brendan Cully <brendan at kublai.com> wrote:
> > >
> > >On Thursday, 17 May 2007 at 09:43, hopper at omnifarious.org wrote:
> > >> # HG changeset patch
> > >> # User Eric Hopper <hopper at omnifarious.org>
> > >> # Date 1179417131 25200
> > >> # Node ID 32486cd3207b70bbbb16b336c566ec8246ee760d
> > >> # Parent a764edb6fc952e620438a6c7a8cc10bcffe80039
> > >> Add a test for the Branch header being in hg export.
> > >
> > >hmm, fails here:
> > >
> > >ERROR: test-impexp-branch output changed
> > >--- Expected output
> > >+++ Test output
> > >@@ -1,2 +1,3 @@
> > >applying patch from stdin
> > >applying patch from stdin
> > >+abort: no diffs found
> > >
> > >ERROR: test-impexp-branch failed with error code 65280
> >
> > That's very interesting. If you look at the test code, there is no way that
> > error should be happening. It doesn't happen for me, obviously, or I
> > wouldn't have sent in this patch.
>
> I was able to re-create this problem on one of my Linux boxes.
>
> This represents some sort of bizarre race condition. The 'a' repository
> ends up committing an empty change sometimes. Putting in a 'sleep 1'
> before the 'hg branch abranch' command makes the problem go away on my
> system.
Oh! I know what the race condition is! Hah!
It's that the dirstate uses file size and mod time as the first level
key to decide if a file has changed. The code runs fast enough that all
those operations are completed in less than a second, and the neither
the mod time nor the file size changes.
My little Powerbook G4 laptop wasn't quite fast enough, or more detailed
mod times are kept on hfs or something. So the problem never appeared
there.
Changing:
echo "Rev 2" >rev
to:
echo "Rev 2" >rev
also fixes the problem without the sleep. :-)
Have fun (if at all possible),
--
"It does me no injury for my neighbor to say there are twenty gods or no God.
It neither picks my pocket nor breaks my leg." --- Thomas Jefferson
"Go to Heaven for the climate, Hell for the company." -- Mark Twain
-- Eric Hopper (http://www.omnifarious.org/~hopper) --
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-devel/attachments/20070517/d489e52c/attachment.asc>
More information about the Mercurial-devel
mailing list