D2696: cleanup: use stat_result[stat.ST_MTIME] instead of stat_result.st_mtime

2018-03-05 Thread durin42 (Augie Fackler)
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The latter is floating point by default, and we've been doing os.stat_float_times(False). Unfortunately, os.stat_float_times was removed between Python 3.7.0a1

D2695: osutil: implement minimal __getitem__ compatibility on our custom listdir type

2018-03-05 Thread durin42 (Augie Fackler)
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We previously declined to do this, but the removal of the deprecated os.stat_float_times() method in Python 3.7 forces our hand. REPOSITORY rHG Mercurial

D2697: util: stop calling os.stat_float_times()

2018-03-05 Thread durin42 (Augie Fackler)
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It had Python-wide side effects, and it disappears in 3.7.0. As of this change, we're mostly working on 3.7.0b2. There are a few worrying failures, mostly

Re: [PATCH] debugwireproto: handle unimplemented util.poll() for Windows

2018-03-05 Thread Gregory Szorc
On Mon, Mar 5, 2018 at 6:08 PM, Matt Harbison wrote: > On Mon, 05 Mar 2018 20:58:23 -0500, Gregory Szorc > wrote: > > On Mon, Mar 5, 2018 at 5:48 PM, Matt Harbison >> wrote: >> >> # HG changeset patch >>> # User Matt

[PATCH] debugwireproto: handle unimplemented util.poll() for Windows

2018-03-05 Thread Matt Harbison
# HG changeset patch # User Matt Harbison # Date 1520299354 18000 # Mon Mar 05 20:22:34 2018 -0500 # Node ID 7a25f6cfebe80802321d2975b97fc15ec38cf8ec # Parent 2aff6daf779098eee4c350ccd0197dcc2231e197 debugwireproto: handle unimplemented util.poll() for Windows This

D2696: cleanup: use stat_result[stat.ST_MTIME] instead of stat_result.st_mtime

2018-03-05 Thread indygreg (Gregory Szorc)
indygreg added inline comments. INLINE COMMENTS > osutil.c:125 > static PyObject *listdir_stat_getitem(PyObject *self, PyObject *key) { > - long index = PyInt_AsLong(key); > + long index = PyLong_AsLong(key); > if (index == -1 && PyErr_Occurred()) { Is this valid for Python 2?

D2701: merge: use constants for actions

2018-03-05 Thread phillco (Phil Cohen)
phillco added subscribers: sid0, quark. phillco added a comment. btw, @quark mentioned there could be a perf hit (@sid0 mentioned this too a long time ago iirc) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2701 To: indygreg, #hg-reviewers, phillco Cc: quark,

D2701: merge: use constants for actions

2018-03-05 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We finish up establishing named constants in this file with actions. I remember scratching my head trying to figure out what this code was doing as part

D2698: merge: use constants for merge state record types

2018-03-05 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY merge.py is using multiple discrete sets of 1 and 2 letter constants to define types and behavior. To the uninitiated, the code is very difficult to reason

D2699: merge: use constants for merge driver state

2018-03-05 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Named constants are superior to magic values. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2699 AFFECTED FILES

D2700: merge: use constants for merge record state

2018-03-05 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Named constants are easier to read than short string values. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2700 AFFECTED FILES

D2701: merge: use constants for actions

2018-03-05 Thread indygreg (Gregory Szorc)
indygreg updated this revision to Diff 6662. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2701?vs=6661=6662 REVISION DETAIL https://phab.mercurial-scm.org/D2701 AFFECTED FILES mercurial/merge.py CHANGE DETAILS diff --git a/mercurial/merge.py

D2702: commands: use constants for merge things

2018-03-05 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We have nice constants now. Let's use them to make the code easier to reason about. REPOSITORY rHG Mercurial REVISION DETAIL

D2701: merge: use constants for actions

2018-03-05 Thread indygreg (Gregory Szorc)
indygreg marked an inline comment as done. indygreg added inline comments. INLINE COMMENTS > phillco wrote in merge.py:909 > Update this too? Done. What's... amusing is that ``dr`` and ``rd`` are not actions in the current code base. REPOSITORY rHG Mercurial REVISION DETAIL

D2701: merge: use constants for actions

2018-03-05 Thread phillco (Phil Cohen)
phillco accepted this revision. phillco added a comment. Strong +1 REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2701 To: indygreg, #hg-reviewers, phillco Cc: phillco, pulkit, mercurial-devel ___ Mercurial-devel

D2701: merge: use constants for actions

2018-03-05 Thread phillco (Phil Cohen)
phillco added inline comments. INLINE COMMENTS > merge.py:909 > if actions: > # k, dr, e and rd are no-op > +for m in (ACTION_ADD, ACTION_ADD_MODIFIED, ACTION_FORGET, ACTION_GET, Update this too? REPOSITORY rHG Mercurial REVISION DETAIL

D2701: merge: use constants for actions

2018-03-05 Thread phillco (Phil Cohen)
phillco added inline comments. INLINE COMMENTS > indygreg wrote in merge.py:909 > Done. > > What's... amusing is that ``dr`` and ``rd`` are not actions in the current > code base. lol REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2701 To: indygreg,

D2696: cleanup: use stat_result[stat.ST_MTIME] instead of stat_result.st_mtime

2018-03-05 Thread durin42 (Augie Fackler)
durin42 added inline comments. INLINE COMMENTS > indygreg wrote in osutil.c:125 > Is this valid for Python 2? The passed argument will likely be a PyInt on > Python 2. I thought `PyLong_AsLong` only operates on int types? Seems to (I also could have sworn int and long became the same thing in

D2695: osutil: implement minimal __getitem__ compatibility on our custom listdir type

2018-03-05 Thread indygreg (Gregory Szorc)
indygreg requested changes to this revision. indygreg added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > osutil.c:130 > + if (index != 8) { > + PyErr_Format(PyExc_TypeError, "osutil.stat objects only suport" > + "

Re: [PATCH] debugwireproto: handle unimplemented util.poll() for Windows

2018-03-05 Thread Gregory Szorc
On Mon, Mar 5, 2018 at 5:48 PM, Matt Harbison wrote: > # HG changeset patch > # User Matt Harbison > # Date 1520299354 18000 > # Mon Mar 05 20:22:34 2018 -0500 > # Node ID 7a25f6cfebe80802321d2975b97fc15ec38cf8ec > # Parent

Re: [PATCH] debugwireproto: handle unimplemented util.poll() for Windows

2018-03-05 Thread Matt Harbison
On Mon, 05 Mar 2018 20:58:23 -0500, Gregory Szorc wrote: On Mon, Mar 5, 2018 at 5:48 PM, Matt Harbison wrote: # HG changeset patch # User Matt Harbison # Date 1520299354 18000 # Mon Mar 05 20:22:34 2018 -0500

Re: [PATCH] debugwireproto: handle unimplemented util.poll() for Windows

2018-03-05 Thread Matt Harbison
On Mon, 05 Mar 2018 21:15:30 -0500, Gregory Szorc wrote: On Mon, Mar 5, 2018 at 6:08 PM, Matt Harbison wrote: On Mon, 05 Mar 2018 20:58:23 -0500, Gregory Szorc wrote: On Mon, Mar 5, 2018 at 5:48 PM, Matt

D2686: xdiff: add a preprocessing step that trims files

2018-03-05 Thread quark (Jun Wu)
quark updated this revision to Diff 6664. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D2686?vs=6650=6664 REVISION DETAIL https://phab.mercurial-scm.org/D2686 AFFECTED FILES mercurial/thirdparty/xdiff/xdiffi.c mercurial/thirdparty/xdiff/xemit.c

Re: [PATCH 1 of 3] hgweb: add a hook for processing LFS Batch API requests

2018-03-05 Thread Matt Harbison
On Mon, 26 Feb 2018 08:47:01 -0500, Yuya Nishihara wrote: On Thu, 22 Feb 2018 01:02:41 -0500, Matt Harbison wrote: # HG changeset patch # User Matt Harbison # Date 1519274700 18000 # Wed Feb 21 23:45:00 2018 -0500 # Node ID