yuja (Yuya Nishihara)
User

Projects

User Details

User Since
Jun 29 2017, 11:25 AM (46 w, 5 d)

Recent Activity

Today

yuja added a comment to D3648: show: Get rid of extraneous space if `tip` also has other bookmarks.

separate() can't be used here since it takes non-list arguments.

Wed, May 23, 8:41 AM

Yesterday

yuja committed rHGc65931d23baf: githelp: do not concatenate i18n messages dynamically so they can be collected.
githelp: do not concatenate i18n messages dynamically so they can be collected
Tue, May 22, 5:36 PM
yuja added a comment to D3559: narrow: only wrap dirstate functions once, instead of per-reposetup.
  • a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -778,6 +778,9 @@

    @repofilecache('dirstate') def dirstate(self): + return self._makedirstate() + + def _makedirstate(self):
Tue, May 22, 8:34 AM
yuja added a comment to D3579: state: write the version number in plain text on top of state files.

mercurial/state.py:65: undefined name 'iv'
mercurial/state.py:73: local variable 'version' is assigned to but never used

Tue, May 22, 8:13 AM
yuja added a comment to D3635: py3: add support for NoneType in stringutil.pprint().

> --- a/mercurial/utils/stringutil.py
> +++ b/mercurial/utils/stringutil.py
> @@ -29,6 +29,8 @@
> if bprefix:
> return "b'%s'" % escapestr(o)
> return "'%s'" % escapestr(o)
> + elif o is None:
> + return 'None'

Should be handled by b'%r' % o.

Tue, May 22, 7:41 AM
yuja added a comment to D3635: py3: add support for NoneType in stringutil.pprint().
  • a/mercurial/utils/stringutil.py +++ b/mercurial/utils/stringutil.py @@ -29,6 +29,8 @@ if bprefix: return "b'%s'" % escapestr(o) return "'%s'" % escapestr(o) + elif o is None: + return 'None'
Tue, May 22, 7:23 AM
yuja added a comment to D3631: py3: use pycompat.fsencode to convert path to bytes.
    • a/contrib/hg-ssh +++ b/contrib/hg-ssh @@ -39,6 +39,7 @@

      from mercurial import ( dispatch, + pycompat, ui as uimod, )

      @@ -69,7 +70,7 @@ path = cmdargv[2] repo = os.path.normpath(os.path.join(cwd, os.path.expanduser(path))) if repo in allowed_paths:
  • cmd = [b'-R', repo, b'serve', b'--stdio'] + cmd = [b'-R', pycompat.fsencode(repo), b'serve', b'--stdio']
Tue, May 22, 7:20 AM
yuja added a comment to D3579: state: write the version number in plain text on top of state files.
  • def save(self, data): + def save(self, version, data): """write all the state data stored to .hg/<filename> file

    we use third-party library cbor to serialize data to write in the file. """ + if not isinstance(version, int): + raise error.ProgrammingError("version of state file should be" + " an integer") + with self._repo.vfs(self.fname, 'wb', atomictemp=True) as fp: + fp.write('%d\n' % iv) cbor.dump(self.opts, fp, canonical=True)

    def _read(self): """reads the state file and returns a dictionary which contain data in the same format as it was before storing""" with self._repo.vfs(self.fname, 'rb') as fp: + try: + version = int(fp.readline())
Tue, May 22, 7:13 AM

Mon, May 21

yuja added a comment to D3614: py3: check for None before comparing with integers.
    • a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -846,7 +846,7 @@ def rawsize(self, rev): """return the length of the uncompressed text for a given revision""" l = self.index[rev][2]
  • if l >= 0: + if l is not None and l >= 0:
Mon, May 21, 9:11 AM
yuja added a comment to D3612: py3: use pycompat.fsencode() to convert tempfile name to bytes.
bundle = None
try:  # guards bundle
  • bundlepath = "bundle:%s+%s" % (op.repo.root, bundlefile) + bundlepath = "bundle:%s+%s" % (op.repo.root, + pycompat.fsencode(bundlefile))
Mon, May 21, 8:58 AM
yuja added a comment to D3590: py3: make sure we pass str to date.strftime().
  • return date.strftime(opts['dateformat']) + return date.strftime(pycompat.sysstr(opts['dateformat']))
Mon, May 21, 8:42 AM

Sat, May 19

yuja committed rHG7c05198cd1ca: push: continue without locking on lock failure other than EEXIST (issue5882).
push: continue without locking on lock failure other than EEXIST (issue5882)
Sat, May 19, 10:03 PM
yuja committed rHG3c995af3066e: hgweb: wrap {entries}* of tags with mappinggenerator.
hgweb: wrap {entries}* of tags with mappinggenerator
Sat, May 19, 5:01 AM
yuja committed rHG17f7b44367bb: hgweb: wrap {fentries} and {dentries} of manifest with mappinggenerator.
hgweb: wrap {fentries} and {dentries} of manifest with mappinggenerator
Sat, May 19, 5:00 AM
yuja committed rHGd3b4c4769b5c: hgweb: wrap {entries}* of changelog with mappinglist.
hgweb: wrap {entries}* of changelog with mappinglist
Sat, May 19, 5:00 AM
yuja committed rHGaeccb08af311: hgweb: wrap {lines} of filerevision with mappinggenerator.
hgweb: wrap {lines} of filerevision with mappinggenerator
Sat, May 19, 5:00 AM
yuja committed rHG4c3ab15f3532: hgweb: drop unused argument 'tmpl' from webutil.diffstat().
hgweb: drop unused argument 'tmpl' from webutil.diffstat()
Sat, May 19, 5:00 AM
yuja committed rHG6369e21e97ac: hgweb: use template context to render {diffstat}.
hgweb: use template context to render {diffstat}
Sat, May 19, 5:00 AM
yuja committed rHGf0ee627162f4: hgweb: wrap {diffstat} with mappedgenerator.
hgweb: wrap {diffstat} with mappedgenerator
Sat, May 19, 5:00 AM

Fri, May 18

yuja added a comment to D3586: patch: use slicing to check patch line prefixes.

This appears to conflict with D3580.

Fri, May 18, 10:35 PM
yuja added a comment to D3587: pathencode: fix importing hashlib on Python 3.

Nit: name is no longer used.

Fri, May 18, 10:35 PM
yuja committed rHG37ef6ee87488: test-http-branchmap: fix stdio mode on Windows.
test-http-branchmap: fix stdio mode on Windows
Fri, May 18, 5:30 AM
yuja committed rHG69779a222d5e: test-http-branchmap: fix encoding test to wrap the server stream.
test-http-branchmap: fix encoding test to wrap the server stream
Fri, May 18, 5:30 AM

Thu, May 17

yuja committed rHGa4a5c3085ea9: test-merge-tools: create repo directory to free $TESTTMP for temporary files.
test-merge-tools: create repo directory to free $TESTTMP for temporary files
Thu, May 17, 3:00 PM
yuja added a comment to D3553: notify: add option to include function names in the diff output.

+ $ hg commit -m changefunction
+ $ hg --cwd ../b --config notify.show-functions=True pull ../a

Thu, May 17, 8:12 AM

Wed, May 16

yuja committed rHGc3fd9a0f8277: dispatch: mask negative exit code recorded in blackbox log.
dispatch: mask negative exit code recorded in blackbox log
Wed, May 16, 12:39 PM
yuja committed rHG48853a927757: dispatch: fix exit code of unhandled exception recorded in blackbox log.
dispatch: fix exit code of unhandled exception recorded in blackbox log
Wed, May 16, 12:39 PM
yuja added a comment to D3553: notify: add option to include function names in the diff output.

+ notify.show-functions
+ Set to True to get the equivalent of "hg diff --show-functions". Default:
+ False

Wed, May 16, 8:18 AM
yuja added a comment to D3562: tests: mark tests that fail when using chg as #require no-chg.

REVISION SUMMARY

As far as I can tell, most of these failures are due to using $HGPORT, which it
seems chg might be using itself? I don't know enough to debug these failures to
fix them properly.
Wed, May 16, 8:07 AM
yuja added a comment to D3559: narrow: only wrap dirstate functions once, instead of per-reposetup.

-def setup(repo):
+# Mapping of root:str to repo for repos that have the narrow requirement
+# specified.
+_rootrepomap = {}
+
+def _getrepo(ds):
+ """Check if narrow is enabled for repo associated with ds; return repo."""
+ return _rootrepomap.get(ds._root, None)

Wed, May 16, 8:07 AM
yuja added a comment to D3561: dispatch: drop redundant setting of "ret" to -1.

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py

    • a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -230,7 +230,6 @@ except IOError as inst: if inst.errno != errno.EPIPE: raise
  • ret = -1 finally: duration = util.timer() - starttime req.ui.flush()
Wed, May 16, 7:42 AM
yuja added a comment to D3569: py3: convert the report to bytes.
    • a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -1028,7 +1028,7 @@ ' which supports versions %s of Mercurial.\n' ' Please disable %s and try your action again.\n' '** If that fixes the bug please report it to %s\n')
  • % (name, testedwith, name, report)) + % (name, testedwith, name, pycompat.bytestr(report)))
Wed, May 16, 7:42 AM

Sat, May 12

yuja committed rHG6f9ac3cb0987: dispatch: unify handling of None returned by a command function.
dispatch: unify handling of None returned by a command function
Sat, May 12, 2:17 PM
yuja added a comment to D3536: json: reject unicode on py2 as well.
  • elif isinstance(obj, str):
  • # This branch is unreachable on Python 2, because bytes == str
  • # and we'll return in the next-earlier block in the elif
  • # ladder. On Python 3, this helps us catch bugs before they
  • # hurt someone. + elif isinstance(obj, (str, pycompat.unicode)): + # On Python 2, we'll only get here if obj is unicode, because + # str == bytes, so str is handled above.
Sat, May 12, 2:52 AM
yuja added a comment to D3444: tests: comprehensively test exit handling.
> I generally like the direction of this series, but I think there's no point
>  to extend Mercurial's exit code handling to support all weird Python types.
>
> Only ints and (None for 0) are ever valid.


The reason I did this is because from the context or `rhg`, we don't have CPython's default exit handling to fall back on. Our choices are:

1. Reimplement CPython's exit/error handling in Rust
2. Reimplement CPython's exit/error handling in Python in dispatch [so the end state is more well-defined]
3. Do something crude in `rhg` when we hit special cases that CPython would normally deal with.

Since extensions could do weird things, I figured 2 was the best option.
Sat, May 12, 1:52 AM
yuja added a comment to D3536: json: reject unicode on py2 as well.
`unicode` is not a type on Python 3. I think this should be changed to `(str, pycompat.unicode)`.
Sat, May 12, 1:52 AM

Fri, May 11

yuja committed rHG623dc2651d26: hgweb: drop unused argument 'tmpl' from webutil.compare().
hgweb: drop unused argument 'tmpl' from webutil.compare()
Fri, May 11, 11:41 PM
yuja committed rHGb3992c21b7f3: hgweb: convert {comparison} to a mappinggenerator with named template.
hgweb: convert {comparison} to a mappinggenerator with named template
Fri, May 11, 11:41 PM
yuja committed rHG4e407c7b1fbd: hgweb: rename 'context' argument of webutil.compare() to avoid name conflicts.
hgweb: rename 'context' argument of webutil.compare() to avoid name conflicts
Fri, May 11, 11:41 PM
yuja committed rHGc0ccbf4fbe47: hgweb: convert comparison {lines} to a mappinggenerator with named template.
hgweb: convert comparison {lines} to a mappinggenerator with named template
Fri, May 11, 11:41 PM
yuja committed rHG406f945c5814: hgweb: move compline() closure out of compare().
hgweb: move compline() closure out of compare()
Fri, May 11, 11:41 PM
yuja committed rHG53b0a51aed72: hgweb: move getblock() closure out of compare().
hgweb: move getblock() closure out of compare()
Fri, May 11, 11:41 PM
yuja committed rHG8cc23a46df37: hgweb: convert {diff} to a mappinggenerator with named template.
hgweb: convert {diff} to a mappinggenerator with named template
Fri, May 11, 11:41 PM
yuja committed rHG6a4de2dc78dd: hgweb: wrap {lines} of {diff} with mappedgenerator.
hgweb: wrap {lines} of {diff} with mappedgenerator
Fri, May 11, 11:41 PM
yuja committed rHG7a9e9fbaa559: hgweb: use template context to render {lines} of {diff}.
hgweb: use template context to render {lines} of {diff}
Fri, May 11, 11:41 PM
yuja committed rHG3f70466ec7aa: hgweb: move prettyprintlines() closure out of diffs().
hgweb: move prettyprintlines() closure out of diffs()
Fri, May 11, 11:41 PM
yuja committed rHG6e526b0961a8: help: load module doc of disabled extension in extensions.disabledcmd().
help: load module doc of disabled extension in extensions.disabledcmd()
Fri, May 11, 8:20 PM
yuja committed rHG5b60f7d652f2: extensions: drop dead code trying to exclude deprecated disabled commands.
extensions: drop dead code trying to exclude deprecated disabled commands
Fri, May 11, 8:20 PM
yuja committed rHGb45f4c1532c0: extensions: extract closure that looks for commands from disabled module.
extensions: extract closure that looks for commands from disabled module
Fri, May 11, 8:20 PM
yuja committed rHG59f1e33f74a6: util: drop remainder of dateutil/procutil aliases (API).
util: drop remainder of dateutil/procutil aliases (API)
Fri, May 11, 8:09 PM
yuja committed rHGedb28a6d95b7: revset: pass in lookup function to matchany() (issue5879).
revset: pass in lookup function to matchany() (issue5879)
Fri, May 11, 3:32 PM
yuja committed rHG69381a28b456: test-hgweb: add test for foo-bar name lookup.
test-hgweb: add test for foo-bar name lookup
Fri, May 11, 3:32 PM
yuja committed rHGc4313a9fde7b: hgweb: use template context to render {files} of changesetentry().
hgweb: use template context to render {files} of changesetentry()
Fri, May 11, 3:32 PM
yuja committed rHG028d7c24f2e5: hgweb: wrap {files} of changelist entries with mappedgenerator.
hgweb: wrap {files} of changelist entries with mappedgenerator
Fri, May 11, 3:32 PM
yuja committed rHG4237d07fad2c: hgweb: use template context to render {files} of changelist entries.
hgweb: use template context to render {files} of changelist entries
Fri, May 11, 3:32 PM
yuja committed rHG9482498b96b0: hgweb: remove unused argument 'tmpl' from listfilediffs().
hgweb: remove unused argument 'tmpl' from listfilediffs()
Fri, May 11, 3:32 PM
yuja committed rHG790ca0c11fd4: hgweb: wrap {files} of changesetentry() with mappedgenerator.
hgweb: wrap {files} of changesetentry() with mappedgenerator
Fri, May 11, 3:32 PM
yuja committed rHG1129e444fd6c: hgweb: extract generator of {files} from changesetentry().
hgweb: extract generator of {files} from changesetentry()
Fri, May 11, 3:32 PM
yuja committed rHG3ea3c96ada54: encoding: introduce tagging type for non-lossy non-ASCII string.
encoding: introduce tagging type for non-lossy non-ASCII string
Fri, May 11, 3:32 PM
yuja committed rHGa25513263075: templatefilters: document the json filter.
templatefilters: document the json filter
Fri, May 11, 3:32 PM
yuja committed rHG57b0c7221dba: encoding: fix toutf8b() to resurrect lossy characters even if "\xed" in it.
encoding: fix toutf8b() to resurrect lossy characters even if "\xed" in it
Fri, May 11, 3:32 PM
yuja committed rHGbfe8ef6e370e: sshserver: redirect stdin/stdout early and use duplicated streams.
sshserver: redirect stdin/stdout early and use duplicated streams
Fri, May 11, 3:32 PM
yuja committed rHGdc1ed7fe33e4: sshserver: do setbinary() by caller (API).
sshserver: do setbinary() by caller (API)
Fri, May 11, 3:32 PM
yuja committed rHG45a669bad421: test-ssh: add some flush() to make output deterministic.
test-ssh: add some flush() to make output deterministic
Fri, May 11, 3:32 PM
yuja committed rHGaf83a0ed0afb: stringutil: make pprint() forward uninteresting object to b'%r'.
stringutil: make pprint() forward uninteresting object to b'%r'
Fri, May 11, 3:32 PM
yuja committed rHG32bc3815efae: stringutil: flip the default of pprint() to bprefix=False.
stringutil: flip the default of pprint() to bprefix=False
Fri, May 11, 3:32 PM
yuja added a comment to D3502: shortest: move revnum-disambiguation out of revlog.

+ def disambiguate(prefix):
+ """Disambiguate against revnums."""
+ hexnode = hex(node)
+ for length in range(len(prefix), 41):

Fri, May 11, 3:31 PM
yuja added a comment to D3499: revlog: use node tree (native code) for shortest() calculation.

+static int nt_shortest(indexObject *self, const char *node)
+{
+ int level, off;
+
+ if (nt_init(self) == -1)
+ return -3;
+ if (nt_populate(self) == -1)
+ return -3;
+
+ for (level = off = 0; level < 40; level++) {
+ int k, v;
+ nodetree *n = &self->nt[off];
+ k = nt_level(node, level);
+ v = n->children[k];
+ if (v < 0) {
+ v = -(v + 1);
+ const char *n = index_node(self, v);

Fri, May 11, 3:31 PM
yuja added a comment to D3528: tests: port test-simplekeyvaluefile.py to Python 3.

Fixed as b'kvfile' in flight.

Fri, May 11, 3:31 PM
yuja added a comment to D3517: shelve: reduce scope of merge tool config override.
> > +        shelvectx = _rebaserestoredcommit(ui, repo, opts, tr, oldtiprev,
> >  +                                          basename, pctx, tmpwctx,
> >  +                                          shelvectx, branchtorestore,
> >  +                                          activebookmark)
> > 
> >   overrides = {('ui', 'forcemerge'): opts.get('tool', '')}
> >   with ui.configoverride(overrides, 'unshelve'):
>
> Maybe I'm wrong, but doesn't rebase do merge?


Correct, but we seem to be passing the tool explicitly to the rebase command on line 755.
Fri, May 11, 3:31 PM
yuja committed rHG5f3bad9e4193: hgweb: remove unused argument 'tmpl' from listfilediffs().
hgweb: remove unused argument 'tmpl' from listfilediffs()
Fri, May 11, 12:47 AM
yuja committed rHG9adcadd57f03: hgweb: use template context to render {files} of changelist entries.
hgweb: use template context to render {files} of changelist entries
Fri, May 11, 12:47 AM
yuja committed rHG921281543812: hgweb: wrap {files} of changelist entries with mappedgenerator.
hgweb: wrap {files} of changelist entries with mappedgenerator
Fri, May 11, 12:47 AM
yuja committed rHG011d768c09f1: hgweb: use template context to render {files} of changesetentry().
hgweb: use template context to render {files} of changesetentry()
Fri, May 11, 12:47 AM
yuja committed rHG30c38b0e35b2: hgweb: extract generator of {files} from changesetentry().
hgweb: extract generator of {files} from changesetentry()
Fri, May 11, 12:47 AM
yuja committed rHG7fdde08fdfe8: hgweb: wrap {files} of changesetentry() with mappedgenerator.
hgweb: wrap {files} of changesetentry() with mappedgenerator
Fri, May 11, 12:47 AM
yuja committed rHG7abc3007e53d: templatefilters: document the json filter.
templatefilters: document the json filter
Fri, May 11, 12:47 AM
yuja committed rHG0f0cda185935: encoding: introduce tagging type for non-lossy non-ASCII string.
encoding: introduce tagging type for non-lossy non-ASCII string
Fri, May 11, 12:47 AM
yuja committed rHGdeda2d5aedd1: encoding: fix toutf8b() to resurrect lossy characters even if "\xed" in it.
encoding: fix toutf8b() to resurrect lossy characters even if "\xed" in it
Fri, May 11, 12:47 AM
yuja committed rHG57203002193c: sshserver: do setbinary() by caller (API).
sshserver: do setbinary() by caller (API)
Fri, May 11, 12:47 AM
yuja committed rHG085a74589b1b: sshserver: redirect stdin/stdout early and use duplicated streams.
sshserver: redirect stdin/stdout early and use duplicated streams
Fri, May 11, 12:47 AM
yuja committed rHGe0e605dfb61b: test-ssh: add some flush() to make output deterministic.
test-ssh: add some flush() to make output deterministic
Fri, May 11, 12:47 AM

Thu, May 10

yuja committed rHGfd3b0a6de2ff: stringutil: make pprint() forward uninteresting object to b'%r'.
stringutil: make pprint() forward uninteresting object to b'%r'
Thu, May 10, 4:35 PM
yuja committed rHG15416dad7cee: stringutil: flip the default of pprint() to bprefix=False.
stringutil: flip the default of pprint() to bprefix=False
Thu, May 10, 4:35 PM
yuja committed rHGfaa41fd282d1: templatefuncs: show hint if extdata source is evaluated to empty (issue5843).
templatefuncs: show hint if extdata source is evaluated to empty (issue5843)
Thu, May 10, 2:47 PM
yuja added a comment to D3517: shelve: reduce scope of merge tool config override.

+ shelvectx = _rebaserestoredcommit(ui, repo, opts, tr, oldtiprev,
+ basename, pctx, tmpwctx,
+ shelvectx, branchtorestore,
+ activebookmark)

overrides = {('ui', 'forcemerge'): opts.get('tool', '')}
with ui.configoverride(overrides, 'unshelve'):
Thu, May 10, 9:15 AM
yuja added a comment to D3499: revlog: use node tree (native code) for shortest() calculation.

Looks generally good, but can you fix your editor to not do Google indent?

Thu, May 10, 9:08 AM
yuja added a comment to D3439: templatefilters: add commonprefix.

+ $ hg debugtemplate '{"foo/bar\nfoo/bar\n"|splitlines|commonprefix}\n'
+ foo

Thu, May 10, 8:40 AM

Wed, May 9

yuja committed rHG34f259a1c153: hgweb: wrap {instabilities} by hybridlist().
hgweb: wrap {instabilities} by hybridlist()
Wed, May 9, 7:49 PM
yuja committed rHG10d3dc8123c5: hgweb: wrap {succsandmarkers} with mappinggenerator.
hgweb: wrap {succsandmarkers} with mappinggenerator
Wed, May 9, 7:49 PM
yuja committed rHG3dc4045db164: hgweb: wrap {whyunstable} with mappinggenerator.
hgweb: wrap {whyunstable} with mappinggenerator
Wed, May 9, 7:49 PM
yuja committed rHG16c7a6ac8f94: hgweb: drop tmpl argument from webutil.showtag() and showbookmark().
hgweb: drop tmpl argument from webutil.showtag() and showbookmark()
Wed, May 9, 7:49 PM
yuja committed rHG89db78126f7f: hgweb: wrap {branches} and {entries} of branches with mappinggenerator.
hgweb: wrap {branches} and {entries} of branches with mappinggenerator
Wed, May 9, 7:49 PM
yuja committed rHG26aed0d561e8: hgweb: wrap {changelogtag}, {changesettag}, and {changesetbookmark}.
hgweb: wrap {changelogtag}, {changesettag}, and {changesetbookmark}
Wed, May 9, 7:49 PM
yuja committed rHGec03f3aa2d14: hgweb: drop useless **args from webutil.showtag() and showbookmark().
hgweb: drop useless **args from webutil.showtag() and showbookmark()
Wed, May 9, 7:49 PM
yuja added a comment to D3439: templatefilters: add commonprefix.

Please add tests of edge cases.

Wed, May 9, 8:46 AM
yuja committed rHGa5d16f23a2c9: hgweb: wrap {inbranch} by hybridlist().
hgweb: wrap {inbranch} by hybridlist()
Wed, May 9, 1:20 AM
yuja committed rHG3b3d818bde8b: hgweb: wrap {branch} and {changesetbranch} by hybridlist().
hgweb: wrap {branch} and {changesetbranch} by hybridlist()
Wed, May 9, 1:20 AM
yuja committed rHG40a664bd06fa: hgweb: wrap {bookmarks} by hybridlist().
hgweb: wrap {bookmarks} by hybridlist()
Wed, May 9, 1:20 AM
yuja committed rHGf5155bca5023: hgweb: wrap {branches} by hybridlist().
hgweb: wrap {branches} by hybridlist()
Wed, May 9, 1:20 AM