D5296: store: don't read the whole fncache in memory

2019-03-18 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued, thanks. > +self.entries = set() > +chunk = b'' > +for c in iter(functools.partial(fp.read, fncache_chunksize), b''): > +chunk += c > +try: > +p = chunk.rindex(b'\n') > +

D5296: store: don't read the whole fncache in memory

2019-03-16 Thread yuja (Yuya Nishihara)
yuja added a comment. > +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()) Nit: you can

D6107: py3: use r'' instead of b'' in opts.get() in phabricator.py

2019-03-15 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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''`. Correct. And I feel there are lots of `s/b''/r''/`s in this

D6113: py3: convert to/from bytes/unicode for json.(dump|load)s in debugcallconduit

2019-03-15 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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

D6140: revset: add new contiguous(x) function for "x::x"

2019-03-15 Thread yuja (Yuya Nishihara)
yuja added a comment. 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. REPOSITORY rHG Mercurial REVISION DETAIL

D6081: i18n-ja: correct translation of "committing"

2019-03-11 Thread yuja (Yuya Nishihara)
yuja added a comment. Maybe need a pullreq? We can't review i18n messages. https://www.mercurial-scm.org/wiki/TranslatingMercurial#Existing_Translations > -msgstr "secret フェーズでコミット中" > +msgstr "secret フェーズでコミットします" Perhaps, it should just remove the "中". The Japanese

D6113: py3: convert to/from bytes/unicode for json.(dump|load)s in debugcallconduit

2019-03-09 Thread yuja (Yuya Nishihara)
yuja added a comment. > - 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 =

D6107: py3: use r'' instead of b'' in opts.get() in phabricator.py

2019-03-09 Thread yuja (Yuya Nishihara)
yuja added a comment. `pycompat.byteskwargs()` can be used instead. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6107 To: Kwan, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list

D6103: py3: use pycompat.iterbytestr to convert itertools.takewhile result back to bytes

2019-03-09 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued most of the patches in this series, thanks. > - symbol = b''.join(itertools.takewhile(lambda ch: ch not in special, > - view[pos:])) +symbol = b''.join(pycompat.iterbytestr(itertools.takewhile( +lambda ch: ch not in special, +

D6044: phabricator: convert conduit response JSON unicode to bytes inside callconduit

2019-03-05 Thread yuja (Yuya Nishihara)
yuja added a comment. > > 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

D6052: global: use raw string for setlocale() argument

2019-03-03 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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

D6044: phabricator: convert conduit response JSON unicode to bytes inside callconduit

2019-03-03 Thread yuja (Yuya Nishihara)
yuja added a comment. > - parsed = json.loads(body) +parsed = pycompat.rapply(lambda x: encoding.unitolocal(x) + if isinstance(x, unicode) else x, json.loads(body)) s/unicode/pycompat.unicode/ Perhaps some of `r''` would have to be changed to `b''`

D6042: py3: convert filtername to str if it's None

2019-03-01 Thread yuja (Yuya Nishihara)
yuja added a comment. > +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,

D5296: store: don't read the whole fncache in memory

2019-02-27 Thread yuja (Yuya Nishihara)
yuja added a comment. > - self.entries = set(decodedir(fp.read()).splitlines()) + + self.entries = [] +totalsize = self.vfs.stat('fncache').st_size 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

D5296: store: don't read the whole fncache in memory

2019-02-25 Thread yuja (Yuya Nishihara)
yuja added a comment. (resend without the "On ... wrote:" line) > Seeing the performance benefit it brings on our repo, I want to try other ways we can do this. Do we like having a conditional which checks the size of fncache and choose one of the approaches depending on how large it

D6023: branchcache: move loading of branch names and nodes into it's own function

2019-02-25 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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 =

D5997: mq: disable qrecord during histedit (issue5981)

2019-02-24 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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, Maybe

D6007: diff: make sure we output stat info even when --git is not passed (issue4037)

2019-02-24 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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

D5813: revset: add expect to check the size of a set

2019-02-12 Thread yuja (Yuya Nishihara)
yuja added a comment. > +@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') Fixed function name and queued,

D5907: copy: respect ui.relative-paths in copy/rename

2019-02-11 Thread yuja (Yuya Nishihara)
yuja added a comment. > `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. But the default of `hg status` is

D5813: revset: add expect to check the size of a set

2019-02-11 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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. So you need to pass in the default min/max values to `getintrange()`. The default

D5813: revset: add expect to check the size of a set

2019-02-10 Thread yuja (Yuya Nishihara)
yuja added a comment. Getting close. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5813 To: navaneeth.suresh, #hg-reviewers Cc: yuja, pulkit, durin42, mjpieters, mercurial-devel ___ Mercurial-devel mailing list

D5907: copy: respect ui.relative-paths in copy/rename

2019-02-10 Thread yuja (Yuya Nishihara)
yuja added a comment. > > 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

D5907: copy: respect ui.relative-paths in copy/rename

2019-02-09 Thread yuja (Yuya Nishihara)
yuja added a comment. > - 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

D5896: diff: make --stat respect ui.relative-paths

2019-02-09 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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, and the

D5813: revset: add expect to check the size of a set

2019-02-09 Thread yuja (Yuya Nishihara)
yuja added a comment. > +@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')

D5490: commit: remove ignore whitespace option on --interactive (issue6042)

2019-02-07 Thread yuja (Yuya Nishihara)
yuja added a comment. > @spectral @yuja Can I close this? Probably yes. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5490 To: navaneeth.suresh, #hg-reviewers Cc: spectral, yuja, durin42, pulkit, mercurial-devel

D5855: mq: migrate to scmutil.backuppath()

2019-02-07 Thread yuja (Yuya Nishihara)
yuja added a comment. > - 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,

D5813: revset: add expect to check the size of a set

2019-02-05 Thread yuja (Yuya Nishihara)
yuja added a comment. > > 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? Can you share your failed attempt?

D5417: rust: translated random test of missingancestors

2019-02-05 Thread yuja (Yuya Nishihara)
yuja added a comment. > @yuja we don't need a seed to reproduce: failed examples contain all the information (that's a difference with the Python version) Yes, but isn't it handy if we can run the same test with some debugging aids? I didn't carefully look through the original

D5417: rust: translated random test of missingancestors

2019-02-05 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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. or

D5800: config: introduce a new value for ui.relative-paths getting old behavior

2019-02-05 Thread yuja (Yuya Nishihara)
yuja added a comment. > So do we prefer `legacyrelativevalue` then? Or `legacywasrelative`? Or `legacyrelative`? (I think the last one is least clear.) `legacyrelativevalue` sounds good to me. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5800 To:

D5834: commit/revert: if interactive, look elsewhere for whitespace settings (BC)

2019-02-05 Thread yuja (Yuya Nishihara)
yuja added a comment. Updated the tests added at https://phab.mercurial-scm.org/rHGd1d3094b54f96ae806303d98b69cf7fa32fa2486 and queued, thanks. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5834 To: spectral, #hg-reviewers Cc: yuja, mercurial-devel

D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839)

2019-02-05 Thread yuja (Yuya Nishihara)
yuja added a comment. > > 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

D5813: revset: add expect to check the size of a set

2019-02-04 Thread yuja (Yuya Nishihara)
yuja added a comment. > +@predicate('expect(set[, size[, min, max]])', safe=True, takeorder=True) First, I think the word `expect` is too general. Perhaps, this should be called `expectsize()` or `expectlen()`. It's also unclear what's the difference between `size` and

D5800: config: introduce a new value for ui.relative-paths getting old behavior

2019-02-04 Thread yuja (Yuya Nishihara)
yuja added a comment. > > 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

D5800: config: introduce a new value for ui.relative-paths getting old behavior

2019-02-03 Thread yuja (Yuya Nishihara)
yuja added a comment. > > 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

D5812: py3: pass str into ValueError to prevent b'' prefix in output

2019-02-03 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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. As you guess, this isn't correct. For example, `_(unicode_sring)` will crash if gettext is enabled. I don't know why

D5803: revert: added prompt before undeleting a file in -i(issue6008)

2019-02-02 Thread yuja (Yuya Nishihara)
yuja added a comment. > +if interactive: > +choice = repo.ui.promptchoice( > +_("Undelete file %s (Yn)?$$ $$ ") % f) Nit: "undelete" (no capital letter) per Mercurial's convention. And I don't think "undelete" is good for user-facing

D5805: zeroconf: port to Python 3

2019-02-02 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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, > -

D5800: config: introduce a new value for ui.relative-paths getting old behavior

2019-02-02 Thread yuja (Yuya Nishihara)
yuja added a comment. 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`. > +def getuipathfn(repo, legacyvalue=False, forcevalue=None): > +if forcevalue is not None: > +

D5772: hg: raise Abort on invalid path

2019-02-01 Thread yuja (Yuya Nishihara)
yuja added a comment. > > 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?

D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839)

2019-02-01 Thread yuja (Yuya Nishihara)
yuja added a comment. > 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

D5745: status: extract helper for producing relative or absolute path for UI

2019-02-01 Thread yuja (Yuya Nishihara)
yuja added a comment. >> +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.

D5796: py3: conditionalize test-demandimport.py for Python 3

2019-02-01 Thread yuja (Yuya Nishihara)
yuja added a comment. Fixed various check-code errors by `black -l 80 -S tests/test-demandimport.py`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5796 To: indygreg, #hg-reviewers Cc: yuja, mjpieters, mercurial-devel

D5777: grep: respect ui.relative-paths

2019-02-01 Thread yuja (Yuya Nishihara)
yuja added a comment. > - fm.data(node=fm.hexfunc(scmutil.binnode(ctx))) > - fm.write('path', '%s', fn, label='grep.filename') + fm.data(node=fm.hexfunc(scmutil.binnode(ctx)), path=fn) + fm.plain('%s' % uipathfn(fn), label='grep.filename') Removed useless `'%s'

D5794: py3: pass str into grp.getgrnam

2019-02-01 Thread yuja (Yuya Nishihara)
yuja added a comment. > +name = pycompat.sysstr(name) > > return list(grp.getgrnam(name).gr_mem) Perhaps, it should be `fsdecode()` since they appear to abuse `PyUnicode_EncodeFSDefault()` to get back bytes. And we'll probably need to `fsencode()` gr_mem back to bytes as

D5742: histedit: add templating support to histedit's rule file generation

2019-02-01 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued, thanks. > +++ 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

D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839)

2019-02-01 Thread yuja (Yuya Nishihara)
yuja added a comment. > I did not add this to `revert --interactive`, since that does not currently have any way of getting args specified on the commandline that affect the whitespace settings (so I'm keeping `revert --interactive` *ignoring* the user's diff settings). Well, `hg

D5785: blackbox: take regex patterns for blackbox.track

2019-02-01 Thread yuja (Yuya Nishihara)
yuja added a comment. > +track = ui.configlist('blackbox', 'track') > +if not track: > +self._active = False > +elif b'*' in track: > +self._trackedevents = re.compile(b'.*') > +else: > +try: > +

D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839)

2019-01-31 Thread yuja (Yuya Nishihara)
yuja added a comment. > I wasn't able to come up with a reason to support these but only when committing interactively (as I said in the commit description), but I guess there's justification in https://www.mercurial-scm.org/pipermail/mercurial-devel/2011-June/032316.html. > > So

D5778: svnurlof: fix check-code errors I introduced

2019-01-31 Thread yuja (Yuya Nishihara)
yuja added a comment. > +from __future__ import absolute_import, print_function I've fixed this in flight. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5778 To: durin42, #hg-reviewers Cc: yuja, mercurial-devel

D5772: hg: raise Abort on invalid path

2019-01-31 Thread yuja (Yuya Nishihara)
yuja added a comment. > +try: > +isfile = os.path.isfile(path) > +# Python 2 raises TypeError, Python 3 ValueError. > +except (TypeError, ValueError) as e: > +raise error.Abort(_('invalid path %s: %s') % ( > +path, pycompat.bytestr(e)))

D5768: subrepo: bytes/str cleanups on Git support

2019-01-31 Thread yuja (Yuya Nishihara)
yuja added a comment. > - retdata = p.stdout.read().strip() +retdata = pycompat.fsencode(p.stdout.read().strip()) Curious why subprocess output can be a unicode. Is it a sort of text-mode stream? REPOSITORY rHG Mercurial REVISION DETAIL

D5739: py3: use pycompat.bytestr() so that slicing does not result in ascii values

2019-01-30 Thread yuja (Yuya Nishihara)
yuja added a comment. > command.append('l') > for arg in args: > > - command += "%d:%s" % (len(arg), arg) +command += pycompat.bytestr("%d:%s" % (len(arg), arg)) It's okay, but I think the original code would mean to do `command.append(...)`. >

D5737: py3: convert info.name to bytes in subrepo.py

2019-01-30 Thread yuja (Yuya Nishihara)
yuja added a comment. > for info in tar: > > +infoname = pycompat.bytestr(info.name) So `info.name` would come from environment. It's probably better to use `encoding.strtolocal()`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5737

D5742: histedit: add templating support to histedit's rule file generation

2019-01-30 Thread yuja (Yuya Nishihara)
yuja added a comment. > + [histedit] > + summary-format = '{rev} {bookmarks} {desc|firstline}' Perhaps, "summary-template" is more consistent with the other config keys. > ctx = self.repo[self.node] > > - summary = _getsummary(ctx) > - line = '%s %s %d %s' % (self.verb,

D5635: branchmap: make branchcache responsible for reading

2019-01-26 Thread yuja (Yuya Nishihara)
yuja added a comment. >> Why is that? @yuja, can you elaborate? > > > > This is version-controlled code that changes in lock-step with the branchmap module, adding backwards compatibility tests here would add a costly maintenance burden. If you have an older revision of the branchmap

D5620: grep: don't look up copy info unless --follow is given

2019-01-25 Thread yuja (Yuya Nishihara)
yuja added a comment. > diff --git a/mercurial/commands.py b/mercurial/commands.py > --- a/mercurial/commands.py > +++ b/mercurial/commands.py > @@ -2955,7 +2955,8 @@ def grep(ui, repo, pattern, *pats, **opt >copies.setdefault(rev, {})[fn] = copy >

D5698: wireprotov2peer: rewrite character traversal to use slices

2019-01-25 Thread yuja (Yuya Nishihara)
yuja added a comment. > + mercurial/wireprotov2peer.py:307: > + > self._ui.debug(_('received %r\n') % frame) > + don't mark debug messages for translation > + mercurial/wireprotov2peer.py:513: > + > return [True if raw[i:i+1] == b'1' else False for

D5628: diffstat: make --git work properly on renames (issue6025)

2019-01-25 Thread yuja (Yuya Nishihara)
yuja added a comment. > @@ -2808,6 +2808,10 @@ > > elif (line.startswith('GIT binary patch') or > line.startswith('Binary file')): > isbinary = True > > +elif line.startswith('rename from'): > +filename = line.split()[-1] > +elif

D5620: grep: don't look up copy info unless --follow is given

2019-01-25 Thread yuja (Yuya Nishihara)
yuja added a comment. > - if fn in skip: +copy = None +if follow: + try: +copied = flog.renamed(fnode) + except error.WdirUnsupported: +copied = ctx[fn].renamed() + copy = copied and

D5698: wireprotov2peer: rewrite character traversal to use slices

2019-01-25 Thread yuja (Yuya Nishihara)
yuja added a comment. + mercurial/wireprotov2peer.py:307: + > self._ui.debug(_('received %r\n') % frame) + don't mark debug messages for translation + mercurial/wireprotov2peer.py:513: + > return [True if raw[i:i+1] == b'1' else False for i in

D5690: py3: use regular expression to deal with ENOENT formatting change

2019-01-25 Thread yuja (Yuya Nishihara)
yuja added a comment. > $ hg log -b --cwd=inexistent default > > - abort: $ENOENT$: 'inexistent' + abort: \$ENOENT\$: ('inexistent'|inexistent) (re) That's our fault. The exception is caught as IOError on Python 3, and our formatting of IOError and OSError are slightly

D5594: copies: consider nullrev a common ancestor

2019-01-18 Thread yuja (Yuya Nishihara)
yuja added a comment. > There are definitely repositories in the wild where p1 is nullrev (and p2 is not). It's unusual but expressable so, of course, it happened. > > For that matters, there is also case with nullrev != p1 && p1 == p2. Well, I think it should be considered a

D5626: scmutil: drop unreachable except clause

2019-01-18 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued, thanks. > socket.error is a subclass of IOError, which we catch higher up. It For the record, it's Python 2.6 feature. https://docs.python.org/2.7/library/socket.html#socket.error REPOSITORY rHG Mercurial REVISION DETAIL

D5594: copies: consider nullrev a common ancestor

2019-01-18 Thread yuja (Yuya Nishihara)
yuja added a comment. > I've seen many bugs in the git codebase that were caused by it not > having a null revision and being forced to treat root commits > differently. Mercurial has a null revision and I think it's generally > a bug to treat it differently from other commits in

D5496: revset: add "samebranch" keyword argument to the merge revset

2019-01-17 Thread yuja (Yuya Nishihara)
yuja added a comment. > > Okay, I didn't notice that. And it's tricky to map `samebranch=False` to > > "different branch" constraint. I would read it as "I don't care whether > > the branches are the same or not." > > > > We can instead express it as `merge() -

D5579: rust: factorized testing Graphs

2019-01-17 Thread yuja (Yuya Nishihara)
yuja added a comment. > @yuja the doc you're linking is about integration tests, so it wouldn't apply to these tests which are really unitary in my mind. Usually the main difference would be the access to the private constructs that the integration tests can't perform, but it's true that

D5493: match: support rooted globs in hgignore

2019-01-17 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued this, many thanks. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5493 To: valentin.gatienbaron, #hg-reviewers Cc: yuja, foozy, mercurial-devel ___ Mercurial-devel mailing list

D5243: resolve: fix mark-check when a file was deleted on one side (issue6020)

2019-01-17 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued, thanks. Replaced all `[[ -f ]]` with `[ -f ]`. ``[[]]`` requires Bash. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5243 To: spectral, #hg-reviewers Cc: yuja, mercurial-devel ___

D5493: match: support rooted globs in hgignore

2019-01-16 Thread yuja (Yuya Nishihara)
yuja added a comment. > I haven't handled your other remark, I think `rootglob:` can be easily added. As we already have cwd-relative `glob:`, we'll just need some "if"s to not rewrite a repo.root-relative path to cwd-relative path. This patch works, but it's technically

D5496: revset: add "samebranch" keyword argument to the merge revset

2019-01-16 Thread yuja (Yuya Nishihara)
yuja added a comment. > > `[, samebranch]` or [, samebranch=False]`. > > I guess that means: > > @predicate('merge([withbranch [, samebranch=None]])', safe=True) > > Right? (I realized that it is incorrect to say that samebranch's default value is False).

D5579: rust: factorized testing Graphs

2019-01-16 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued the series, thanks. > +++ b/rust/hg-core/src/testing.rs Maybe we can add separate test files, but I don't know which is preferred. https://doc.rust-lang.org/book/ch11-03-test-organization.html#submodules-in-integration-tests REPOSITORY rHG

D5510: narrow: reuse narrowspec.updateworkingcopy() when widening

2019-01-16 Thread yuja (Yuya Nishihara)
yuja added a comment. Fixed pyflakes warnings in flight. hgext/narrow/narrowcommands.py:13: 'mercurial.merge' imported but unused hgext/narrow/narrowcommands.py:262: local variable 'newmatch' is assigned to but never used REPOSITORY rHG Mercurial REVISION DETAIL

D5495: revset: add "branch" positional arguments to the merge revset

2019-01-14 Thread yuja (Yuya Nishihara)
yuja added a comment. > What about making the argument a revset instead of a branch name. You can get the same result `merge(branch("foo")` but have a more expressive result `merge(only(4.8, 4.7))` ? That's basically a simpler form of my `filter()` proposal. The problem of

D5490: commit: remove ignore whitespace option on --interactive (issue6042)

2019-01-13 Thread yuja (Yuya Nishihara)
yuja added a comment. > > `_performrevert()` would be in the same boat, but it was explicitly flagged on > > at https://phab.mercurial-scm.org/rHGf37a69ec3f4717fdb4f00699ca06c225f106696c. This implies that the `diff.ignorews` option would be used > > in practice to exclude

D5495: revset: add "branch" positional arguments to the merge revset

2019-01-13 Thread yuja (Yuya Nishihara)
yuja added a comment. Generally looks good. Can you fix a couple of nits? And if possible, fold the tests from https://phab.mercurial-scm.org/D5577 into this and the next patch. We prefer including relevant test in each commit. > -@predicate('merge()', safe=True) >

D5496: revset: add "samebranch" keyword argument to the merge revset

2019-01-13 Thread yuja (Yuya Nishihara)
yuja added a comment. > -@predicate('merge(withbranch)', safe=True) > +@predicate('merge(withbranch, samebranch=True)', safe=True) `[, samebranch]` or [, samebranch=False]`. > withbranch = '' > if 'withbranch' in args: > withbranch = getstring(args['withbranch'], >

D5554: histedit: added rewrite.update-timestamp to fold and mess

2019-01-13 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued with minor modifications, thanks. > - a/tests/test-histedit-fold.t +++ b/tests/test-histedit-fold.t @@ -15,6 +15,7 @@ > logt = log --template '{rev}:{node|short} {desc|firstline}\n' > [extensions] > histedit= + > mockmakedate = $TESTDIR/mockmakedate.py >

D5559: revlog: always process opener options

2019-01-12 Thread yuja (Yuya Nishihara)
yuja added a comment. > I'm not sure when ``opener.options`` would ever be explicitly > set to None. It is definitely not possible to construct a repo > this way because ``localrepo.resolvestorevfsoptions()`` always > returns a dict and ``localrepo.makelocalrepository()`` always

D5564: revlog: use separate variables to track version flags

2019-01-12 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued up to this, thanks. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5564 To: indygreg, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list

D5561: revlog: always enable generaldelta on version 2 revlogs

2019-01-12 Thread yuja (Yuya Nishihara)
yuja added a comment. > - if self._initempty: > - # changelogs don't benefit from generaldelta +if self._initempty and (self.version & 0x == revlog.REVLOGV1): +# changelogs don't benefit from generaldelta. Perhaps, `debugdeltachain()` and `debugrevlog()` has to

D5490: commit: remove ignore whitespace option on --interactive (issue6042)

2019-01-12 Thread yuja (Yuya Nishihara)
yuja added a comment. > > It was intentionally added by https://phab.mercurial-scm.org/rHG3f1dccea9510c122cf9ab0e7a5a19ceed3600a7f (with no tests.) > > Do you want me to add tests for that? If yes, please mention the things I need to take care of on >writing those tests.

D5570: hg-docker: fix Python 3.4 compatibility (for CentOS 7)

2019-01-12 Thread yuja (Yuya Nishihara)
yuja added a comment. > +if p.returncode: > +raise Exception('failed to build docker image: %s %s' % (p.stdout, p.stderr)) Can you change the exception type? test-check-code.t complains about it. REPOSITORY rHG Mercurial REVISION DETAIL

D5490: commit: remove ignore whitespace option on --interactive (issue6042)

2019-01-12 Thread yuja (Yuya Nishihara)
yuja added a comment. > - a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -237,6 +237,7 @@ def dorecord(ui, repo, commitfunc, cmdsuggest, backupall, filterfn, *pats, **opts): opts = pycompat.byteskwargs(opts) +ignorews = opts.get('ignorews', False) It isn't nice to mix command

D5554: histedit: added rewrite.update-timestamp to fold and mess

2019-01-12 Thread yuja (Yuya Nishihara)
yuja added a comment. > + $ cat >> testmocks.py << EOF > + > # mock out util.makedate() to supply testable values > + > import os > + > from mercurial import pycompat, util > + > from mercurial.utils import dateutil > + > > + > def mockmakedate(): > + >

D5552: tests: add test for warning on histedit with tagged commits

2019-01-12 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued, thanks. > + $ echo '[extensions]' >> $HGRCPATH > + $ echo 'histedit =' >> $HGRCPATH Removed these lines. The extension is enabled at the beginning. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5552 To:

D5480: tests: show that debugrebuilddirstate is broken with narrow+sparse

2019-01-11 Thread yuja (Yuya Nishihara)
yuja added a comment. > + $ hg debugrebuilddirstate > + ** unknown exception encountered, please report by visiting > + ** https://mercurial-scm.org/wiki/BugTracker > + ** Python 2.7.12 (default, Nov 12 2018, 14:36:49) [GCC 5.4.0 20160609] > + ** Mercurial Distributed SCM

D5532: context: schedule file prefetch before comparing for cleanliness

2019-01-11 Thread yuja (Yuya Nishihara)
yuja added a comment. > +scmutil.prefetchfiles( > +self.repo(), [self.p1().rev()], > +matchmod.match('', '', patterns=self._cache.keys(), exact=True)) Perhaps `scmutil.matchfiles()` can be used instead of the low-level constructor. REPOSITORY rHG

D5495: revset: add "branch" positional arguments to the merge revset

2019-01-11 Thread yuja (Yuya Nishihara)
yuja added a comment. > This would not make it possible to select multiple "merged with" branches by doing: hg log -r "merge(feature1, feature2)" > Instead I guess you are proposing that for that use case we force the user to do: hg log -r "merge('re:(feature1|feature2)') > >

D5551: rust-cpython: using MissingAncestors from Python code

2019-01-11 Thread yuja (Yuya Nishihara)
yuja added subscribers: lothiraldan, yuja. yuja added a comment. > +bases = self._common.bases > +if callable(bases): > +# This happens for Rust exported object, and we don't know > +# at the moment how to make an equivalent of property for them

D5550: rust-cpython: bindings for MissingAncestors

2019-01-11 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued up to this patch, thanks. > +def __new__(_cls, index: PyObject, bases: PyObject) -> PyResult { > +let bases_vec: Vec = rev_pyiter_collect(py, )?; > +let inner = CoreMissing::new(Index::new(py, index)?, bases_vec); We might want

D5490: commit: remove ignore whitespace option on --interactive (issue6042)

2019-01-11 Thread yuja (Yuya Nishihara)
yuja added a comment. > - diffopts = patch.difffeatureopts(ui, opts=opts, whitespace=True) + diffopts = patch.difffeatureopts(ui, opts=opts) Sorry for late, but doesn't it break `hg record --ignore-all-space`, etc.? It was intentionally added by

D5495: revset: add "branch" positional arguments to the merge revset

2019-01-10 Thread yuja (Yuya Nishihara)
yuja added a comment. > I think it would be a good idea to make the "branch" arguments more flexible. One option could be to use a stringmatcher to add support for regular expressions as you suggest. I can look into that. However there may be some other options worth exploring. The one

D5543: histedit: crashing with a more useful error message on empty defaultrev

2019-01-10 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued for stable, thanks. > +else: > +raise error.Abort('config option histedit.defaultrev can\'t be empty') Wrapped the message with `_()`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D5543 To: rdamazio,

D5503: vfs: add support for repo names with `$` when using with env vars (issue5739)

2019-01-09 Thread yuja (Yuya Nishihara)
yuja added a comment. > > This is logically incorrect. The problem is that we're doing variable > > expansion at too lower layer. `vfs(expand(user_specified_path))` makes > > some sense, but `vfs(expand(getcwd()))` is clearly wrong. And the vfs class > > can't know where the

D5493: match: support rooted globs in hgignore

2019-01-09 Thread yuja (Yuya Nishihara)
yuja added subscribers: foozy, yuja. yuja added a comment. > The code already supports this but there is no syntax to make use of > it, so it seems reasonable to create such syntax. I create a new > hgignore syntax "rootedglob". There might be a better name, but > "rooted" is the

D5495: revset: add "branch" positional arguments to the merge revset

2019-01-07 Thread yuja (Yuya Nishihara)
yuja added a comment. > +@predicate('merge(*withbranch)', safe=True) > > def merge(repo, subset, x): > > - """Changeset is a merge changeset. +"""Changeset is a merge changeset + +All merge revisions are returned by default. If one or more "withbranch" +names are

D5503: vfs: add support for repo names with `$` when using with env vars (issue5739)

2019-01-07 Thread yuja (Yuya Nishihara)
yuja added a comment. > def __init__(self, base, audit=True, cacheaudited=False, expandpath=False, >realpath=False): > > +if '$' in base and os.path.isdir(base): > +# when there exists a repo '$foo' and an env var foo=bar, stop > +

<    1   2   3   4   5   6   7   8   9   10   >