D3433: httppeer: detect redirect to URL without query string (issue5860)

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Tue May 1 14:07:21 UTC 2018


mharbison72 added a comment.


  This fixes the issue, thanks again.  The only thing I noticed in practice is that the "real URL is xxx" notice is printed twice.  The trace looks sane, (and the test captures this too), so I think it's purely cosmetic.  The *.t test fails on Windows though:
  
    --- e:/Projects/hg/tests/test-http-protocol.t
    +++ e:/Projects/hg/tests/test-http-protocol.t.err
    @@ -395,19 +395,42 @@
       s>     Content-Length: 10\r\n
       s>     \r\n
       s>     redirected
    -  s>     GET /redirected?cmd=capabilities HTTP/1.1\r\n
    -  s>     Accept-Encoding: identity\r\n
    -  s>     user-agent: test\r\n
    -  s>     host: $LOCALIP:$HGPORT\r\n (glob)
    -  s>     \r\n
    -  s> makefile('rb', None)
    -  s>     HTTP/1.1 200 Script output follows\r\n
    -  s>     Server: testing stub value\r\n
    -  s>     Date: $HTTP_DATE$\r\n
    -  s>     Content-Type: application/mercurial-0.1\r\n
    -  s>     Content-Length: 453\r\n
    -  s>     \r\n
    -  s>     batch branchmap $USUAL_BUNDLE2_CAPS_SERVER$ changegroupsubset compression=$BUNDLE2_COMPRESSIONS$ get
    bundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 u
    nbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
    +  ** Unknown exception encountered with possibly-broken third-party extension drawdag
    +  ** which supports versions unknown of Mercurial.
    +  ** Please disable drawdag and try your action again.
    +  ** If that fixes the bug please report it to the extension author.
    +  ** Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)]
    +  ** Mercurial Distributed SCM (version 4.6rc1+5-80695628adcb)
    +  ** Extensions loaded: drawdag
    +  Traceback (most recent call last):
    +    File "e:/Projects/hg/hg", line 41, in <module>
    +      dispatch.run()
    +    File "e:\Projects\hg\mercurial\dispatch.py", line 90, in run
    +      status = (dispatch(req) or 0)
    +    File "e:\Projects\hg\mercurial\dispatch.py", line 210, in dispatch
    +      ret = _runcatch(req)
    +    File "e:\Projects\hg\mercurial\dispatch.py", line 351, in _runcatch
    +      return _callcatch(ui, _runcatchfunc)
    +    File "e:\Projects\hg\mercurial\dispatch.py", line 359, in _callcatch
    +      return scmutil.callcatch(ui, func)
    +    File "e:\Projects\hg\mercurial\scmutil.py", line 160, in callcatch
    +      return func()
    +    File "e:\Projects\hg\mercurial\dispatch.py", line 341, in _runcatchfunc
    +      return _dispatch(req)
    +    File "e:\Projects\hg\mercurial\dispatch.py", line 971, in _dispatch
    +      cmdpats, cmdoptions)
    +    File "e:\Projects\hg\mercurial\dispatch.py", line 727, in runcommand
    +      ret = _runcommand(ui, options, cmd, d)
    +    File "e:\Projects\hg\mercurial\dispatch.py", line 979, in _runcommand
    +      return cmdfunc()
    +    File "e:\Projects\hg\mercurial\dispatch.py", line 968, in <lambda>
    +      d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
    +    File "e:\Projects\hg\mercurial\util.py", line 1553, in check
    +      return func(*args, **kwargs)
    +    File "e:\Projects\hg\mercurial\debugcommands.py", line 3091, in debugwireproto
    +      e.read()
    +  AttributeError: 'URLError' object has no attribute 'read'
    +  [1]

REPOSITORY
  rHG Mercurial

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

To: indygreg, #hg-reviewers
Cc: mharbison72, mercurial-devel


More information about the Mercurial-devel mailing list