D2988: fix: use a portable python script instead of sed in test

2018-04-10 Thread mharbison72 (Matt Harbison)
mharbison72 added a comment. Any movement on this? There's a lot of test spew on Windows that this would cut out. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2988 To: hooper, #hg-reviewers Cc: durin42, mharbison72, mercurial-devel

[PATCH] tests: stabilize test-pull-bundle.t for Windows

2018-04-10 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1523415475 14400 # Tue Apr 10 22:57:55 2018 -0400 # Node ID 16cd8fe997579a6d4aecfe15b54daee3081610e7 # Parent 50ea07f04fd451faf27e14d914baf67eb51f15d5 tests: stabilize test-pull-bundle.t for Windows See 594dd384803c.

D3241: httppeer: only advertise partial-pull if capabilities are known

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We don't need to be advertising client protocol parameters as part of the capabilities request during the handshake because nothing in version 1 of the wire

D3237: httppeer: perform capabilities request in makepeer()

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Previously, we constructed an httppeer then always ran _fetchcaps() to issue the capabilities command. We want to issue the capabilities command before

D3236: httppeer: extract common response handling into own function

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This allows the common redirect detection, content type validation, and decompression wrapping to be usable outside of httppeer instances. REPOSITORY rHG

D3242: wireproto: define and implement HTTP handshake to upgrade protocol

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY When clients connect to repositories over HTTP, they issue a request to the well-known URL "?cmd=capabilities" to fetch the repository capabilities. This is

D3240: httppeer: always add x-hg* headers to Vary header

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Before, we manually updated the Vary header value for each header contributing to it. All X-Hg* headers are reserved for the Mercurial protocol and could

D3232: httppeer: move requestbuilder defaults into makepeer() argument

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Upcoming commits will move the initial ?cmd=capabilities handshake request out of httppeer so the handshake can be performed before a peer instance is

D3235: httppeer: move error handling and response wrapping into sendrequest

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is common for all HTTP requests. It should be part of sendrequest(). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3235

D3243: httppeer: support protocol upgrade

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY With the new handshake defined and in place on the server, we can now implement it on the client. The HTTP handshake mechanism has been taught to add

D3238: httppeer: allow opener to be passed to makepeer()

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This allows us to use makepeer() in `hg debugwireproto`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3238 AFFECTED FILES

D3239: httppeer: don't accept very old media types (BC)

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Versions of Mercurial older than 1.0 emitted the text/plain and application/hg-changegroup media types in response to wire protocol commands. Way back in

D3233: httppeer: extract code for performing an HTTP request

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is generic and doesn't need to live as a method of httppeer. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3233 AFFECTED

D3230: wireproto: extract HTTP version 2 code to own module

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY wireprotoserver has generic and version 1 server code. The wireproto module also has both version 1 and version 2 command implementations. Upcoming work I want

D3231: wireproto: move version 2 command handlers to wireprotov2server

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is relatively straightforward. As part of this, we introduced a local @wireprotocommand that wraps the main one and defines a v2 only policy by

D3234: httppeer: extract code for creating a request into own function

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Some of this feels awkward, such as having to pass in a function to evaluate a capability. And this code is generally pretty difficult to read. I didn't want

D3225: thirdparty: vendor futures 3.2.0

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg abandoned this revision. indygreg added a comment. I fired this off too soon :( REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3225 To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing

D3227: tests: silence pyflakes for thirdparty/concurrent

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It is complaining about unused imports. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3227 AFFECTED FILES

D3222: tests: extract wire protocol framing tests to own file

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I was lazy when I put these in test-wireproto-serverreactor.py. Let's do it properly. REPOSITORY rHG Mercurial REVISION DETAIL

D3223: wireproto: introduce a reactor for client-side state

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We have a nice state machine of sorts for reacting to server-side events. Now it is time to implement the client equivalent. We introduce a "clientreactor."

D3224: wireproto: client reactor support for receiving frames

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We can now feed received frames into the client reactor and it will validate their sanity, dispatch them appropriately. The hacky HTTP peer has been updated

D3225: thirdparty: vendor futures 3.2.0

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Python 3 has a concurrent.futures package in the standard library for representing futures. The "futures" package on PyPI is a backport of this package to work

D3208: wireproto: disallow commands handlers for multiple transport versions

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 7939. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3208?vs=7912=7939 REVISION DETAIL https://phab.mercurial-scm.org/D3208 AFFECTED FILES mercurial/wireproto.py CHANGE DETAILS diff --git

D3226: futures: get rid of extend_path

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is used so mutliple directories can provide a package. We don't need it when vendoring. REPOSITORY rHG Mercurial REVISION DETAIL

D3229: setup: add packages for concurrent.futures

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We conceivably don't need to distribute this package on Python 3 since we will use the version in the standard library. However, we want installs to be usable

D3228: futures: switch to absolute and relative imports

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This makes the package conform with our importing policy, silencing a number of warnings. It also makes the package usable when it isn't named

D3206: wireproto: only expose "getbundle" and "unbundle" to v1 transports

2018-04-10 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 7938. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3206?vs=7910=7938 REVISION DETAIL https://phab.mercurial-scm.org/D3206 AFFECTED FILES mercurial/wireproto.py tests/test-http-api-httpv2.t

D3212: patch: implement a new worddiff algorithm

2018-04-10 Thread quark (Jun Wu)
quark added inline comments. INLINE COMMENTS > spectral wrote in color.py:94 > I understand the reasoning for wanting `diff.inserted` and > `diff.inserted.changed` to be the same color, but unfortunately I think it > might not be super feasible in upstream. > > 'dim' support in my terminfo

[PATCH 2 of 4 V2] lfs: infer the blob store URL from paths.default

2018-04-10 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1523154140 14400 # Sat Apr 07 22:22:20 2018 -0400 # Node ID b784de3b414876f25964778b02e684f9b0a3787f # Parent 473a8954c957945d1642d08eeefc8fe706597b59 lfs: infer the blob store URL from paths.default If `lfs.url` is

[PATCH 4 of 4 V2] lfs: infer the blob store URL from an explicit push dest or default-push

2018-04-10 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1523211732 14400 # Sun Apr 08 14:22:12 2018 -0400 # Node ID 9dea6544c2d20e5bab1561266d13124bfd536e07 # Parent b0ae606b4a10738c97d791ac6867cd100eb2ea9d lfs: infer the blob store URL from an explicit push dest or

[PATCH 3 of 4 V2] lfs: infer the blob store URL from an explicit pull source

2018-04-10 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1523165019 14400 # Sun Apr 08 01:23:39 2018 -0400 # Node ID b0ae606b4a10738c97d791ac6867cd100eb2ea9d # Parent b784de3b414876f25964778b02e684f9b0a3787f lfs: infer the blob store URL from an explicit pull source I

[PATCH 1 of 4 V2] lfs: add the ability to disable the usercache

2018-04-10 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1523155211 14400 # Sat Apr 07 22:40:11 2018 -0400 # Node ID 473a8954c957945d1642d08eeefc8fe706597b59 # Parent 49a8c2cc7978cdd73155fc354aae8851a79c58d8 lfs: add the ability to disable the usercache While the usercache

D3212: patch: implement a new worddiff algorithm

2018-04-10 Thread spectral (Kyle Lippincott)
spectral added subscribers: dhduvall, indygreg. spectral added inline comments. INLINE COMMENTS > quark wrote in color.py:94 > As I mentioned in the summary, I believe `diff.inserted` and > `diff.inserted.changed` should have a same color. And `diff.inserted` > probably shouldn't be bold. > >

D3210: patch: move yielding "\n" to the end of loop

2018-04-10 Thread quark (Jun Wu)
quark added a comment. That's ideal. But a lot of code in this area expects "line" to not contain "\n". So the change won't be as easy as it looks. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3210 To: quark, #hg-reviewers Cc: yuja, mercurial-devel

D3212: patch: implement a new worddiff algorithm

2018-04-10 Thread quark (Jun Wu)
quark added a comment. Git first had a `contrib/diff-highlight/diff-highlight` script which inverts foreground/background for hunks with len(deleted_lines) = len(inserted_lines). Then the latest version shows diff inline. That is: common words [+inserted words with green

D3157: histedit: drop unnecessary check for "self.node is not None"

2018-04-10 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG966061b8826d: histedit: drop unnecessary check for self.node is not None (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE

D3189: context: extract partial nodeid lookup method to scmutil

2018-04-10 Thread martinvonz (Martin von Zweigbergk)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG901e749ca0e1: context: extract partial nodeid lookup method to scmutil (authored by martinvonz, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D3189?vs=7878=7934#toc

[PATCH 8 of 8] hgweb: wrap {archives} with mappinglist

2018-04-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1522590109 -32400 # Sun Apr 01 22:41:49 2018 +0900 # Node ID a4d06c685ee182279e91c2856d8a69e809c6e317 # Parent d9f6292315ef2ee3553a6dc10c20eefd hgweb: wrap {archives} with mappinglist No bare list of mappings should

[PATCH 7 of 8] hgweb: forward archivelist() of hgweb to webutil

2018-04-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1522590015 -32400 # Sun Apr 01 22:40:15 2018 +0900 # Node ID d9f6292315ef2ee3553a6dc10c20eefd # Parent f698f65fbaf88305353eb769e0130299fc747f08 hgweb: forward archivelist() of hgweb to webutil self.configlist() is

[PATCH 3 of 8] hgweb: wrap {labels} by hybridlist()

2018-04-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1522588844 -32400 # Sun Apr 01 22:20:44 2018 +0900 # Node ID 411dfde85bce520eb637ea52bce93e336b9e9a30 # Parent 42132043359a74ab3d703f1791644a39b8b6e8dc hgweb: wrap {labels} by hybridlist() This one is a simple list of

[PATCH 5 of 8] hgweb: drop archivespecs from requestcontext

2018-04-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1522589635 -32400 # Sun Apr 01 22:33:55 2018 +0900 # Node ID cf2d909fdec997a9bb39573ded50ae362a667221 # Parent 1dd6d286577ee108d2b643f320bf22e72823b47d hgweb: drop archivespecs from requestcontext It's a constant. diff --git

[PATCH 6 of 8] hgweb: move archivelist() of hgwebdir to webutil

2018-04-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1522589823 -32400 # Sun Apr 01 22:37:03 2018 +0900 # Node ID f698f65fbaf88305353eb769e0130299fc747f08 # Parent cf2d909fdec997a9bb39573ded50ae362a667221 hgweb: move archivelist() of hgwebdir to webutil diff --git

[PATCH 4 of 8] hgweb: move archivespecs to webutil

2018-04-10 Thread Yuya Nishihara
# HG changeset patch # User Yuya Nishihara # Date 1522589554 -32400 # Sun Apr 01 22:32:34 2018 +0900 # Node ID 1dd6d286577ee108d2b643f320bf22e72823b47d # Parent 411dfde85bce520eb637ea52bce93e336b9e9a30 hgweb: move archivespecs to webutil Move one step further from

D3189: context: extract partial nodeid lookup method to scmutil

2018-04-10 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments. INLINE COMMENTS > yuja wrote in scmutil.py:439 > I could add it if you're happy with the following change. > > node = repo.unfiltered().changelog._partialmatch(prefix) > repo.changelog.rev(node) # make sure node isn't filtered > return node LGTM. Thank

Re: [PATCH 5 of 6] lfs: infer the blob store URL from an explicit push source or default-push

2018-04-10 Thread Matt Harbison
> On Apr 10, 2018, at 9:34 AM, Yuya Nishihara wrote: > >> On Mon, 9 Apr 2018 17:43:47 -0400, Matt Harbison wrote: >> On Apr 9, 2018, at 9:43 AM, Yuya Nishihara wrote: On Mon, 09 Apr 2018 00:26:45 -0400, Matt Harbison wrote: # HG changeset

D3218: py3: use print as a function in test-mq-qpush-fail.t

2018-04-10 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision. yuja added a comment. This revision now requires changes to proceed. `print(nonascii)` may fail depending on the locale. We have to use `getattr(sys.stdout, 'buffer', sys.stdout)` or `pycompat.stdout`. REPOSITORY rHG Mercurial REVISION DETAIL

D3216: py3: use pycompat.bytestr() where repr in involved

2018-04-10 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision. yuja added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > mq.py:670 > +return True, pycompat.bytestr(repr(exactpos[0])) > +return False, ' '.join([pycompat.bytestr(repr(p)) for p in pos]) >

[Bug 5836] New: import of a git patch containing 'From' in the commit message confuses Mercurial

2018-04-10 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=5836 Bug ID: 5836 Summary: import of a git patch containing 'From' in the commit message confuses Mercurial Product: Mercurial Version: 4.5 Hardware: PC OS:

D3189: context: extract partial nodeid lookup method to scmutil

2018-04-10 Thread yuja (Yuya Nishihara)
yuja added inline comments. INLINE COMMENTS > martinvonz wrote in scmutil.py:439 > Makes sense. Okay if I do that in a follow-up so the rest of the stack is not > blocked by this (I will be away until Friday)? I could add it if you're happy with the following change. node =

D3212: patch: implement a new worddiff algorithm

2018-04-10 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision. yuja added a comment. This revision now requires changes to proceed. I have no opinion about the "dim" thingy, but the series generally looks good to me. Thanks for tackling on the painfully slow `SequenceMatcher.ratio()` issue. INLINE COMMENTS

D3211: patch: buffer lines for a same hunk

2018-04-10 Thread yuja (Yuya Nishihara)
yuja requested changes to this revision. yuja added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > patch.py:2484 > +stripline = chompline.rstrip() > +if line[0] == '-': > +label = 'diff.deleted' Don't use `bytes[n]` since it returns

D3221: py3: add b'' prefixes in tests/test-ui-config.py

2018-04-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 1. skip-blame because just b'' prefixes REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3221 AFFECTED FILES tests/test-ui-config.py

D3210: patch: move yielding "\n" to the end of loop

2018-04-10 Thread yuja (Yuya Nishihara)
yuja added a comment. Perhaps, it's simpler to use `mdiff.splitnewlines(chunk)` instead of `chunk.split('\n')` because otherwise the next patch has to reconstruct `line + '\n'`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3210 To: quark, #hg-reviewers Cc:

D3220: py3: make sure we write bytes to file

2018-04-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 1. skip-blame because just b'' prefix REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3220 AFFECTED FILES tests/test-mq.t CHANGE

D3216: py3: use pycompat.bytestr() where repr in involved

2018-04-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3216 AFFECTED FILES hgext/mq.py CHANGE DETAILS diff --git a/hgext/mq.py b/hgext/mq.py ---

D3215: py3: use bytes instead of str in isinstance()

2018-04-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We deal with bytes internally and things should be bytes REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3215 AFFECTED FILES

D3214: py3: use .startswith() instead of bytes[0]

2018-04-10 Thread pulkit (Pulkit Goyal)
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3214 AFFECTED FILES hgext/mq.py CHANGE DETAILS diff --git a/hgext/mq.py b/hgext/mq.py ---

D3189: context: extract partial nodeid lookup method to scmutil

2018-04-10 Thread martinvonz (Martin von Zweigbergk)
martinvonz added inline comments. INLINE COMMENTS > yuja wrote in scmutil.py:439 > We'll need to verify that the returned node is NOT hidden by e.g. > calling `changelog.rev(node)`. > > It's unlikely that callers expect this function may return a hidden > node. Makes sense. Okay if I do that

Re: [PATCH 5 of 6] lfs: infer the blob store URL from an explicit push source or default-push

2018-04-10 Thread Yuya Nishihara
On Mon, 9 Apr 2018 17:43:47 -0400, Matt Harbison wrote: > > > On Apr 9, 2018, at 9:43 AM, Yuya Nishihara wrote: > > > >> On Mon, 09 Apr 2018 00:26:45 -0400, Matt Harbison wrote: > >> # HG changeset patch > >> # User Matt Harbison > >> # Date 1523211732

D3187: phase: add dry-run functionality

2018-04-10 Thread khanchi97 (Sushil khanchi)
khanchi97 added a comment. @pulkit Can you please review it? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3187 To: khanchi97, pulkit, #hg-reviewers Cc: av6, mercurial-devel ___ Mercurial-devel mailing list