Bug 5840 - Infinitepush has missing bookmark issues on Windows
Summary: Infinitepush has missing bookmark issues on Windows
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: default branch
Hardware: PC Windows
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-18 00:39 UTC by Matt Harbison
Modified: 2018-05-08 00:00 UTC (History)
2 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Harbison 2018-04-18 00:39 UTC
I'm trying to track down the test failures, and most seem to be aborts because the remote bookmark is missing.  Here's a diff on Windows, against the output where it works on Linux, with debugging output on.  Note the 'listkey for "bookmarks"' went to 0 bytes on Windows.  The first line in the diff is a test I added to list the bookmarks on the main repo.  (At least I think it is.  It says no repo found if I drop $TESTTMP, but the other repos in that directory are client{,2,3}.)  I'm not sure why it shows no bookmarks on both platforms.

$ hg diff
diff --git a/tests/test-infinitepush.t b/tests/test-infinitepush.t
--- a/tests/test-infinitepush.t
+++ b/tests/test-infinitepush.t
@@ -75,7 +75,7 @@ Pull two bookmarks from the second clien
   $ hg book -R $TESTTMP/repo
   no bookmarks set
   $ hg pull -B scratch/firstpart -B scratch/secondpart --debug
-  running python "/home/matt/hg/tests/dummyssh" 'user@dummy' 'hg -R repo serve --stdio'
+  running python "c:\Users\Matt\projects\hg\tests/dummyssh" "user@dummy" "hg -R repo serve --stdio"
   sending hello command
   sending between command
   remote: 436
@@ -84,58 +84,20 @@ Pull two bookmarks from the second clien
   sending protocaps command
   preparing listkeys for "bookmarks" with pattern "{'scratch/secondpart': 'REVTOFETCH', 'scratch/firstpart': 'REVTOFETCH'}"
   sending listkeyspatterns command
-  received listkey for "bookmarks": 118 bytes
-  pulling from ssh://user@dummy/repo
-  running python "/home/matt/hg/tests/dummyssh" 'user@dummy' 'hg -R repo serve --stdio'
-  sending hello command
-  sending between command
-  remote: 436
-  remote: capabilities: batch branchmap bundle2=HG20%0Ab2x%253Ainfinitepush%0Abookmarks%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Aphases%3Dheads%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps%0Arev-branch-cache changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
-  remote: 1
-  sending protocaps command
-  sending lookup command
-  sending lookup command
-  query 1; heads
-  sending batch command
-  searching for changes
-  all remote heads known locally
-  sending getbundle command
-  bundle2-input-bundle: with-transaction
-  bundle2-input-part: "changegroup" (params: 1 mandatory) supported
-  adding changesets
-  add changeset 8db3891c220e
-  adding manifests
-  adding file changes
-  adding scratchsecondpart revisions
-  added 1 changesets with 1 changes to 1 files
-  bundle2-input-part: total payload size 548
-  bundle2-input-part: "changegroup" (params: 1 mandatory) supported
-  adding changesets
-  add changeset 176993b87e39
-  adding manifests
-  adding file changes
-  adding scratchfirstpart revisions
-  added 1 changesets with 1 changes to 1 files (+1 heads)
-  bundle2-input-part: total payload size 543
-  bundle2-input-part: "listkeys" (params: 1 mandatory) supported
-  bundle2-input-part: "phase-heads" supported
-  bundle2-input-part: total payload size 48
-  bundle2-input-part: "cache:rev-branch-cache" supported
-  bundle2-input-bundle: 4 parts total
-  checking for updated bookmarks
-  updating the branch cache
-  new changesets * (glob)
-  (run 'hg heads' to see heads, 'hg merge' to merge)
+  received listkey for "bookmarks": 0 bytes
+  abort: remote bookmark scratch/secondpart not found!
+  [255]
   $ hg log -r scratch/secondpart -T '{node}'
-  8db3891c220e216f6da214e8254bd4371f55efca (no-eol)
+  abort: unknown revision 'scratch/secondpart'!
+  [255]
   $ hg log -r scratch/firstpart -T '{node}'
-  176993b87e39bd88d66a2cccadabe33f0b346339 (no-eol)
+  abort: unknown revision 'scratch/firstpart'!
+  [255]
 Make two commits to the scratch branch

   $ echo testpullbycommithash1 > testpullbycommithash1
   $ hg ci -Am "testpullbycommithash1"
   adding testpullbycommithash1
-  created new head
   $ hg log -r '.' -T '{node}\n' > ../testpullbycommithash1
   $ echo testpullbycommithash2 > testpullbycommithash2
   $ hg ci -Aqm "testpullbycommithash2"
Comment 1 HG Bot 2018-04-30 20:05 UTC
Fixed by https://mercurial-scm.org/repo/hg/rev/51dee6fad783
Matt Harbison <matt_harbison@yahoo.com>
infinitepush: ensure fileindex bookmarks use '/' separators (issue5840)

After loading up with status messages, I noticed that the subsequent matcher was
rejecting 'scratch\mybranch' on Windows.  No bookmarks were reported back, and
the tests subsequently failed.  I did a search for 'match', and nothing else
looks like it needs to be fixed up, but someone who understands this code should
also take a look.

I also tried setting `infinitepush.branchpattern=re:scratch\\.*` in
library-infinitepush.sh without this change, but that didn't work.  Still,
should we ban '\' in these bookmarks to avoid confusion?  I thought I saw code
that sandwiches a pattern between 're:^' and '.*', so perhaps regex characters
will need special care?

I also noticed comments in externalbundlestore.{read,write} that it won't work
on Windows because of opening an open file.  But I don't see a test failure, so
this may lack test coverage.

(please test the fix)
Comment 2 Bugzilla 2018-05-08 00:00 UTC
Bug was set to TESTING for 7 days, resolving