test-mq-strip.t fails on Windows MSYS - bookmarks not updated
Adrian Buehlmann
adrian at cadifra.com
Tue May 22 13:15:55 CDT 2012
On 2012-05-22 12:39, Mads wrote:
> On 22/05/12 10:38, Adrian Buehlmann wrote:
>> using d0b9ebba41e9 from default
>>
>> --- c:\users\adi\hgrepos\hg-main\tests\test-mq-strip.t
>> +++ c:\users\adi\hgrepos\hg-main\tests\test-mq-strip.t.err
>> @@ -458,6 +458,7 @@
>> $ hg bookmarks
>> B 9:ff43616e5d0f
>> delete 6:2702dd0c91e7
>> + * todelete 8:d62d843c9a01
>> $ hg strip -B delete
>> saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
>> bookmark 'delete' deleted
>>
>>
>> This test failure first appears with:
>>
>> changeset: 16718:3290e24bb3f0
>> parent: 16716:0311a6abd38a
>> user: David Soria Parra<dsp at php.net>
>> date: Sun May 13 16:39:40 2012 +0200
>> summary: strip: introduce -B option to remove a bookmark
>
> The parameter in
> repo._writebookmarks(marks)
> is unused. That seems suspicious. Explicitly setting
> repo._bookmarks = marks
> in mq.py before writing bookmarks do that .hg/bookmarks is updated again.
>
> I don't know why it works on unix. Perhaps some side effect of different
> fstats and thus different cache reloading that do that the marks are
> modified in place and thus rewritten?
>
> (((
> btw: Why do we have ui.write "bookmark '%s' deleted" - that is what the
> user explicitly requested, so I would expect that Mercurial did it silently.
>
> It also seems "interesting" that a strip of bookmark referencing a
> non-leaf revision remove the bookmark but doesn't strip anything and
> aborts. I would expect it to either fail completely (preferred) or just
> remove the bookmark and return with success (less preferred).
> )))
Yeah. And mq.py has in line 2958 (function strip):
if not revs:
del marks[mark]
repo._writebookmarks(mark) <----
ui.write(_("bookmark '%s' deleted\n") % mark)
which was probably meant to be
repo._writebookmarks(marks)
but since that parameter is ignored anyway, changing that doesn't help.
Finally, if I do
diff --git a/mercurial/posix.py b/mercurial/posix.py
--- a/mercurial/posix.py
+++ b/mercurial/posix.py
@@ -455,6 +455,7 @@
self.stat = os.stat(path)
def cacheable(self):
+ return False
return bool(self.stat.st_ino)
__hash__ = object.__hash__
(in class cachestat of posix.py), then the test fails on Linux in the
same way as it fails on Windows.
More information about the Mercurial-devel
mailing list