Feed Advanced Search

Yesterday

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
Wed, Feb 20, 1:03 AM

Tue, Feb 12

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')

Tue, Feb 12, 7:49 AM

Mon, Feb 11

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.
Mon, Feb 11, 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.
Mon, Feb 11, 8:43 AM

Sun, Feb 10

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

Getting close.

Sun, Feb 10, 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?
Sun, Feb 10, 9:12 PM

Sat, Feb 9

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
Sat, Feb 9, 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.
Sat, Feb 9, 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'))

Sat, Feb 9, 8:27 PM

Thu, Feb 7

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

Thu, Feb 7, 8:18 AM
yuja added a comment to D5490: commit: remove ignore whitespace option on --interactive (issue6042).
@spectral @yuja Can I close this?
Thu, Feb 7, 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)))
Thu, Feb 7, 7:58 AM

Tue, Feb 5

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?
Tue, Feb 5, 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)
Tue, Feb 5, 5:44 PM
yuja committed rHG13f7a6a4f0db: revset: leverage getintrange() helper in relation-subscript operation (API).
revset: leverage getintrange() helper in relation-subscript operation (API)
Tue, Feb 5, 9:14 AM
yuja committed rHG1c04894e8fe1: revset: allow to parse single integer as a range.
revset: allow to parse single integer as a range
Tue, Feb 5, 9:14 AM
yuja committed rHG59638c6fcb70: revset: extract a helper to parse integer range.
revset: extract a helper to parse integer range
Tue, Feb 5, 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.
Tue, Feb 5, 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.)
Tue, Feb 5, 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.

Tue, Feb 5, 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).
Tue, Feb 5, 7:03 AM

Mon, Feb 4

yuja committed rHG549f956ba2a9: py3: don't use universal_newlines in svnsubrepo.
py3: don't use universal_newlines in svnsubrepo
Mon, Feb 4, 4:55 PM
yuja committed rHGd65519e5dd04: py3: remove unneeded fsencode() from gitsubrepo.
py3: remove unneeded fsencode() from gitsubrepo
Mon, Feb 4, 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().

Mon, Feb 4, 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.
Mon, Feb 4, 7:20 AM

Sun, Feb 3

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.
Sun, Feb 3, 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.
Sun, Feb 3, 7:48 AM

Sat, Feb 2

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)

Sat, Feb 2, 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)
Sat, Feb 2, 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.

Sat, Feb 2, 9:13 PM
yuja committed rHGdbf20e28d1a6: py3: don't use universal_newlines in svnsubrepo.
py3: don't use universal_newlines in svnsubrepo
Sat, Feb 2, 10:45 AM
yuja committed rHG921b4ffa9ced: py3: remove unneeded fsencode() from gitsubrepo.
py3: remove unneeded fsencode() from gitsubrepo
Sat, Feb 2, 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?)?
Sat, Feb 2, 1:37 AM

Fri, Feb 1

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.
Fri, Feb 1, 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 :.

Fri, Feb 1, 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.

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

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

Fri, Feb 1, 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)
Fri, Feb 1, 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)
Fri, Feb 1, 8:50 PM
yuja committed rHG83377b4b4ae0: subrepo: reject potentially unsafe subrepo paths (BC) (SEC).
subrepo: reject potentially unsafe subrepo paths (BC) (SEC)
Fri, Feb 1, 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)
Fri, Feb 1, 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)
Fri, Feb 1, 1:54 PM
yuja added a comment to D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839).

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).

Fri, Feb 1, 8:20 AM
yuja added a comment to D5785: blackbox: take regex patterns for blackbox.track.

+ track = ui.configlist('blackbox', 'track')
+ if not track:
+ self._active = False
+ elif b'*' in track:
+ self._trackedevents = re.compile(b'.*')
+ else:
+ try:
+ self._trackedevents = re.compile(b'|'.join(track))
+ except re.error as e:
+ ui.warn('invalid blackbox.track setting: %s\n' % e)
+ self._active = False

Fri, Feb 1, 8:19 AM

Thu, Jan 31

yuja added a comment to D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839).
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 I think I can understand why this is desired for this command. Maybe a better option is to change the difffeatureopts() call to replace the section that it looks in? i.e. change:

  diffopts = patch.difffeatureopts(repo.ui, whitespace=True)

to:

  diffopts = patch.difffeatureopts(repo.ui, section='commands-interactive', whitespace=True)

This way we aren't looking at the `[diff]` section, so the options specified on the commandline end up working, and if someone really does want this as a default, they can get that behavior.

I'm not at all attached to that section name, i.e. I could see this being something like the following, to make it look at commands.commit.interactive.ignorews (and others):

  diffopts = patch.difffeatureopts(repo.ui, section='commands', configprefix='commit.interactive.', whitespace=True)

I think I like that option, I'll send a patch for it.
Thu, Jan 31, 5:57 PM
yuja added a comment to D5778: svnurlof: fix check-code errors I introduced.

+from future import absolute_import, print_function

Thu, Jan 31, 8:28 AM
yuja added a comment to D5772: hg: raise Abort on invalid path.

+ 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)))

Thu, Jan 31, 7:55 AM
yuja added a comment to D5768: subrepo: bytes/str cleanups on Git support.

Curious why subprocess output can be a unicode. Is it a sort of text-mode
stream?

Thu, Jan 31, 7:55 AM

Wed, Jan 30

yuja added a comment to D5739: montone: fix addition to list by using .append() instead of '+'.
command.append('l')
for arg in args:
  • command += "%d:%s" % (len(arg), arg) + command += pycompat.bytestr("%d:%s" % (len(arg), arg))
Wed, Jan 30, 7:21 AM
yuja added a comment to D5737: py3: convert info.name to bytes in subrepo.py.
for info in tar:

+ infoname = pycompat.bytestr(info.name)

Wed, Jan 30, 7:21 AM
yuja added a comment to D5742: histedit: add templating support to histedit's rule file generation.

Perhaps, "summary-template" is more consistent with the other config keys.

Wed, Jan 30, 7:11 AM

Mon, Jan 28

yuja committed rHGf83b230b7fb3: dispatch: unify handler of IOError and OSError.
dispatch: unify handler of IOError and OSError
Mon, Jan 28, 12:49 AM
yuja committed rHGb5169e79c31c: dispatch: add inline comment about possible IOError subtypes.
dispatch: add inline comment about possible IOError subtypes
Mon, Jan 28, 12:49 AM
yuja committed rHGb6673e9bdcf6: dispatch: quote filename in IOError as well.
dispatch: quote filename in IOError as well
Mon, Jan 28, 12:49 AM

Sat, Jan 26

yuja added a comment to D5635: branchmap: make branchcache responsible for reading.

> 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 module, you also have an older revision of the perf code.

I'm pretty sure the idea is that you should be able to enable the latest perf extension and run different versions of hg (perhaps versions that you had already built) against it to compare performance.

Sat, Jan 26, 9:52 PM
yuja added a comment to D5620: grep: don't look up copy info unless --follow is given.
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
                     if fn in skip:
                         skip[copy] = True
-                        continue
+            if fn in skip:
+                continue
             files.append(fn)
Sat, Jan 26, 2:10 AM
yuja added a comment to D5698: wireprotov2peer: rewrite character traversal to use slices.
+  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 range(len(raw))]
+   missing whitespace in expression
Sat, Jan 26, 2:10 AM
yuja added a comment to D5628: diffstat: make --git work properly on renames (issue6025).

@@ -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 line.startswith('rename to'):
+ filename += ' => %s' % line.split()[-1]

Sat, Jan 26, 12:18 AM
yuja added a comment to D5620: grep: don't look up copy info unless --follow is given.
  • if fn in skip: + copy = None + if follow: + try: + copied = flog.renamed(fnode) + except error.WdirUnsupported: + copied = ctx[fn].renamed() + copy = copied and copied[0] if copy:
  • skip[copy] = True
  • continue + copies.setdefault(rev, {})[fn] = copy + if fn in skip: + skip[copy] = True + continue files.append(fn)
Sat, Jan 26, 12:06 AM

Fri, Jan 25

yuja added a comment to D5698: wireprotov2peer: rewrite character traversal to use slices.

+ 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 range(len(raw))]
+ missing whitespace in expression

Fri, Jan 25, 11:22 PM
yuja committed rHG0ae3ddb4fbed: merge with stable.
merge with stable
Fri, Jan 25, 5:43 AM
yuja added a comment to D5690: py3: use regular expression to deal with ENOENT formatting change.
$ hg log -b --cwd=inexistent default
  • abort: $ENOENT$: 'inexistent' + abort: \$ENOENT\$: ('inexistent'|inexistent) (re)
Fri, Jan 25, 5:15 AM

Thu, Jan 24

yuja committed rHG26ee61c33dee: ui: remove unreachable branches and function calls from write() (issue6059).
ui: remove unreachable branches and function calls from write() (issue6059)
Thu, Jan 24, 1:14 PM
yuja committed rHGe8273eaa0726: ui: inline _writenobuf() into write() due to performance issue.
ui: inline _writenobuf() into write() due to performance issue
Thu, Jan 24, 1:14 PM
yuja committed rHGb4a3abdc790d: ui: inline _write() into write() due to performance issue.
ui: inline _write() into write() due to performance issue
Thu, Jan 24, 1:14 PM
yuja committed rHGff927ecb12f9: ui: optimize buffered write with no label.
ui: optimize buffered write with no label
Thu, Jan 24, 1:14 PM

Wed, Jan 23

yuja added a reverting commit for rHGcecf3f8bccd3: revlog: always process opener options: rHGc953c2a94d68: revlog: fix resolution of revlog version 0.
Wed, Jan 23, 1:14 PM
yuja committed rHGc953c2a94d68: revlog: fix resolution of revlog version 0.
revlog: fix resolution of revlog version 0
Wed, Jan 23, 1:14 PM
yuja added a comment to D5496: revset: add "samebranch" keyword argument to the merge revset.
Maybe `anonymous`, defaulting to True?
Wed, Jan 23, 7:51 AM

Jan 20 2019

yuja committed rHG13c23396c7fe: rust: add comment about lack of wdirrev handling.
rust: add comment about lack of wdirrev handling
Jan 20 2019, 12:53 AM
yuja committed rHG66102f6fa10a: templatekw: fix crash on multiple latesttags resolution at wdir (issue6055).
templatekw: fix crash on multiple latesttags resolution at wdir (issue6055)
Jan 20 2019, 12:53 AM
yuja committed rHGff1222a7d714: test-template-keywords: add test for {latesttag} of wdir() revision.
test-template-keywords: add test for {latesttag} of wdir() revision
Jan 20 2019, 12:53 AM

Jan 18 2019

yuja added a comment to D5594: copies: consider nullrev a common ancestor.
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.
Jan 18 2019, 9:01 AM
yuja added a comment to D5626: scmutil: drop unreachable except clause.
socket.error is a subclass of IOError, which we catch higher up. It
Jan 18 2019, 7:29 AM
yuja added a comment to D5594: copies: consider nullrev a common ancestor.
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 graph algorithms.
Jan 18 2019, 7:14 AM
yuja committed rHG00b314c42094: revlog: document that mmap resources are released implicitly by GC.
revlog: document that mmap resources are released implicitly by GC
Jan 18 2019, 4:54 AM
yuja committed rHGcf8677cd7286: ui: proxy protect/restorestdio() calls to update internal flag.
ui: proxy protect/restorestdio() calls to update internal flag
Jan 18 2019, 4:54 AM
yuja committed rHGb0e3f2d7c143: ui: move protectedstdio() context manager from procutil.
ui: move protectedstdio() context manager from procutil
Jan 18 2019, 4:54 AM
yuja committed rHG4948b327d3b9: cext: clang-format new code coming from stable branch.
cext: clang-format new code coming from stable branch
Jan 18 2019, 4:54 AM

Jan 17 2019

yuja added a comment to D5496: revset: add "samebranch" keyword argument to the merge revset.
> 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() - merge(samebranch=True)`.

Do you mean that the flag should only indicate whether you want to hide the same branch merges?
Jan 17 2019, 9:21 AM
yuja added a comment to D5579: rust: factorized testing Graphs.
@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 most of these implementations are public anyway.
Jan 17 2019, 9:21 AM
yuja added a comment to D5493: match: support rooted globs in hgignore.

Queued this, many thanks.

Jan 17 2019, 8:17 AM
yuja added a comment to D5243: resolve: fix mark-check when a file was deleted on one side (issue6020).

Replaced all [[ -f ]] with [ -f ]. `[[]]` requires Bash.

Jan 17 2019, 8:17 AM

Jan 16 2019

yuja added a comment to D5493: match: support rooted globs in hgignore.

I haven't handled your other remark,

Jan 16 2019, 8:24 AM
yuja added a comment to D5496: revset: add "samebranch" keyword argument to the merge revset.
> `[, 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).
Jan 16 2019, 8:10 AM
yuja added a comment to D5579: rust: factorized testing Graphs.

Queued the series, thanks.

Jan 16 2019, 7:42 AM
yuja added a comment to D5510: narrow: reuse narrowspec.updateworkingcopy() when widening.

Fixed pyflakes warnings in flight.

Jan 16 2019, 7:42 AM

Jan 14 2019

yuja added a comment to D5495: revset: add "branch" positional arguments to the merge revset.
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))` ?
Jan 14 2019, 8:30 AM

Jan 13 2019

yuja added a comment to D5490: commit: remove ignore whitespace option on --interactive (issue6042).
> `_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 whitespace changes while interactive commit/revert.
>  So disabling any whitespace options would break someone's workflow.

I'm confused after this comment. How do you want me to move forward?
Jan 13 2019, 10:58 PM
yuja added a comment to D5495: revset: add "branch" positional arguments to the merge revset.

Generally looks good.

Jan 13 2019, 10:11 PM
yuja added a comment to D5496: revset: add "samebranch" keyword argument to the merge revset.
withbranch = ''
if 'withbranch' in args:
    withbranch = getstring(args['withbranch'],
                           _('withbranch argument must be a string'))
    kind, branchname, branchmatcher = stringutil.stringmatcher(withbranch)

+ samebranch = None
+ if 'samebranch' in args:
+ # i18n: "samebranch" is a keyword
+ samebranch = getboolean(args['samebranch'],
+ _('samebranch argument must be a True or False'))

cl = repo.changelog
# create the function that will be used to filter the subset
if withbranch:
    # matchfn is a function that returns true when a revision
    # is a merge and the second parent belongs to a branch that
    # matches the withbranch pattern (which can be a literal or a regex)
    if kind == 'literal':
  • matchfn = lambda r: (cl.parentrevs(r)[1] != -1
  • and repo[r].p2().branch() == withbranch) + basematchfn = lambda r: (cl.parentrevs(r)[1] != -1 + and repo[r].p2().branch() == withbranch) else:
  • matchfn = lambda r: (cl.parentrevs(r)[1] != -1
  • and branchmatcher(repo[r].p2().branch()))
  • else:
  • # matchfn is a function that returns true when a revision is a merge
  • matchfn = lambda r: cl.parentrevs(r)[1] != -1 + basematchfn = lambda r: (cl.parentrevs(r)[1] != -1 + and branchmatcher(repo[r].p2().branch())) + else: + basematchfn = lambda r: cl.parentrevs(r)[1] != -1 + if samebranch is None: + matchfn = basematchfn + else: + # if samebranch was specified, build a new match function + # that on top of basematch checks if the parents belong (or not) + # to the same branch (depending on the value of samebranch) + def matchfn(r): + c = repo[r] + if not basematchfn(r): + return False + issamebranchmerge = c.p1().branch() == c.p2().branch() + return issamebranchmerge if samebranch else not issamebranchmerge
Jan 13 2019, 10:11 PM
yuja added a comment to D5554: histedit: added rewrite.update-timestamp to fold and mess.

Queued with minor modifications, thanks.

Jan 13 2019, 7:14 AM
yuja committed rHG240f8e49a7bd: histedit: remove trailing space from warning message.
histedit: remove trailing space from warning message
Jan 13 2019, 2:53 AM
yuja committed rHG57bece69d7be: histedit: fix weird indent of i18n text.
histedit: fix weird indent of i18n text
Jan 13 2019, 2:53 AM
yuja committed rHGb223fc1c6b4c: progress: change _updatebar() to take parameters as arguments.
progress: change _updatebar() to take parameters as arguments
Jan 13 2019, 2:50 AM
yuja committed rHG929999d963b8: progress: specify updatebar() function by constructor argument.
progress: specify updatebar() function by constructor argument
Jan 13 2019, 2:50 AM
yuja committed rHGd9eda1c6dfca: archival: construct progress helper through ui.makeprogress().
archival: construct progress helper through ui.makeprogress()
Jan 13 2019, 2:50 AM
yuja committed rHG25cec00b333c: help: document rewrite.backup-bundle option.
help: document rewrite.backup-bundle option
Jan 13 2019, 2:42 AM
yuja committed rHG6acbe86c6490: repair: move ui.history-editing-backup to [rewrite] section.
repair: move ui.history-editing-backup to [rewrite] section
Jan 13 2019, 2:42 AM

Jan 12 2019

yuja added a comment to D5559: revlog: always process opener options.
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
sets ``opener.options`` to this value.

Because we always execute this code now, if options are empty
we defaulted to creating version 0 revlogs. So we had to change
the code slightly to fall back to the default revlog version
and flags.

As astute reader will note that it is not possible to create
version 0 revlogs now. However, I don't think it was possible
before, as this required ``opener.options`` being unset, which
I don't think was possible. I suspect this means our test
coverage for version 0 revlog repositories is possibly
non-existent! Since I don't see a config option to disable
revlog v1, I'm not even sure if we had a way to create new
repos with version 0 revlogs! Who knows.
Jan 12 2019, 10:25 PM