yuja (Yuya Nishihara)
User

Projects

User Details

User Since
Jun 29 2017, 11:25 AM (99 w, 15 h)

Recent Activity

Wed, May 22

yuja added a comment to D6432: match: de-flake test-doctest.py by not depending on util.dirs() order.

Perhaps, this would break py3 doctests. The repr syntax changed.

Wed, May 22, 7:26 PM

Mon, May 20

yuja committed rHGde65ae32b82d: templatekw: change default value of 'requires' to ().
templatekw: change default value of 'requires' to ()
Mon, May 20, 11:48 AM

Fri, May 17

yuja added a comment to D6397: rust-python3: compatibility fix for incoming PyLong.

@@ -153,7 +153,7 @@

&dirstate_vec?,
&copies?,
DirstateParents { p1, p2 },
  • now.value(py) as i32, + now.into_object().extract::<i32>(py)?,
Fri, May 17, 11:25 PM

Thu, May 16

yuja committed rHGb162229ebe0d: log: flag topo-sorted set as such.
log: flag topo-sorted set as such
Thu, May 16, 11:39 AM
yuja committed rHGa5d9096b3f84: log: flag topo-sorted set as such.
log: flag topo-sorted set as such
Thu, May 16, 7:58 AM

Tue, May 14

yuja added a comment to D6331: log: add config for making `hg log -G` always topo-sorted.

+def _maybetoposort(repo, revs, opts):
+ if opts.get('graph') and repo.ui.configbool('experimental', 'log.topo'):
+ revs = dagop.toposort(revs, repo.changelog.parentrevs)
+ # TODO: try to iterate the set lazily
+ revs = revset.baseset(list(revs))
+ return revs
+

def getrevs(repo, pats, opts):
    """Return (revs, differ) where revs is a smartset

@@ -727,7 +734,7 @@

limit = getlimit(opts)
revs = _initialrevs(repo, opts)
if not revs:
  • return smartset.baseset(), None + return _maybetoposort(repo, smartset.baseset(), opts), None
Tue, May 14, 8:35 AM

Sat, May 11

yuja added a comment to D6369: templatekw: make {file_*} compare to both merge parents (issue4292).
This redefines the template keywords by getting the lists from the
recently introduced context methods instead of getting them from
status compared to p1. A mentioned before, these are better defined on
merge commits. The total number of files from the three lists now
always add up to the number of files in {files}.
Sat, May 11, 11:07 PM
yuja added a comment to D6367: context: add ctx.files{modified,added,removed}() methods.

+ def modified(self):
+ modified = set(self.files())
+ modified.difference_update(self.added())
+ modified.difference_update(self.removed())
+ return sorted(modified)
+ def added(self):
+ added = []
+ for f in self.files():
+ if not any(f in p for p in self.parents()):
+ added.append(f)
+ return added
+ def removed(self):
+ removed = []
+ for f in self.files():
+ if f not in self:
+ removed.append(f)
+ return removed

Sat, May 11, 11:07 PM

Wed, May 8

yuja committed rHG6bc1245cd598: revset: populate wdir() by its hash or revision number.
revset: populate wdir() by its hash or revision number
Wed, May 8, 6:09 PM
yuja committed rHGa0c5e06e9b1a: revset: extract private constant of {nullrev, wdirrev} set.
revset: extract private constant of {nullrev, wdirrev} set
Wed, May 8, 6:09 PM
yuja committed rHG96bc1ef4a302: help: suggest merge() revset instead of -m/--only-merges.
help: suggest merge() revset instead of -m/--only-merges
Wed, May 8, 6:09 PM

Fri, May 3

yuja committed rHG29798c9ba5c9: parser: fix crash by parsing "()" in keyword argument position.
parser: fix crash by parsing "()" in keyword argument position
Fri, May 3, 12:29 PM

Sun, Apr 28

yuja added a comment to D6312: branchcache: update the filteredhash if we update the tiprev.
if ntiprev > self.tiprev:
    self.tiprev = ntiprev
    self.tipnode = cl.node(ntiprev)

+ self.filteredhash = scmutil.filteredhash(repo, self.tiprev)

if not self.validfor(repo):
    # cache key are not valid anymore
Sun, Apr 28, 4:38 AM

Apr 21 2019

yuja added a comment to D6290: branchcache: don't verify all nodes while writing.
However before this patch, writing the branchmap was validating all the nodes
whereas it should not. This patch fixes that.
Apr 21 2019, 5:47 AM

Apr 18 2019

yuja added a comment to D6232: rust-discovery: cpython bindings for the core logic.

+ def addinfo(&self, sample: PyObject) -> PyResult<PyObject> {
+ let mut missing: Vec<Revision> = Vec::new();
+ let mut common: Vec<Revision> = Vec::new();
+ for info in sample.iter(py)? { // info is a pair (Revision, bool)
+ let mut revknown = info?.iter(py)?;
+ let rev: Revision = revknown.next().unwrap()?.extract(py)?;
+ let known: bool = revknown.next().unwrap()?.extract(py)?;

Apr 18 2019, 7:22 PM

Apr 17 2019

yuja added a comment to D6233: rust-discovery: implementing and exposing stats().

Can't apply by :D6233. Can you rebase?

Apr 17 2019, 7:29 PM

Apr 16 2019

yuja added a comment to D6238: branchcache: don't verify while creating a copy.
def copy(self):
    """return an deep copy of the branchcache object"""
  • self._verifyall() return type(self)( self._entries, self.tipnode, self.tiprev, self.filteredhash, self._closednodes)
Apr 16 2019, 7:08 PM
yuja added a comment to D6207: branchcache: add functions to validate changelog nodes.
The motivation behind iteritems() change (https://phab.mercurial-scm.org/D6236) is optimizing https://www.mercurial-scm.org/repo/hg-committed/file/70b71421fd33/mercurial/commands.py#l1128.
Apr 16 2019, 7:08 PM

Apr 15 2019

yuja added a comment to D6207: branchcache: add functions to validate changelog nodes.

+ def _verifybranch(self, branch):
+ """ verify head nodes for the given branch. If branch is None, verify
+ for all the branches """

Apr 15 2019, 7:16 PM
yuja added a comment to D6208: branchcache: lazily validate nodes from the branchmap.
def copy(self):
    """return an deep copy of the branchcache object"""

+ self._verifyall()

return type(self)(
    self._entries, self.tipnode, self.tiprev, self.filteredhash,
    self._closednodes)
Apr 15 2019, 7:16 PM

Apr 14 2019

yuja added a comment to D6183: copies: add config option for writing copy metadata to file and/or changset.
> >   >  extras field. Almost all extras data are texts, and IIRC we regret that
> >   >  transplant sources are stored in binary form.
> >   
> >   Why not? I picked \0 and \n because they won't appear in filenames, so it's convenient in that way.
>
> I don't remember, but we do store even boolean value as text, not in binary
>  `\0`/`\1` form. `transplant_source` is the solo exception.


Perhaps it's just so `{extras}` doesn't print ANSI escape codes and such? (I assume that can still happen if put escape characters in your filenames, for example.)
Apr 14 2019, 7:02 PM

Apr 13 2019

yuja added a comment to D6183: copies: add config option for writing copy metadata to file and/or changset.
> It might be nitpicky, but I think it's better to not embed `\0` into the
>  extras field. Almost all extras data are texts, and IIRC we regret that
>  transplant sources are stored in binary form.

Why not? I picked \0 and \n because they won't appear in filenames, so it's convenient in that way.
Apr 13 2019, 8:26 PM
yuja added a comment to D6183: copies: add config option for writing copy metadata to file and/or changset.

+def encodecopies(copies):
+ items = [
+ '%s\0%s' % (_string_escape(k), _string_escape(copies[k]))
+ for k in sorted(copies)
+ ]
+ return "\n".join(items)

Apr 13 2019, 7:45 AM
yuja added a comment to D6185: changelog: pass default extras into decodeextra().

+def decodeextra(text, default):

"""
>>> from .pycompat import bytechr as chr
  • >>> sorted(decodeextra(encodeextra({b'foo': b'bar', b'baz': chr(0) + b'2'})
  • ... ).items()) + >>> sorted(decodeextra(encodeextra({b'foo': b'bar', b'baz': chr(0) + b'2'}), + ... _defaultextra).items()) [('baz', '\\x002'), ('branch', 'default'), ('foo', 'bar')] >>> sorted(decodeextra(encodeextra({b'foo': b'bar',
  • ... b'baz': chr(92) + chr(0) + b'2'})
  • ... ).items()) + ... b'baz': chr(92) + chr(0) + b'2'}), + ... _defaultextra).items())
Apr 13 2019, 7:45 AM

Apr 12 2019

yuja added a comment to D6208: branchcache: lazily validate nodes from the branchmap.

The idea sounds good to me. Is this still an RFC (i.e. draft) patch?

Apr 12 2019, 9:12 PM

Apr 10 2019

yuja committed rHG509a0477b3a6: cext: cast s# arguments of Py_BuildValue() to Py_ssize_t.
cext: cast s# arguments of Py_BuildValue() to Py_ssize_t
Apr 10 2019, 6:41 AM

Apr 9 2019

yuja added a comment to D6196: cext: make revlog.c PY_SSIZE_T_CLEAN.
4   org.python.python             	0x00000001000eb761 va_build_value + 737
5   org.python.python             	0x00000001000eb837 _Py_BuildValue_SizeT + 167
Apr 9 2019, 9:05 AM

Apr 1 2019

yuja added a comment to D6169: unshelve: disable unshelve during merge (issue5123).
I saw some patches[0][1][2] trying to fix this issue. It seems like it's difficult to preserve the second parent.

[0]: http://mercurial.808500.n3.nabble.com/PATCH-shelve-adds-restoring-original-parents-after-unshelve-issue5123-tc4035657.html#none
[1]: http://mercurial.808500.n3.nabble.com/PATCH-V2-shelve-restore-parents-after-unshelve-issue5123-tc4036093.html#a4037370
[2]: http://mercurial.808500.n3.nabble.com/PATCH-V3-shelve-restore-parents-after-unshelve-issue5123-tt4036858.html#a4037408
Apr 1 2019, 7:04 PM

Mar 27 2019

yuja added a comment to D6169: unshelve: disable unshelve during merge (issue5123).
> Is it difficult to fix unshelve to not lose merge parents?
> 
> https://bz.mercurial-scm.org/show_bug.cgi?id=5123#c2

I'll try to come up with a fix. But, `hg shelve` is aborting during a merge. Can `unshelve` be aborted too?
Mar 27 2019, 6:35 PM

Mar 25 2019

yuja added a comment to D6169: unshelve: disable unshelve during merge (issue5123).
As stated in the issue5123, unshelve can destroy the second parent of
the context when tried to unshelve with an uncommitted merge. This
patch makes unshelve to abort when called with an uncommitted merge.
Mar 25 2019, 6:29 PM
yuja added a comment to D6027: mq: make unshelve to apply on modified mq patch (issue4318).
    • a/hgext/mq.py +++ b/hgext/mq.py @@ -3518,7 +3518,10 @@ delattr(self.unfiltered(), r'mq')

      def abortifwdirpatched(self, errmsg, force=False):
  • if self.mq.applied and self.mq.checkapplied and not force: + shelveinprogress = any('shelvedstate' in state + for state in cmdutil.unfinishedstates) + if (self.mq.applied and self.mq.checkapplied and not force and + not shelveinprogress):
Mar 25 2019, 6:29 PM

Mar 23 2019

yuja added a comment to D6156: branchcache: add attributes to track which nodes are verified.

@@ -231,8 +235,10 @@

    raise ValueError(
        r'node %s does not exist' % pycompat.sysstr(hex(node)))
self._entries.setdefault(label, []).append(node)

+ self._verifiedbranches.add(label)

Mar 23 2019, 9:26 PM
yuja added a comment to D6151: branchmap: remove the dict interface from the branchcache class (API).
def copy(self):
    """return an deep copy of the branchcache object"""
  • return type(self)(
  • self, self.tipnode, self.tiprev, self.filteredhash, + return branchcache( + self.entries, self.tipnode, self.tiprev, self.filteredhash, self._closednodes)
Mar 23 2019, 9:10 PM
yuja committed rHGa66965406528: test-template: fix stdio mode on Windows.
test-template: fix stdio mode on Windows
Mar 23 2019, 11:25 AM

Mar 22 2019

yuja added a comment to D6168: readline: provide styled prompt to readline (issue6070).
Oh, right... I saw that and that was part of why I didn't mail earlier :D  I think this is just an "expected" difference in behavior,
Mar 22 2019, 10:01 PM
yuja committed rHG77ef3498ceb3: template: add CBOR output format.
template: add CBOR output format
Mar 22 2019, 1:05 PM
yuja committed rHG4df7c4b70e03: templatefilters: add {x|cbor} filter for custom CBOR output.
templatefilters: add {x|cbor} filter for custom CBOR output
Mar 22 2019, 1:05 PM

Mar 18 2019

yuja added a comment to D5296: store: don't read the whole fncache in memory.

+ self.entries = set()
+ chunk = b''
+ for c in iter(functools.partial(fp.read, fncache_chunksize), b''):
+ chunk += c
+ try:
+ p = chunk.rindex(b'\n')
+ self.entries.update(decodedir(chunk[:p + 1]).splitlines())
+ chunk = chunk[p + 1:]
+ except ValueError:
+ # substring '\n' not found, maybe the entry is bigger than the
+ # chunksize, so let's keep iterating
+ pass

Mar 18 2019, 8:29 AM

Mar 17 2019

yuja committed rHG406519302520: test-https: add some more known failure messages of client certs (issue6030).
test-https: add some more known failure messages of client certs (issue6030)
Mar 17 2019, 2:57 PM
yuja committed rHG4748938ee0c7: test-https: turn off system OpenSSL configuration.
test-https: turn off system OpenSSL configuration
Mar 17 2019, 2:57 PM

Mar 16 2019

yuja added a comment to D5296: store: don't read the whole fncache in memory.

+ for c in iter(functools.partial(fp.read, chunksize), b''):
+ chunk += c
+ try:
+ p = chunk.rindex(b'\n')
+ self.entries |= set(decodedir(chunk[:p + 1]).splitlines())

Mar 16 2019, 9:51 PM

Mar 15 2019

yuja added a comment to D6107: py3: use pycompat.byteskwargs on opts in phabricator.py.
I was under the impression that that was more of a hack, mainly useful for when there are lots of existing `opts.get(b'')` uses in a file, and when there are a few it was better to change to `r''`.
Mar 15 2019, 10:44 PM
yuja added a comment to D6113: py3: convert to/from bytes/unicode for json.(dump|load)s in debugcallconduit.
Ah,  we can indeed (thanks for the pointer), with one caveat:  the formatting.
The existing output is nicely formatted for human readability, with each entry on a new line and indented appropriately.  `templatefilters.json()` isn't capable of that.
Do we mind losing that?  It's also tested for in test-phabricator.t. Compare before:
Mar 15 2019, 10:44 PM
yuja added a comment to D6140: revset: add new contiguous(x) function for "x::x".

I think "contiguous" is good as it stands for the main use case. "closure"
seems confusing unless we have stronger math background than computer science.
The other candidates would require more knowledge about the theory.

Mar 15 2019, 10:43 PM

Mar 11 2019

yuja added a comment to D6081: i18n-ja: correct translation of "committing".

Maybe need a pullreq? We can't review i18n messages.

Mar 11 2019, 9:46 AM

Mar 9 2019

yuja added a comment to D6113: py3: convert to/from bytes/unicode for json.(dump|load)s in debugcallconduit.
  • params = json.loads(ui.fin.read())
  • result = callconduit(repo, name, params)
  • s = json.dumps(result, sort_keys=True, indent=2, separators=(b',', b': '))
  • ui.write(b'%s\n' % s) + # json.(load|dump)s only returns/accepts unicode strings + params = pycompat.rapply(lambda x: + encoding.unitolocal(x) if isinstance(x, pycompat.unicode) else x, + json.loads(ui.fin.read()) + )
Mar 9 2019, 8:30 PM
yuja added a comment to D6107: py3: use pycompat.byteskwargs on opts in phabricator.py.

pycompat.byteskwargs() can be used instead.

Mar 9 2019, 8:29 PM
yuja added a comment to D6103: py3: use pycompat.iterbytestr to convert memoryview slice to bytestring before passing to itertools.takewhile.

Queued most of the patches in this series, thanks.

Mar 9 2019, 8:29 PM

Mar 5 2019

yuja added a comment to D6044: phabricator: convert conduit response JSON unicode to bytes inside callconduit.
> Perhaps some of `r''` would have to be changed to `b''` since dict keys
>  are now byte strings. See the wiki page for our Py3 hacks.
> 
> https://www.mercurial-scm.org/wiki/Python3

Ah, good point, thanks.  Would it be worth keeping the keys as r'' strings?  rapply can fairly easily be extended with an optional notkeys boolean that would allow doing so.
Mar 5 2019, 8:45 AM

Mar 3 2019

yuja added a comment to D6052: global: use raw string for setlocale() argument.
After this series, the number of test failures in that mode is ~70. Most of the remaining failures are in `stringutil.wrap()`. Essentially `textwrap` from the standard library wants to operate on native `str`. Our version is feeding in `unicode`. We get into trouble when the standard library code does a `''.join()` and some `unicode` is coerced into `str`. TBH I'm not sure how we're not seeing bugs due to this on Python 2. I'm guessing we're lacking test coverage for something passing non-ASCII into `stringutil.wrap()`?
Mar 3 2019, 5:01 AM
yuja added a comment to D6044: phabricator: convert conduit response JSON unicode to bytes inside callconduit.
  • parsed = json.loads(body) + parsed = pycompat.rapply(lambda x: encoding.unitolocal(x) + if isinstance(x, unicode) else x, json.loads(body))
Mar 3 2019, 4:47 AM

Mar 1 2019

yuja added a comment to D6042: py3: convert filtername to str if it's None.

+ filtername = repo.filtername
+ if filtername is None:
+ filtername = 'None'

repo.ui.log('branchcache', 'updated %s branch cache in %.4f seconds\n',
  • repo.filtername, duration) + filtername, duration)
Mar 1 2019, 8:36 PM
yuja committed rHG169c386cc9d8: merge with stable.
merge with stable
Mar 1 2019, 8:23 PM

Feb 27 2019

yuja added a comment to D5296: store: don't read the whole fncache in memory.

I don't think totalsize has to be stat()ed. We can just loop over until
fp.read() reaches to EOF. It's unreliable to assume that the stat('fncache')
see the identical file to the fp open()ed before.

Feb 27 2019, 8:03 PM

Feb 25 2019

yuja added a comment to D5296: store: don't read the whole fncache in memory.

(resend without the "On ... wrote:" line)

Feb 25 2019, 10:03 PM
yuja added a comment to D6023: branchcache: move loading of branch names and nodes into it's own function.
if not bcache.validfor(repo):
    # invalidate the cache
    raise ValueError(r'tip differs')
  • cl = repo.changelog
  • for line in lineiter:
  • line = line.rstrip('\n')
  • if not line:
  • continue
  • node, state, label = line.split(" ", 2)
  • if state not in 'oc':
  • raise ValueError(r'invalid branch state')
  • label = encoding.tolocal(label.strip())
  • node = bin(node)
  • if not cl.hasnode(node):
  • raise ValueError(
  • r'node %s does not exist' % pycompat.sysstr(hex(node)))
  • bcache.setdefault(label, []).append(node)
  • if state == 'c':
  • bcache._closednodes.add(node) - + bcache.load(repo, f) except (IOError, OSError): return None

    @@ -214,6 +198,26 @@

    return bcache

    + def load(self, repo, f): + """ fully loads the branchcache by reading from the file f """ + cl = repo.changelog + lineiter = iter(f)
Feb 25 2019, 5:58 PM

Feb 24 2019

yuja added a comment to D5997: mq: disable qrecord during histedit (issue5981).
with ui.configoverride(overrides, 'record'):

+ if repo.vfs.exists('histedit-state'):
+ raise error.Abort(_("histedit in progress, can't qrecord"))

cmdutil.dorecord(ui, repo, committomq, cmdsuggest, False,
Feb 24 2019, 8:36 PM
yuja added a comment to D6007: diff: make sure we output stat info even when --git is not passed (issue4037).
I looked into why we don't return diff headers in quiet mode and found the
behavior is from https://phab.mercurial-scm.org/rHG8f8bb77d560e70bcc95577e4dfa877df18d876ab which does not have
any mention about why it is done. We also show the diff headers in git, so I
think it's fine showing diff header in normal diff in quiet mode.
Feb 24 2019, 8:36 PM

Feb 20 2019

yuja committed rHGffbf742bfe1f: subrepo: add test for Windows relative-ish path with drive letter.
subrepo: add test for Windows relative-ish path with drive letter
Feb 20 2019, 1:03 AM

Feb 12 2019

yuja added a comment to D5813: revset: add expect to check the size of a set.

+@predicate('expectsize(set[, size])', safe=True, takeorder=True)
+def expectrevsetsize(repo, subset, x, order):
+ """Abort if the revset doesn't expect given size"""
+ args = getargsdict(x, 'expect', 'set size')

Feb 12 2019, 7:49 AM

Feb 11 2019

yuja added a comment to D5907: copy: respect ui.relative-paths in copy/rename.
`getuipathfn()` uses `repo.pathto()` when a relative path was requested (including by setting `legacyrelativevalue=True` or `forcerelativevalue=True`), so I think there shouldn't be much change in behavior with that commit.
Feb 11 2019, 8:43 AM
yuja added a comment to D5813: revset: add expect to check the size of a set.
nit-pick is resolved. `getintrange()` will throw a `ParseError` on setting size to one of `min:`, `:max` or `:`. In ideal case, on calling from `expectsize()` it shouldn't fail.
Feb 11 2019, 8:43 AM

Feb 10 2019

yuja added a comment to D5813: revset: add expect to check the size of a set.

Getting close.

Feb 10 2019, 9:16 PM
yuja added a comment to D5907: copy: respect ui.relative-paths in copy/rename.
> It might
>  break some Windows tests, but it should already be broken since https://phab.mercurial-scm.org/rHGa997163e7fae2fe933f8d0c6d1013205befd1ee4.
>  Some (or all?) `uipathfn()`s have to respect `ui.slash` config on Windows.

Did that commit change any behavior on Windows?
Feb 10 2019, 9:12 PM

Feb 9 2019

yuja added a comment to D5907: copy: respect ui.relative-paths in copy/rename.
  • a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -51,8 +51,10 @@ )

    if pycompat.iswindows: + from . import windows as platform from . import scmwindows as scmplatform else: + from . import posix as platform from . import scmposix as scmplatform
Feb 9 2019, 10:45 PM
yuja added a comment to D5896: diff: make --stat respect ui.relative-paths.
It would have been easy to make all diffs respect ui.relative-paths,
but we don't want that since it makes the diff invalid. Perhaps it
makes sense to do that with --noprefix since the point of that is to
make paths that are easy to copy&paste, and the diff is already
invalid anyway. But this patch just makes the --stat version respect
the config option. The --stat view is not even close to a valid diff,
so I think it makes sense to show the paths in more human-friendly
form.
Feb 9 2019, 10:45 PM
yuja added a comment to D5813: revset: add expect to check the size of a set.

+@predicate('expectsize(set[, size])', safe=True, takeorder=True)
+def expectrevsetsize(repo, subset, x, order):
+ """Abort if the revset doesn't expect given size"""
+ args = getargsdict(x, 'expect', 'set size')
+ size = args.get('size')
+ if size is not None:
+ minsize, maxsize = getintrange(size,
+ _('expectsize requires a size range'
+ ' or a positive integer'),
+ _('size range bounds must be integers'))

Feb 9 2019, 8:27 PM

Feb 7 2019

yuja added a comment to D5813: revset: add expect to check the size of a set.

+ $ hg log -r 'expectsize(0:2, 3)'
+ changeset: 0:2785f51eece5
+ branch: a
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0

Feb 7 2019, 8:18 AM
yuja added a comment to D5490: commit: remove ignore whitespace option on --interactive (issue6042).
@spectral @yuja Can I close this?
Feb 7 2019, 8:06 AM
yuja added a comment to D5855: mq: migrate to scmutil.backuppath().
  • absorig = scmutil.origpath(self.ui, repo, absf) + absorig = scmutil.backuppath(self.ui, repo, f) self.ui.note(_('saving current version of %s as %s\n') %
  • (f, os.path.relpath(absorig))) + (f, os.path.relpath(absorig, start=repo.root)))
Feb 7 2019, 7:58 AM

Feb 5 2019

yuja added a comment to D5813: revset: add expect to check the size of a set.
> You can try out some combinations of `expect(5:0) & 1:10` and
>  `10:1 & expect(0:5)`.

I got into many errors while using this. I might be not understanding this correctly. Could you please elaborate?
Feb 5 2019, 5:44 PM
yuja added a comment to D5417: rust: translated random test of missingancestors.
@yuja we don't need a seed to reproduce: failed examples contain all the information (that's a difference with the Python version)
Feb 5 2019, 5:44 PM
yuja committed rHG13f7a6a4f0db: revset: leverage getintrange() helper in relation-subscript operation (API).
revset: leverage getintrange() helper in relation-subscript operation (API)
Feb 5 2019, 9:14 AM
yuja committed rHG1c04894e8fe1: revset: allow to parse single integer as a range.
revset: allow to parse single integer as a range
Feb 5 2019, 9:14 AM
yuja committed rHG59638c6fcb70: revset: extract a helper to parse integer range.
revset: extract a helper to parse integer range
Feb 5 2019, 9:14 AM
yuja added a comment to D5417: rust: translated random test of missingancestors.
This test is useful for me, because it's the only one that really tests the corectness of MissingAncestor, and it's not a bench either.
I agree it feels out of place in  with the unit tests, so my proposal is to make an integration test out of it.
Feb 5 2019, 7:45 AM
yuja added a comment to D5800: config: introduce a new value for ui.relative-paths getting old behavior.
So do we prefer `legacyrelativevalue` then? Or `legacywasrelative`? Or `legacyrelative`? (I think the last one is least clear.)
Feb 5 2019, 7:04 AM
yuja added a comment to D5834: commit/revert: if interactive, look elsewhere for whitespace settings (BC).

Updated the tests added at d1d3094b54f9 and queued, thanks.

Feb 5 2019, 7:03 AM
yuja added a comment to D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839).
> I agree with that we would never set the `commands.commit.interactive.{...}`
>  in hgrc, but the feature itself is useful if you have to work on unclean
>  codebase unlike in Google. For example, I sometimes need to commit changes
>  ignoring unrelated whitespace cleanups made by editor or code formatter,
>  because I can't control the development workflow.
>
> That's why I thought there would be users relying on the current behavior.

I think I understand what you're saying.  I was under the impression that what we cared about was that `hg record -b` should continue working. Since there are no diffopts available on `hg commit -i`, you're thinking that this could be written as `hg commit -i --config commands.commit.interactive.ignorews=1`.

While I'm sympathetic to that argument, it is so long and unwieldy that I think I'd recommend that users just do `hg --config extensions.record= record -b` (or, more likely, set `[extensions] record=` in their hgrc).
Feb 5 2019, 7:03 AM

Feb 4 2019

yuja committed rHG549f956ba2a9: py3: don't use universal_newlines in svnsubrepo.
py3: don't use universal_newlines in svnsubrepo
Feb 4 2019, 4:55 PM
yuja committed rHGd65519e5dd04: py3: remove unneeded fsencode() from gitsubrepo.
py3: remove unneeded fsencode() from gitsubrepo
Feb 4 2019, 4:55 PM
yuja added a comment to D5813: revset: add expect to check the size of a set.

First, I think the word expect is too general. Perhaps, this should be called
expectsize() or expectlen().

Feb 4 2019, 7:20 AM
yuja added a comment to D5800: config: introduce a new value for ui.relative-paths getting old behavior.
> What I thought confusing is `scmutil.getuipathfn(ctx.repo(), legacyvalue=True)`
>  in https://phab.mercurial-scm.org/D5801. "What does the `True` mean? relative, absolute, or a complete
>  different stuff?"

Same reason it's confusing, I believe: it's unclear if "legacyvalue=True" means "use the legacy value" (incorrect) or "for the legacy value, use the value True" (correct). I was hoping the "value" part would clarify that, but I agree that it's still not clear.  I think you're also saying that the fact that the function deals with producing a cwd-relative or absolute (well, repo-relative) is also not clear and I agree with that too.
Feb 4 2019, 7:20 AM

Feb 3 2019

yuja added a comment to D5800: config: introduce a new value for ui.relative-paths getting old behavior.
> Looks good, but I find it isn't easy to parse the meaning of
>  `getuipathfn(repo, forcevalue=True)`. Perhaps it can be spelled as
>  `forcerelative=True`.

The problem is that this an override value for a boolean value, so it's easy to mistake `forcerelative=False` to mean "don't force it to be relative". That's why I went for `forcevalue` (meaning "force to this value"). I agree that it can still easily be read as "force a value". Perhaps `forceto` works better, although it's a bit unconventional? I'll change it to that and you can tell me if it seems worse.
Feb 3 2019, 5:49 PM
yuja added a comment to D5812: py3: pass str into ValueError to prevent b'' prefix in output.
I am not whether this is correct. This should have fix failure of `test-lfs-serve.t#lfsremote-on` failure on py3 but it does not.
Feb 3 2019, 7:48 AM

Feb 2 2019

yuja added a comment to D5803: revert: added prompt before undeleting a file in -i(issue6008).

+ if interactive:
+ choice = repo.ui.promptchoice(
+ _("Undelete file %s (Yn)?$$ &Yes $$ &No") % f)

Feb 2 2019, 9:36 PM
yuja added a comment to D5805: zeroconf: port to Python 3.
    1. advertise to browsers svc = Zeroconf.ServiceInfo('_http._tcp.local.',
  • name + '._http._tcp.local.', + pycompat.bytestr(name + r'._http._tcp.local.'), server = host, port = port,
  • properties = {'description': desc,
  • 'path': "/" + path}, + properties = { + 'description': pycompat.bytestr(desc), + 'path': pycompat.bytestr(r"/" + path)}, address = localip, weight = 0, priority = 0) server.registerService(svc)
    1. advertise to Mercurial clients svc = Zeroconf.ServiceInfo('_hg._tcp.local.',
  • name + '._hg._tcp.local.', + pycompat.bytestr(name + r'._hg._tcp.local.'), server = host, port = port,
  • properties = {'description': desc,
  • 'path': "/" + path}, + properties = { + 'description': pycompat.bytestr(desc), + 'path': pycompat.bytestr(r"/" + path)}, address = localip, weight = 0, priority = 0)
Feb 2 2019, 9:36 PM
yuja added a comment to D5800: config: introduce a new value for ui.relative-paths getting old behavior.

Looks good, but I find it isn't easy to parse the meaning of
getuipathfn(repo, forcevalue=True). Perhaps it can be spelled as
forcerelative=True.

Feb 2 2019, 9:13 PM
yuja committed rHGdbf20e28d1a6: py3: don't use universal_newlines in svnsubrepo.
py3: don't use universal_newlines in svnsubrepo
Feb 2 2019, 10:45 AM
yuja committed rHG921b4ffa9ced: py3: remove unneeded fsencode() from gitsubrepo.
py3: remove unneeded fsencode() from gitsubrepo
Feb 2 2019, 10:45 AM
yuja added a comment to D5772: hg: raise Abort on invalid path.
> Currently, some os.path functions when opening repositories may
>  raise an uncaught TypeError or ValueError if the path is invalid.

What kind of "invalid"? If the path doesn't exist? Or only if the path variable is of the wrong type (not bytes? not unicode? neither?)?
Feb 2 2019, 1:37 AM

Feb 1 2019

yuja added a comment to D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839).

The ultimate reason I abandoned that and went with the "only respect commandline options, not config, and don't do this for revert --interactive" patch series was because I had to include a note that said something like "if a user *does* set commands.commit.interactive.{ignorews,ignoreblanklines,...}, this will still trigger issue5839; it is unlikely that any user will want to set these options, though."

It's up to you, though. I worry I'm too ingrained in the internal-software development culture where we control what versions people have and can provide quick assistance when users have questions or encounter problems. I might not be properly considering the issues people might run into outside of an enterprise situation.
Feb 1 2019, 11:04 PM
yuja added a comment to D5745: status: extract helper for producing relative or absolute path for UI.

> + relative = pats or ui.configbool('commands', 'status.relative'):
> + uipathfn = scmutil.getuipathfn(repo, relative)

Not sure if it's worth fixing the syntax error here before it goes public. I only noticed because I was bisecting a test failure. The next patch drops the trailing :.

Feb 1 2019, 10:56 PM
yuja added a comment to D5796: py3: conditionalize test-demandimport.py for Python 3.

Fixed various check-code errors by black -l 80 -S tests/test-demandimport.py.

Feb 1 2019, 10:52 PM
yuja added a comment to D5777: grep: respect ui.relative-paths.

Removed useless '%s' % and queued, thanks.

Feb 1 2019, 9:09 PM
yuja added a comment to D5794: py3: pass str into grp.getgrnam.

+ name = pycompat.sysstr(name)

return list(grp.getgrnam(name).gr_mem)
Feb 1 2019, 8:50 PM
yuja added a comment to D5742: histedit: add templating support to histedit's rule file generation.

+++ b/mercurial/help.py
@@ -394,7 +394,17 @@

def addtopichook(topic, rewriter):
    helphooks.setdefault(topic, []).append(rewriter)

-def makeitemsdoc(ui, topic, doc, marker, items, dedent=False):
+def _templateextsyms(ui, topic, doc):
+ for name, ext in extensions.extensions(ui):
+ kw = getattr(ext, 'templatekeyword', None)
+ if kw is not None:
+ doc = addtopicsymbols(
+ 'templates', 'Filters\n=======', kw, keepmarker=True)
+ return doc
+
+addtopichook('templating', _templateextsyms)
+
+def makeitemsdoc(ui, topic, doc, marker, items, dedent=False, keepmarker=False):

"""Extract docstring from the items key to function mapping, build a
single documentation block and use it to overwrite the marker in doc.
"""

@@ -420,11 +430,14 @@

            doclines.append('  ' + l.strip())
    entries.append('\n'.join(doclines))
entries = '\n\n'.join(entries)

+ if keepmarker:
+ entries = entries + '\n\n' + marker

return doc.replace(marker, entries)

-def addtopicsymbols(topic, marker, symbols, dedent=False):
+def addtopicsymbols(topic, marker, symbols, dedent=False, keepmarker=False):

def add(ui, topic, doc):
  • return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent) + return makeitemsdoc(ui, topic, doc, marker, symbols, dedent=dedent, + keepmarker=keepmarker)
Feb 1 2019, 8:50 PM
yuja committed rHG83377b4b4ae0: subrepo: reject potentially unsafe subrepo paths (BC) (SEC).
subrepo: reject potentially unsafe subrepo paths (BC) (SEC)
Feb 1 2019, 1:54 PM
yuja committed rHG31286c9282df: subrepo: extend path auditing test to include more weird patterns (SEC).
subrepo: extend path auditing test to include more weird patterns (SEC)
Feb 1 2019, 1:54 PM
yuja committed rHG6c10eba6b9cd: subrepo: prohibit variable expansion on creation of hg subrepo (SEC).
subrepo: prohibit variable expansion on creation of hg subrepo (SEC)
Feb 1 2019, 1:54 PM