Patchwork D12100: obsolete: make sure windows tests pass when stat() is given a URL

login
register
mail settings
Submitter phabricator
Date Jan. 28, 2022, 5:39 p.m.
Message ID <differential-rev-PHID-DREV-olisttq62re7h7jdtgz4-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50424/
State New
Headers show

Comments

phabricator - Jan. 28, 2022, 5:39 p.m.
av6 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This is a band-aid for test-static-http.t breakage on windows.
  
  On windows this exception is not ENOENT, but EINVAL (because of `:` symbol, for
  example).
  
  The real issue here is not using statichttpvfs for accessing obsstore, but I
  didn't find the root cause of that yet.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12100

AFFECTED FILES
  mercurial/obsolete.py

CHANGE DETAILS




To: av6, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -583,7 +583,7 @@ 
             try:
                 return self.svfs.stat(b'obsstore').st_size > 1
             except OSError as inst:
-                if inst.errno != errno.ENOENT:
+                if inst.errno not in (errno.ENOENT, errno.EINVAL):
                     raise
                 # just build an empty _all list if no obsstore exists, which
                 # avoids further stat() syscalls