[PATCH STABLE] tests: run "cwd was removed" test only if cwd can actually be removed
Yuya Nishihara
yuya at tcha.org
Thu Oct 27 08:15:06 EDT 2016
On Wed, 26 Oct 2016 07:39:14 -0700, Danek Duvall wrote:
> Yuya Nishihara wrote:
>
> > # HG changeset patch
> > # User Yuya Nishihara <yuya at tcha.org>
> > # Date 1477489806 -32400
> > # Wed Oct 26 22:50:06 2016 +0900
> > # Branch stable
> > # Node ID d389b88b942adb330819437ef46d1b9acb4392d7
> > # Parent b9f7b0c10027764cee77f9c6d61877fcffea837f
> > tests: run "cwd was removed" test only if cwd can actually be removed
> >
> > On some platforms, cwd can't be removed. In which case, util.unlinkpath()
> > continues with no error since the failure isn't critical.
>
> The problem here is a bit more specific: while Linux (for example) prevents
> you from removing cwd when referring to it as ".", Solaris prevents you
> from removing it under all names. So because that failure isn't critical,
> the cwd ends up remaining behind on Solaris because it's done via the full
> path. It might make sense to be more specific in the name, too, though I'm
> not sure what to suggest.
Yes, 'rmdir .' is prevented even on Linux. Since I have no better name, I
just added some comments.
> There's also a second test that has some related output:
>
> --- a/tests/test-rebase-scenario-global.t
> +++ b/tests/test-rebase-scenario-global.t
> @@ -758,8 +758,6 @@ Test that rebase is not confused by $CWD
> $ hg commit -m 'second source with subdir'
> $ hg rebase -b . -d 1 --traceback
> rebasing 2:779a07b1b7a0 "first source commit"
> - current directory was removed
> - (consider changing to repo root: $TESTTMP/cwd-vanish)
> rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip)
> saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip-backup/779a07b1b7a0-853e0073-backup.hg (glob)
Oops, fixed in V2.
More information about the Mercurial-devel
mailing list