[PATCH] fix: fix grammar/typos in hg help -e fix
# HG changeset patch # User timeless # Date 1578597560 18000 # Thu Jan 09 14:19:20 2020 -0500 # Node ID b8915d7827251d9383879b3de1d17d0773645dc6 # Parent cb2e2b095dc930a37e4de824138e8f5133295c96 fix: fix grammar/typos in hg help -e fix diff -r cb2e2b095dc9 -r b8915d782725 hgext/fix.py --- a/hgext/fix.py Wed Dec 25 14:53:45 2019 +0100 +++ b/hgext/fix.py Thu Jan 09 14:19:20 2020 -0500 @@ -103,7 +103,7 @@ to the file content. Provides "$HG_REV" and "$HG_PATH" to identify the file, and "$HG_METADATA" with a map of fixer names to metadata values from fixer tools that affected the file. Fixer tools that didn't affect the file have a -valueof None. Only fixer tools that executed are present in the metadata. +value of None. Only fixer tools that executed are present in the metadata. "postfix" Run once after all files and revisions have been handled. Provides @@ -114,7 +114,7 @@ executions that modified a file. This aggregates the same metadata previously passed to the "postfixfile" hook. -Fixer tools are run the in repository's root directory. This allows them to read +Fixer tools are run in the repository's root directory. This allows them to read configuration files from the working copy, or even write to the working copy. The working copy is not updated to match the revision being fixed. In fact, several revisions may be fixed in parallel. Writes to the working copy are not ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
test-convert-bzr-directories.t fails
Mercurial Distributed SCM (version 4.4+11-7ebf850d3166+20171103) Bazaar 2.5.1 -- a free distributed version-control tool --- /home/timeless/hg/crewplan/tests/test-convert-bzr-directories.t +++ /home/timeless/hg/crewplan/tests/test-convert-bzr-directories.t.err @@ -56,12 +56,56 @@ converting... 1 Added directory 0 Oops, typo + ** unknown exception encountered, please report by visiting + ** https://mercurial-scm.org/wiki/BugTracker + ** Python 2.7.5 (default, Aug 5 2017, 21:54:58) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] + ** Mercurial Distributed SCM (version 4.4+11-7ebf850d3166+20171103) + ** Extensions loaded: convert + Traceback (most recent call last): +File "/tmp/hgtests.wDzHcj/install/bin/hg", line 41, in + dispatch.run() +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 85, in run + status = (dispatch(req) or 0) & 255 +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 173, in dispatch + ret = _runcatch(req) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 313, in _runcatch + return _callcatch(ui, _runcatchfunc) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 321, in _callcatch + return scmutil.callcatch(ui, func) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/scmutil.py", line 154, in callcatch + return func() +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 303, in _runcatchfunc + return _dispatch(req) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 940, in _dispatch + cmdpats, cmdoptions) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 701, in runcommand + ret = _runcommand(ui, options, cmd, d) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 948, in _runcommand + return cmdfunc() +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 937, in + d = lambda: util.checksignature(func)(ui, *args, **strcmdopt) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/util.py", line 1183, in check + return func(*args, **kwargs) +File "/tmp/hgtests.wDzHcj/install/lib/python/hgext/convert/__init__.py", line 539, in convert + return convcmd.convert(ui, src, dest, revmapfile, **opts) +File "/tmp/hgtests.wDzHcj/install/lib/python/hgext/convert/convcmd.py", line 611, in convert + c.convert(sortmode) +File "/tmp/hgtests.wDzHcj/install/lib/python/hgext/convert/convcmd.py", line 522, in convert + self.copy(c) +File "/tmp/hgtests.wDzHcj/install/lib/python/hgext/convert/convcmd.py", line 451, in copy + changes = self.source.getchanges(rev, full) +File "/tmp/hgtests.wDzHcj/install/lib/python/hgext/convert/bzr.py", line 157, in getchanges + files, changes = self._gettreechanges(self._revtree, prevtree) +File "/tmp/hgtests.wDzHcj/install/lib/python/hgext/convert/bzr.py", line 232, in _gettreechanges + subdir = origin.root_inventory.path2id(paths[0]) + AttributeError: 'InventoryRevisionTree' object has no attribute 'root_inventory' + [1] $ manifest source-hg 0 % manifest of 0 644 tpyo/something $ manifest source-hg tip % manifest of tip - 644 typo/something + 644 tpyo/something $ cd .. nested directory renames @@ -86,10 +130,54 @@ converting... 1 Added nested directories 0 Moved secondlevel one level up - $ manifest source-hg tip - % manifest of tip - 644 secondlevel/file - 644 secondlevel/thirdlevel/stuff + ** unknown exception encountered, please report by visiting + ** https://mercurial-scm.org/wiki/BugTracker + ** Python 2.7.5 (default, Aug 5 2017, 21:54:58) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] + ** Mercurial Distributed SCM (version 4.4+11-7ebf850d3166+20171103) + ** Extensions loaded: convert + Traceback (most recent call last): +File "/tmp/hgtests.wDzHcj/install/bin/hg", line 41, in + dispatch.run() +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 85, in run + status = (dispatch(req) or 0) & 255 +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 173, in dispatch + ret = _runcatch(req) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 313, in _runcatch + return _callcatch(ui, _runcatchfunc) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/dispatch.py", line 321, in _callcatch + return scmutil.callcatch(ui, func) +File "/tmp/hgtests.wDzHcj/install/lib/python/mercurial/scmutil.py", line 154, in callcatch + return func() +File "/tmp/hgtests.wDzHcj/install/lib/p
Re: Better release notes
Sean Farley wrote: Some good points there. Though, I didn't think we were talking about the commit message in general but rather with the special note tag: summary: change foo to bar Some technical details. More blah werd. :: notes This would be a highly curated message. Almost as if it were a patch in its own right. Ah. I missed that detail. Well, we'll see. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] histedit: improve documentation and behaviour of dates (issue4820)
Fwiw, recently someone identified that if's are roughly as expensive as method calls. I /think/ that means it'd be better for: +if self.firstdate(): +commitopts['date'] = ctx.date() +else: +commitopts['date'] = max(ctx.date(), oldctx.date()) to be managed as: def date(self, ctx, oldctx): return ctx.date() def date(self, ctx, oldctx): return max(ctx.date(), oldctx.date()) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] bookmarks: fix HG_PENDING handling
fwiw, I really don't have the resources to push either of these forward. I was just trying to call attention to the problem. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] run-tests: improve diff intelligence [RFC]
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1487565093 0 # Mon Feb 20 04:31:33 2017 + # Node ID b04c501c22d75f368e69b3b533f71e16c17ea8b6 # Parent 693a5bb478543a986808264e586073a3ceedc38f # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r b04c501c22d7 run-tests: improve diff intelligence [RFC] This doesn't work w/ py3 (we'd have to talk to the underlying differ). This is based on a problem smf hit recently, which I hit periodically. diff -r 693a5bb47854 -r b04c501c22d7 tests/run-tests.py --- a/tests/run-tests.pyMon Feb 13 17:03:14 2017 -0800 +++ b/tests/run-tests.pyMon Feb 20 04:31:33 2017 + @@ -485,6 +485,34 @@ return servefail, lines +if not PYTHON3: +def getmindiff(expected, output, ref, err): +servefail = False +stats = (len(expected) + len(output), 0, []) +for n in range(4): +lines = [] +change = 0 +neutral = 0 +for line in _unified_diff(expected, output, ref, err, n=n): +if line.startswith(b'+++') or line.startswith(b'---'): +line = line.replace(b'\\', b'/') +if line.endswith(b' \n'): +line = line[:-2] + b'\n' +elif line.startswith(b'+') or line.startswith(b'-'): +change += 1 +else: +neutral += 1 +lines.append(line) +if not servefail and line.startswith( + b'+ abort: child process failed to start'): +servefail = True +if change <= stats[0]: +stats = (change, neutral, lines) +lines = stats[-1] + +return servefail, lines +getdiff = getmindiff + verbose = False def vlog(*msg): """Log only when in verbose mode.""" diff -r 693a5bb47854 -r b04c501c22d7 tests/test-run-tests.t --- a/tests/test-run-tests.tMon Feb 13 17:03:14 2017 -0800 +++ b/tests/test-run-tests.tMon Feb 20 04:31:33 2017 + @@ -483,6 +483,35 @@ (reinstall) $ mv backup test-failure.t +#if no-py3k + $ cat > test-disparate-changes.t << EOF + > $ echo 1 + > * (glob) + > $ echo 1 + > 1 + > $ echo 1 + > 2 + > EOF + $ echo n | rt -i test-disparate-changes.t + + --- $TESTTMP/test-disparate-changes.t + +++ $TESTTMP/test-disparate-changes.t.err + @@ -3,4 +3,4 @@ + $ echo 1 + 1 + $ echo 1 + - 2 + + 1 + Accept this change? [n] + ERROR: test-disparate-changes.t output changed + ! + Failed test-disparate-changes.t: output changed + # Ran 1 tests, 0 skipped, 0 warned, 1 failed. + python hash seed: * (glob) + [1] + $ rm test-disparate-changes.t +#endif + No Diff === ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] transaction: enable hardlink backups for non-windows systems
Augie Fackler wrote: > I'm hesitant to take this because as of 10.12 macOS is pushing people > towards CIFS instead of AFP, Interesting > so this issue feels more likely to come up there. > Also, isn't it possible to mount CIFS volumes in the filesystem space on > Linux? I was going to mention CIFS for Linux. > Do we have any reason for confidence this is only a problem in the Windows > CIFS client, > and not a problem in the server? I can't imagine this being the case. It's incredibly rare for the linux CIFS clients to be significantly better than the Windows implementations. Out of curiosity, does sshfs handle this stuff correctly? :) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: test-merge-changedelete.t fails with my hgmerge
Bryan O'Sullivan wrote: > A long time ago, the default external merge program that we looked for was > called hgmerge, and there's still backwards compatibility code in > filemerge.py to support it. Yeah, I have some vague recollection of this. What's odd is that I'm pretty sure my hgmerge script has been on gcc112 for a while w/o breaking anything... > The tests are as self-contained as they can reasonably be, but the only > viable way to achieve this is to put a special bindir at the front of PATH. > That bindir is prepopulated with special versions of important commands, but > hgmerge isn't in that set. I'm half leaning towards this. Specifically trying to do so in a way where we remove the rest of PATH. > The obviously easiest thing to do is delete your local hgmerge script and > move on, This is what I've done so far. > unless you want to insert a hgmerge command into the special bindir > – but I can almost guarantee that doing so will break other tests. > Any "more general" attempt at a fix probably won't actually help anyone > except you. Probably, although, most likely it'll help me differently on various different computers :-) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: Better release notes
Sean Farley wrote: > I assume that these commit messages were from employees with commit > access? If that's true, then that's a bit different than patch-based > review where we can edit and review the commit message / notes. Well, we had two sources: 1. Mozilla upstream, where in theory messages were curated, but possibly too technical to be useful to our audience 2. In house, where people had commit access, and while we could have tried to review, practically the pace prevented anything useful -- and I was the primary native speaker, my colleagues weren't native speakers. But note: even for Mercurial, getting commit messages to be great is hard. At this point I tune in once every couple of weeks and batch read, typically long after code has landed. For Cordova, where I think >50% of committers were native speakers, and where we had PRs, and comments, the commit logs weren't good enough for Release notes either. So, expecting to rely on commit messages as a final truth isn't a great idea. As a side note: I'm currently running my spelling checker against dozens of open source projects, and one of the portions with the highest spelling error rate is changelogs/commit messages. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 8 v4] mercurial: use best available timer for perf measurements
On Mon, Feb 13, 2017 at 12:29 PM, Simon Farnsworthwrote: > mercurial: use best available timer for perf measurements > > As documented for timer.default_timer, there are better timers available for > performance measures on some platforms. These timers don't have a set epoch, > and thus are only useful for interval measurements, but have higher > resolution, and thus get you a better measurement overall. > > On newer Python (3.3 or later), there's time.perf_counter, which is > --- a/contrib/hgperf > +++ b/contrib/hgperf > -begin = time.time() > +begin = mercurial.util.timer() > --- a/mercurial/util.py > +++ b/mercurial/util.py > @@ -1203,8 +1203,13 @@ > > if pycompat.osname == 'nt': > checkosfilename = checkwinfilename > +timer = time.clock > else: > checkosfilename = platform.checkosfilename > +timer = time.time > + > +if safehasattr(time, "perf_counter"): > +timer = time.perf_counter I think we usually split the introduction of a new feature from switching to using the new thing. It makes it easier to see / semi-document the new api vs. seeing the switch to using it. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] localrepo: change HG_PENDING handling
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1487089673 0 # Tue Feb 14 16:27:53 2017 + # Node ID 8d10b4c0cd6eb85098ec903c802a9602eda3a2f1 # Parent f2ad0d8047009e6e58ab1fa34ae7107714f5dc30 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 8d10b4c0cd6e localrepo: change HG_PENDING handling HG_PENDING is supposed to point to a specific repo when called as part of a hook, without this, any command in a nested repository would read the pending changelog instead of the normal version. diff -r f2ad0d804700 -r 8d10b4c0cd6e mercurial/localrepo.py --- a/mercurial/localrepo.pyTue Feb 14 01:52:16 2017 +0530 +++ b/mercurial/localrepo.pyTue Feb 14 16:27:53 2017 + @@ -509,10 +509,8 @@ @storecache('00changelog.i') def changelog(self): c = changelog.changelog(self.svfs) -if 'HG_PENDING' in encoding.environ: -p = encoding.environ['HG_PENDING'] -if p.startswith(self.root): -c.readpending('00changelog.i.a') +if self.root == encoding.environ.get('HG_PENDING'): +c.readpending('00changelog.i.a') return c def _constructmanifest(self): ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 2 stable] debian: update copyright years
timeless wrote: > We should really write a test for this sort of thing. Yes it's a bit > silly, but it'd be helpful to catch it faster than 13 months late... Augie Fackler wrote: > Sure, but carefully, for the reasons expressed in > https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-February/092837.html. Right, i'm thinking of giving us ~2 weeks tolerance and only applying it to "releasy" files. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Inconsistent HG_PENDING handling
bookmarks.py if 'HG_PENDING' in encoding.environ: try: bkfile = repo.vfs('bookmarks.pending') dirstate.py def _trypending(root, vfs, filename): '''Open file to be read according to HG_PENDING environment variable This opens '.pending' of specified 'filename' only when HG_PENDING is equal to 'root'. This returns '(fp, is_pending_opened)' tuple. ''' if root == encoding.environ.get('HG_PENDING'): localrepo.py if 'HG_PENDING' in encoding.environ: p = encoding.environ['HG_PENDING'] if p.startswith(self.root): c.readpending('00changelog.i.a') it /seems/ like the dirstate code is designed so that it shows the dirstate for a given repository based on pending so, if i have a hg hook that deals w/ HG_PENDING and there are 2 hg things triggering pending and thus two repositories running hooks that deal w/ pending and for some reason one of them runs an hg command in the other repository that second repository will afaict not report the pending dirstate, since it checks carefully but will report the pending bookmark, since afaict it checks carelessly the same incorrect behavior appears to be present for phases too but that should mean a nested repo could see a pending something if i have a repo w/ a registered subrepo, and someone does a "push" to my repo, is the subrepo directory modified as part of the step leading to my push-pretxn hook? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 2 stable] debian: update copyright years
We should really write a test for this sort of thing. Yes it's a bit silly, but it'd be helpful to catch it faster than 13 months late... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: Better release notes
FWIW, @nokia, I looked at our commit message based changelog and decided it wasn't useful, so I maintained a curated list. Yes, it's frustrating that one has to do it, but it's much better than most alternatives. One release fwiw: http://browser.garage.maemo.org/news/4/ ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] help: replace patterns with matching
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1485239979 0 # Tue Jan 24 06:39:39 2017 + # Branch stable # Node ID efe7a979f88411014449f28cc3cc873187d2e0f8 # Parent 7bfe02b57695900ef996989286c1fdc2a13aec82 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r efe7a979f884 help: replace patterns with matching The subject of the section is actually matching. We already have a patterns top level help topic. diff -r 7bfe02b57695 -r efe7a979f884 mercurial/help/revisions.txt --- a/mercurial/help/revisions.txt Fri Jan 20 10:17:34 2017 -0500 +++ b/mercurial/help/revisions.txt Tue Jan 24 06:39:39 2017 + @@ -119,7 +119,7 @@ ``x^`` Equivalent to ``x^1``, the first parent of each changeset in x. -Patterns +Matching Where noted, predicates that perform string matching can accept a pattern ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] util: add length argument to util.buffer()
Yuya Nishihara wrote: > On Sun, 15 Jan 2017 17:04:24 +0530, Pulkit Goyal wrote: >> # HG changeset patch >> # User Pulkit Goyal <7895pul...@gmail.com> >> # Date 1484404515 -19800 >> # Sat Jan 14 20:05:15 2017 +0530 >> # Node ID 087be8a1c7a0452beee36ca23d7978d107b72315 >> # Parent 9dc4d056d85a041b2b28587b3b84608b1f0903a5 >> util: add length argument to util.buffer() > > Queued, thanks. > the ones whe [sic] defined. This patch adds that length argument. I had hoped this could be fixed :/ ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH V3] rebase: fail-fast the pull if working dir is not clean (BC)
Gregory Szorc wrote: > Your reasoning about users wanting extra context to help them debug is sound. > But I'm surprised nobody mentioned that the "error.Abort" exception takes an > optional keyword "hint" argument that prints an extra message to provide that > context. > When we know why an abort occurred and/or what actions can be taken to > prevent it, > the "hint" message should provide that context. +1 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 5 of 5] test-obsolete: stabilize output on platforms without 'serve' support
I like this series (I've been thinking about doing things like it for a while) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] rebase: fail-fast pull if working dir is not clean
Thanks for this. I've been meaning to do it... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 3] chg: start server at a unique address
Jun Wu wrote: > Pid namespace breaks mercurial lock, which is a symlink with the content > "host:pid". Would adjusting the format to: host:pid:starttime:boottime fix this? Sadly, it seems like process start time is actually stored as jiffies since system boot on Linux, and NTP can make canonicalizing that value /somewhat/ flaky [1]. Hopefully, there'd be some way to make this work [1] http://linuxcommando.blogspot.ca/2008/09/how-to-get-process-start-date-and-time.html ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] error: make it clear that ProgrammingError is for mercurial developers
Thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 2] error: add ProgrammingError
Jun Wu wrote: > +class ProgrammingError(RuntimeError): > +"""Raised if a developer has made some mistake""" I object to "developer" you probably mean "mercurial (core or extension) developer", not "generic developer". ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 02 of 10 shelve-ext] shelve: add an ability to write json to a new type of shelve files
We should probably have check-code complain about it and explain why we don't want it. Self-documenting code is our friend. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 5] posix: move checkexec test file to .hg/cache
Gregory Szorc wrote: > The only scenario I can think of is someone who has moved .hg to another > filesystem and symlinked .hg in the working directory to it. I guess that's > plausible. Ugh. I can picture doing this. It's possible I've already done it... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH V2] evolve: improve error message if unstable changes are disallowed
I'm not going to stop this from going in, it's definitely an improvement. >> @@ -3299,7 +3301,8 @@ >> head = repo[heads.first()] >> if _disallowednewunstable(repo, revs): >> raise error.Abort(_("cannot fold chain not ending with a head "\ >> -"or with branching")) >> +"or with branching"), hint = _("new unstable"\ >> +" changesets are not allowed")) 1. From a UX perspective, I think I'd rather this be split. I think. Users shouldn't have to figure out "am I branching" or "am I folding a chain that doesn't end in a head". Alternatively, I'm tempted to say "can only fold chains without branches that end in a head" 2. It'd be helpful if there was a wiki page or something that talked about these cases, preferably such that searching for these error messages led to it. I'm not sure if I want it to be a wiki, or docs included w/ source, but something somewhere... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 2] dispatch: move part of callcatch to scmutil
fwiw, it is possible to keep blame for this if you really wanted to. The approach is: 7ef2ebf5cdf91192a66b461ff56f653a65e65dd7->x x: copy scmutil.py -> scmutil_.py 7ef2ebf5cdf91192a66b461ff56f653a65e65dd7->y y: copy dispatch.py-> scmutil_.py delete lines from scmutil_.py x+y->z z: resolve merge conflicts in scmutil_.py as in this patch delete scmutil.py rename scmutil_.py -> scmutil.py delete lines from dispatch.py adjust dispatch.py as in this patch If you do it this way, commits `x` and `y` still build (they just have temporary files scmutil_.py which isn't used), and you still have blame for scmutil.py for both parts. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 7 of 8] crecord: change help text for the space key dynamically
Jun Wu wrote: > +_('space: unselect') if selected else _('space: select'), I favor deselect (13million) over unselect (2.5million) -- numbers from Google. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 6 of 8] crecord: rewrite status line text (BC)
Jun Wu wrote: > Select hunks to apply. [x]=selected **=collapsed c: confirm q: abort That's pretty good, but could we use a pipe* before ` [x]`? Possibly omitting the `.`, either as: Select hunks to apply | [x]=selected **=collapsed c: confirm q: abort or Select hunks to apply. | [x]=selected **=collapsed c: confirm q: abort * possibly a dash (-)... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH evolve-ext] evolve: improve error message if unstable changes are disallowed
Mateusz Kwapich wrote: > Pulkit wrote: >> +raise error.Abort(_("cannot prune in the middle of a stack\n"\ >> +"new unstable changesets are not allowed")) > This error doesn't have hint - maybe we could use it for that purpose. I should spend some time working on these messages... >> +_('cannot edit commit information in the middle of a >> stack\n'\ >> +'new unstable changesets are not allowed'), >> hint=_('%s will be affected') % >> repo[newunstable.first()]) > I would change the hint to say something along: > '%s would become unstable but new unstable commits are not allowed' I'm tempted to say "and" instead of "but"... >> @@ -3299,7 +3301,8 @@ >> head = repo[heads.first()] >> if _disallowednewunstable(repo, revs): >> raise error.Abort(_("cannot fold chain not ending with a head "\ "chain not ending with a head" needs work :/ >> +"or with branching\nnew unstable changesets >> are"\ >> +" not allowed")) > I would move this to hint param. I agree with Mateusz's suggestions in general. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 01 of 10 layering] dirstateguard: move to new module so I can break some layering violations
Yuya Nishihara wrote: > Is copy-and-remove a preferred way for this kind of refactoring? I have > an unsent patch that splits revset.py, so I want to know which is better. Augie Fackler wrote: > I'd prefer it slightly, because it makes the blame history a little bit more > intact in the long run. Me too. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Can we automatically recognize when we should be fulfilling our deprecation promsie?
Augie Fackler wrote: > We said we'd delete this after 3.8. It's time. > -ui.deprecwarn("missing attribute '%s', use @command decorator " > - "to register '%s'" % (attr, cmd), '3.8') It feels like we should be able to have a test which complains if we have deprecwarns for version X and our version is > X. Offhand, I think it should probably be of the form: $ magic $(hg version) found the following deprecation warnings which are acceptable as of 4.0: ... When $(hg version) changes to 4.1, the output would change to only list items expiring after 4.1, thus changing the output, and any things that are from 4.0 but wouldn't be tolerated by 4.1 wouldn't be printed, and would thus disappear from the output and trigger a test failure. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 3 of 9] chgserve: pre-import extensions
Jun Wu wrote: > (pretend to be timeless) not bad, but... >> pre-importing extensions does not have side effects. > do the parsing for this is (pre-importing [extensions]) does not: pre-importing (extensions do) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: Checking for conflict before merge
Notably hg up -C . will leave .rej / .orig files... Offhand, I'd probably play w/ the `share` extension or something, and basically have a working repository which I could blow away each time to avoid worrying too much about the working directory getting dirty. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 08 of 10] repair: migrate revlogs during upgrade
Gregory Szorc wrote: > +return changelog.changelog(repo.svfs) > +elif path.endswith('00manifest.i'): Does mercurial use `else` after `return` or does it omit them? > + store replacement complete; repository was inconsistent for 0.0s Do we want to allow tests to run a bit slower than instantaneously? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 05 of 10] repair: obtain and validate requirements for upgraded repo
Gregory Szorc wrote: > +'missing: %s') % ', '.join(sorted(missingreqs))) I'd argue ', ' should be _(', '), although we probably don't manage this well or consistently... Also, is it too early to start talking about -T support? -- See `hg debuginstall`... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 04 of 10] repair: identify repository deficiencies
Gregory Szorc wrote: > A command that upgrades repositories but doesn't say what it is doing shouldn't it still mention that it isn't doing the work? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 8] py3: add os.fsdecode() as pycompat.fsdecode()
Pulkit Goyal wrote: > +# In Python 2, fsdecode() have a very chances to recieve bytes. So it's receive ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] help: show help for disabled extensions(issue5228)
Pulkit Goyal wrote: > This patch does not exactly solve issue5228 but it results in a better If it doesn't solve the issue, should the issue be tagged in the commit summary? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 2] commands: introduce `hg display`
Gregory Szorc wrote: > @@ -2019,6 +2026,13 @@ Dish up an empty repo; serve it cold. >diff repository (or selected files) > > > + > + display > + > + > + show various repository information > + > + > >export > Will /help/display list the views it supports? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 5 STABLE] tests: invoke printenv.py via sh -c for test portability
timeless wrote: > I'm sure this is already in, but wouldn't it be better to use a > $PYTHON than `sh -c`? FUJIWARA Katsunori wrote: > I don't have strong opinion for using "sh -c". > > But, if we use $PYTHON instead of `sh -c` (= backing d19787db6fe0 > out), we should change many "sh -c 'printenv.py'" already existing in > other test scenarios for similarity, too. > > Unfortunately, just replacing "sh -c" by $PYTHON can't be applied on > some of them. For example, in test-hook.t: > > $ cat > .hg/hgrc < > [hooks] ... > > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py txnabort" This looks like a candidate for: env $PYTHON ... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 3 of 4] tests: merge 'test-push-validation.t' into 'test-push.t'
Pierre-Yves David wrote: > tests: merge 'test-push-validation.t' into 'test-push.t' > > That test file is very small and is merge with the new 'test-push.t'. No logic > is changed but repository name are update to avoid collision. > > We don't register this as a copy because is actually a "ypoc" merging two file > together without replacing the destination and Mercurial cannot express that. Actually, it can: 0: a b 0->1: rename a->d 0->2: rename b->d 1+2->3: merge d This should give you the history you want in `hg ann`. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: Topics [was: news from the topic experiment]
Sean Farley wrote: > For what it's worth, I've started to work on another repo implementing > what Erik suggested. It removes 'stacks' (since that's obviously out of > scope) and implements a topic-like branch workflow. So far, it's been a > good experiment and requires very little change. I'll post here once I > have more feedback. Gregory Szorc wrote: > I want to agree with Erik and you that overloading the existing branches > metadata is the right thing to do. But I don't think it is practical for > reasons Pierre-Yves outlined. > One of Pierre-Yves's posts touched on this, but I want to explicitly call > out that if topics used existing branches fields, as soon as topics were > created on a highly used repo like mozilla-central, users on legacy clients > would start to see a proliferation of named branches and this could be > confusing. > The only way to stop that while using branches metadata is to > mark the branch as closed (which required metadata in a changeset) and that > would seemingly preclude topics from automatically fading away as their > phase is made public (because you need to modify the SHA-1 to add the > closure metadata). An alternative is to treat branches that are `topic` as `secret` to clients that aren't aware of `topic`. We already have `secret`, and there's already a concept of `hidden`, and `serve` already has pluggable support. I wonder if that's enough to enable a story where mozilla-central (and any other similar project with both modern developers and non-upgrading users) isn't broken > I'm not keen of "yet another branching method" (it is already a fair > criticism of Mercurial today). But I don't see how we can shoehorn topics > metadata into branches metadata without bad side-effects. > > As was mentioned, new metadata for topics means old clients see a bunch of > anonymous heads on changesets that have topics. That is also horrible. If topic-branches are treated as effectively secret, and thus invisible to old clients, does that address your problem? They would not see the anonymous heads, and thus there should be no horror. > The > planned `hg display` will have views of non-public heads to make grokking > this easier. But we're talking about legacy clients, so they won't have `hg > display`. > Perhaps some server-side magic could be leveraged here. For > example, a server could not serve changesets with topics metadata unless > clients are topics aware. Oh, great, you came to the same approach as I did :) > Or, a server could advertise bookmarks corresponding to topic names > when the client isn't topics aware. > There are some obvious problems with those approaches. > But it might be acceptable to some server operators. > I think we should consider what server-side mitigations might look like. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
to abort / to continue (UX)
timeless wrote: > technically this isn't wonderful, if you use bookmarks, `hg up -C .` > isn't equivalent to `hg up -C {currentbookmark}`, and if you're using > hg-git or something that puts significant weight on your active > bookmark, this can lead you into some very unfortunate weeds. Martin von Zweigbergk wrote: > Good point. There's just no correct way of aborting yet, is there? I suppose > we'll have "hg abort" some day. "hg update -C ." always felt a little > git-like to me in the it reuses a command that happens to be closest > implementation-wise. Yeah, `hg abort` is sort of the right pair to `hg continue`. And we're only slowly approaching `hg continue` (actually, we're probably moderately close). I think we could probably at least write a helper to make the "to abort" case work on average. Bookmarks could register to replace `.` with `{current bookmark}`. So, how about half a plan: 1. add code to enable hookable suggestions for `to abort` 2. someone should survey the hg world to figure out what other things might be wanted beyond `hg up -C .` and `hg up -C {currentbookmark}` 3. we review the current `to continue` 4. we look at wiring `hg continue` and `hg abort` ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH v5] copy: distinguish "file exists" cases and add a hint (BC)
Kevin Bullock wrote: > I'm not totally clear on what our approach to translations during a freeze is > either. I'm going by the freeze rules on the wiki, and the fact that > translation always happens on stable anyway, both of which lead me to believe > it should be okay? We should probably clarify this. Note that in other projects the normal approach is that at freeze, conceptually all strings are sent to localizers, who can then take the project-as-is-at-freeze-time and update translations, and then asynchronously transmit their updates. This means that if I change canonical, I've broken the translation system. There are a number of ways to handle this, but it's worth understanding (and documenting) how freezes should work for a project. Pierre-Yves David wrote: > Okay, I don't have a too strong opinion on this and I trust you will take > the right decision. > Worse case will have user or translator (hopefully) complaining and we'll > adjust. Sorry for not getting back to this quickly, fwiw, hoping translators will complain is close to {pick-any-expression-describing-impossible-wishes}. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 5 STABLE] tests: invoke printenv.py via sh -c for test portability
I'm sure this is already in, but wouldn't it be better to use a $PYTHON than `sh -c`? On Fri, Oct 28, 2016 at 2:16 PM, FUJIWARA Katsunoriwrote: > # HG changeset patch > # User FUJIWARA Katsunori > # Date 1477676685 -32400 > # Sat Oct 29 02:44:45 2016 +0900 > # Branch stable > # Node ID 34a5f6c66bc5a13381a68d08f73d858916167836 > # Parent 3afde791dce192f38d8a228ed8e49397e353837e > tests: invoke printenv.py via sh -c for test portability > > On Windows platform, invoking printenv.py directly via hook is > problematic, because: > > - unless binding between *.py suffix and python runtime, application > selector dialog is displayed, and running test is blocked at each > printenv.py invocations > > - it isn't safe to assume binding between *.py suffix and python > runtime, because application binding is easily broken > > For example, installing IDE (VisualStudio with Python Tools, or > so) often requires binding between source files and IDE itself. > > This patch invokes printenv.py via sh -c for test portability. This is > a kind of follow up for d19787db6fe0, which eliminated explicit > "python" for printenv.py. There are already other 'sh -c "printenv.py"' > in *.t files, and this fix should be reasonable. > > This changes were confirmed in cases below: > > - without any application binding for *.py suffix > - with binding between *.py suffix and VisualStudio > > This patch also replaces "echo + redirection" style with "heredoc" > style, because: > > - hook command line is parsed by cmd.exe as shell at first, and > - single quotation can't quote arguments on cmd.exe, therefore, > - "printenv.py foobar" should be quoted by double quotation, but > - nested quoting (or tricky escaping) isn't readable > > diff --git a/tests/test-bundle.t b/tests/test-bundle.t > --- a/tests/test-bundle.t > +++ b/tests/test-bundle.t > @@ -216,8 +216,10 @@ Make sure bundlerepo doesn't leak tempfi > > Pull ../full.hg into empty (with hook) > > - $ echo "[hooks]" >> .hg/hgrc > - $ echo "changegroup = printenv.py changegroup" >> .hg/hgrc > + $ cat >> .hg/hgrc < + > [hooks] > + > changegroup = sh -c "printenv.py changegroup" > + > EOF > > doesn't work (yet ?) > > diff --git a/tests/test-hook.t b/tests/test-hook.t > --- a/tests/test-hook.t > +++ b/tests/test-hook.t > @@ -16,9 +16,9 @@ commit hooks can see env vars >> precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py precommit" >> pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxncommit" >> pretxncommit.tip = hg -q tip > - > pre-identify = printenv.py pre-identify 1 > - > pre-cat = printenv.py pre-cat > - > post-cat = printenv.py post-cat > + > pre-identify = sh -c "printenv.py pre-identify 1" > + > pre-cat = sh -c "printenv.py pre-cat" > + > post-cat = sh -c "printenv.py post-cat" >> pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnopen" >> pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnclose" >> txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py txnclose" > @@ -47,9 +47,9 @@ changegroup hooks can see env vars > >$ cat > .hg/hgrc <> [hooks] > - > prechangegroup = printenv.py prechangegroup > - > changegroup = printenv.py changegroup > - > incoming = printenv.py incoming > + > prechangegroup = sh -c "printenv.py prechangegroup" > + > changegroup = sh -c "printenv.py changegroup" > + > incoming = sh -c "printenv.py incoming" >> EOF > > pretxncommit and commit hooks can see both parents of merge > @@ -122,7 +122,7 @@ tag hooks can see env vars > >$ cd ../a >$ cat >> .hg/hgrc < - > pretag = printenv.py pretag > + > pretag = sh -c "printenv.py pretag" >> tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py tag" >> EOF >$ hg tag -d '3 0' a > @@ -142,7 +142,9 @@ tag hooks can see env vars > > pretag hook can forbid tagging > > - $ echo "pretag.forbid = printenv.py pretag.forbid 1" >> .hg/hgrc > + $ cat >> .hg/hgrc < + > pretag.forbid = sh -c "printenv.py pretag.forbid 1" > + > EOF >$ hg tag -d '4 0' fa >pretag hook: HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 > HG_TAG=fa >pretag.forbid hook: HG_LOCAL=0 > HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa > @@ -157,8 +159,10 @@ pretag hook can forbid tagging > pretxncommit hook can see changeset, can roll back txn, changeset no > more there after > > - $ echo "pretxncommit.forbid0 = hg tip -q" >> .hg/hgrc > - $ echo "pretxncommit.forbid1 = printenv.py pretxncommit.forbid 1" >> > .hg/hgrc > + $ cat >> .hg/hgrc < + > pretxncommit.forbid0 = sh -c "hg tip -q" > + > pretxncommit.forbid1 = sh -c "printenv.py pretxncommit.forbid 1" > + > EOF >$ echo z > z >$ hg add z >$ hg -q tip > @@ -196,7 +200,9 @@ more there after > > precommit hook can prevent commit > > - $ echo "precommit.forbid = printenv.py precommit.forbid 1" >> .hg/hgrc > + $ cat >> .hg/hgrc < + > precommit.forbid = sh -c
[PATCH 1 of 3] rebase: rename merge to mergemod
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1478112967 0 # Wed Nov 02 18:56:07 2016 + # Node ID 78cf30254354eafb993ed7f226eb70d7b7abb6dc # Parent b032a7b676c6637b2ac6f3ef29431013b15a08f9 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 78cf30254354 rebase: rename merge to mergemod diff -r b032a7b676c6 -r 78cf30254354 hgext/rebase.py --- a/hgext/rebase.py Tue Nov 01 18:54:03 2016 -0700 +++ b/hgext/rebase.py Wed Nov 02 18:56:07 2016 + @@ -36,7 +36,7 @@ extensions, hg, lock, -merge, +merge as mergemod, obsolete, patch, phases, @@ -823,7 +823,7 @@ # Update to target and merge it with local if repo['.'].rev() != p1: repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1])) -merge.update(repo, p1, False, True) +mergemod.update(repo, p1, False, True) else: repo.ui.debug(" already in target\n") repo.dirstate.write(repo.currenttransaction()) @@ -832,8 +832,8 @@ repo.ui.debug(" detach base %d:%s\n" % (base, repo[base])) # When collapsing in-place, the parent is the common ancestor, we # have to allow merging with it. -stats = merge.update(repo, rev, True, True, base, collapse, -labels=['dest', 'source']) +stats = mergemod.update(repo, rev, True, True, base, collapse, +labels=['dest', 'source']) if collapse: copies.duplicatecopies(repo, rev, target) else: @@ -1150,7 +1150,7 @@ # Update away from the rebase if necessary if shouldupdate or needupdate(repo, state): -merge.update(repo, originalwd, False, True) +mergemod.update(repo, originalwd, False, True) # Strip from the first rebased revision if rebased: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 3] cmdutil: refactor checkunresolved
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1478112353 0 # Wed Nov 02 18:45:53 2016 + # Node ID 8dae4ad6767cf3456dd2fc4b2a7b478d855091f7 # Parent 78cf30254354eafb993ed7f226eb70d7b7abb6dc # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 8dae4ad6767c cmdutil: refactor checkunresolved localrepo.commit had code to check for unresolved merge conflicts, it would be helpful for at least rebase to be able to use that code without calling commit(). diff -r 78cf30254354 -r 8dae4ad6767c mercurial/cmdutil.py --- a/mercurial/cmdutil.py Wed Nov 02 18:56:07 2016 + +++ b/mercurial/cmdutil.py Wed Nov 02 18:45:53 2016 + @@ -3403,6 +3403,14 @@ return cmd +def checkunresolved(ms): +if list(ms.unresolved()): +raise error.Abort(_("unresolved merge conflicts " +"(see 'hg help resolve')")) +if ms.mdstate() != 's' or list(ms.driverresolved()): +raise error.Abort(_('driver-resolved merge conflicts'), + hint=_('run "hg resolve --all" to resolve')) + # a list of (ui, repo, otherpeer, opts, missing) functions called by # commands.outgoing. "missing" is "missing" of the result of # "findcommonoutgoing()" diff -r 78cf30254354 -r 8dae4ad6767c mercurial/localrepo.py --- a/mercurial/localrepo.pyWed Nov 02 18:56:07 2016 + +++ b/mercurial/localrepo.pyWed Nov 02 18:45:53 2016 + @@ -1633,13 +1633,7 @@ raise error.Abort(_("cannot commit merge with missing files")) ms = mergemod.mergestate.read(self) - -if list(ms.unresolved()): -raise error.Abort(_("unresolved merge conflicts " -"(see 'hg help resolve')")) -if ms.mdstate() != 's' or list(ms.driverresolved()): -raise error.Abort(_('driver-resolved merge conflicts'), - hint=_('run "hg resolve --all" to resolve')) +cmdutil.checkunresolved(ms) if editor: cctx._text = editor(self, cctx, subs) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 3] rebase: check for conflicts before continuing
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1478113169 0 # Wed Nov 02 18:59:29 2016 + # Node ID e9528bc734ce94456dd2389b4ea318278139c206 # Parent 8dae4ad6767cf3456dd2fc4b2a7b478d855091f7 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r e9528bc734ce rebase: check for conflicts before continuing When there are unresolved merge conflicts, there is no reason to make the user wait for rebase to process all of the already rebased commits just to complain that it cannot do anything. Abort early. diff -r 8dae4ad6767c -r e9528bc734ce hgext/rebase.py --- a/hgext/rebase.py Wed Nov 02 18:45:53 2016 + +++ b/hgext/rebase.py Wed Nov 02 18:59:29 2016 + @@ -661,6 +661,9 @@ _('abort and continue do not allow specifying revisions')) if abortf and opts.get('tool', False): ui.warn(_('tool option will be ignored\n')) +if contf: +ms = mergemod.mergestate.read(repo) +cmdutil.checkunresolved(ms) retcode = rbsrt._prepareabortorcontinue(abortf) if retcode is not None: diff -r 8dae4ad6767c -r e9528bc734ce tests/test-rebase-conflicts.t --- a/tests/test-rebase-conflicts.t Wed Nov 02 18:45:53 2016 + +++ b/tests/test-rebase-conflicts.t Wed Nov 02 18:59:29 2016 + @@ -73,8 +73,6 @@ Try to continue without solving the conflict: $ hg rebase --continue - already rebased 3:3163e20567cc "L1" as 3e046f2ecedb - rebasing 4:46f0b057b5c0 "L2" abort: unresolved merge conflicts (see 'hg help resolve') [255] ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] hgweb: fix the MRO in Python 3
> Is there a checkcode test for this? Martijn Pieters wrote: > No, but tests simply fail when you make this mistake. > In this *specific case* that was only visible in the Python 3 tests because > the base classes used in Python 2 were old-style classes, so in *Python 2* > the base class order happened to be legal. I'm asking because I'm pretty sure I played w/ this specific glob of code, and, from memory, the error messages weren't the easiest to decipher. check-code warnings tend to be much easier for me to work from to get to correct code. But it doesn't sound like this is usually something that's easily identified, so I'll drop the question. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 15 of 16] copies: make _checkcopies handle copy sequences spanning the TCA (issue4028)
> + note: possible conflict - f3b was renamed multiple times to: > + f3e > + f3d >merging f4e and f4a to f4e >warning: can't find ancestor for 'f3d' copied from 'f3b'! I know this isn't where the message was introduced, but I'm having a hard time understanding "renamed multiple times". Did you mean: "multiple sequential renames of f3b": 0: f3b 0->1: f3b -> f3e 1->2: f3e -> f3d Or "divergent commits renamed f3b": 0: f3b 0->1: f3b -> f3e 0->2: f3b -> f3d My guess is that you mean the latter. I /think/ that using the concept I've written for it could make the message /slightly/ easier to understand. If you want to avoid "divergent", you can use "competing". ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 07 of 16] copies: detect graft-like merges
Gábor Stefanik wrote: > +# overridden We still need to know a real common ancestor in this case We You're missing periods before `We` twice in this line... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH RFC] perf: add asv benchmarks
On Wed, Oct 12, 2016 at 4:35 AM, Philippe Pepiotwrote: > +"show_commit_url": "https://www.selenic.com/hg/rev/;, Not a review, but I believe this should be: https://www.mercurial-scm.org/repo/hg/ ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH RFC] commands: introduce `hg display`
I'm +1 to this proposal :-) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] store: py26 compat, don't use a dict comprehension
Martijn Pieters wrote: > store: py26 compat, don't use a dict comprehension > -cmap = {x:x for x in asciistr} Can we checkcode this? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH RFC] templater: provide ring operations on integers
Simon Farnsworth wrote: > @@ -33,6 +33,9 @@ > +"+": (10, None, None, ("+", 10), None), > +"-": (10, None, ("negate", 10), ("-", 10), None), > +"*": (12, None, None, ("*", 12), None), Is it reasonable for me to ask for some user facing documentation of this? Possibly just an example. Although, we might want to wait until we're sure that this is the way we want to go before publishing it. I'd definitely like to see what the docs would look like. -- And yes, in theory math is "simple", but as soon as you switch from {Integers} to {Rings} you are going to confuse someone. If I do 20*20 on a 137 character wide screen, what happens? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 8] bisect: rename 'check_code' to match our naming scheme
Pierre-Yves David wrote: > bisect: rename 'check_code' to match our naming scheme I think you mean check_state ;-) > -def check_state(state, interactive=True): > +def checkstate(state, interactive=True): ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 7 of 8] bisect: build a displayer only once
Pierre-Yves David wrote: > There is multiple spot using this, building it early will help to extract more fwiw this should be `there are multiple places` -- [are (plural verb), multiple (plural hint), plural-noun] should all agree; `places` is a better noun than `spots`. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH WIP] help: show help content for disabled extension
Have we considered supporting `hg help churn.churn` where the first churn is a (possibly) disabled extension name, and the second is the name of a command within that extension? I'm not saying we should do this right away, but I can see some advantages to being able to support it later... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] hgweb: fix the MRO in Python 3
Is there a checkcode test for this? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 7] copies: update _checkcopies to work in a rotated DAG
Gábor Stefanik wrote: > copies: update _checkcopies to work in a rotated DAG I'd argue this should be tagged (BC). I absolutely support this change, it should be changed, it is a bug. But the reason I'd argue that it's a change is that a repository constructed along this path will result in a different changeset depending on the version of hg: > @@ -620,7 +620,7 @@ >date:Thu Jan 01 00:00:00 1970 + >summary: 2 > > - changeset: 14:f64defefacee > + changeset: 14:0c921c65ef1e >parent: 1:5d205f8b35b6 >user:foo >date:Thu Jan 01 00:00:00 1970 + ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 3 of 3] revlog: read index data using mmap
http://bugs.python.org/issue16212 Title: mmap() dumps core upon resizing the underlying file Type: crash Stage: needs patch Components: IO Versions: Python 3.4, Python 3.2, Python 3.3 > It's not specific to the zero size truncation, it's enough if the file size > decreases beyond a page border. The issue has been stalled for about 4 years. I don't expect it to go anywhere. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 02 of 11] copies: limit is an optimization, and doesn't provide guarantees (issue4028)
As noted elsewhere, the issue tag should only be applied to the commit that actually fixes the issue, not any commits leading up to that commit. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 01 of 11] copies: style fixes and add comment (issue4028)
> @@ -331,7 +331,8 @@ > m2 = c2.manifest() > ma = ca.manifest() > > -copy1, copy2, = {}, {} > +# see checkcopies documentation below for these dicts > +copy1, copy2 = {}, {} I've been meaning to ask: Do we know why this is a -1+2 instead of a -0+1 diff? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 00 of 11 ] graft: support grafting across move/copy (issue4028)
You shouldn't be sending part 0, that's been deprecated for a while. I wonder why your system encouraged it... ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] copy: distinguish "file exists" cases and add a hint (BC)
Pierre-Yves David wrote: > I'm curious about the timeless reasoning around using "replace" for a pure > book keeping operation that does not replace the file content. (But not > challenging that timeless is most probably right). Timeless can you > elaborate a bit ? It replaces the file history (what hg blame and friends show) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 3 of 3] demandimport: error out early on missing attribute of non package (issue5373)
It works. So, yes. On Tue, Sep 27, 2016 at 11:09 AM, Pierre-Yves David <pierre-yves.da...@ens-lyon.org> wrote: > > > On 09/27/2016 04:12 PM, Yuya Nishihara wrote: >> >> # HG changeset patch >> # User Yuya Nishihara <y...@tcha.org> >> # Date 1474900137 -32400 >> # Mon Sep 26 23:28:57 2016 +0900 >> # Node ID 24aee852593b87f35330b9c482c4f2a4a2595e1d >> # Parent 4a8f4b4339238e71ef27a737bb9af2d8b4adb665 >> demandimport: error out early on missing attribute of non package >> (issue5373) >> >> If the parent module isn't a package, all valid attributes must be >> obtained >> from it. We can raise ImportError early if any attributes not found. > > > This seems fine. I've pushed it. > > I assume this superseed timeless series about reject? > > -- > Pierre-Yves David > > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 3 of 3 v3] demandimport: reject contextlib._GeneratorContextManager on Py < 3.2
Siddharth Agarwal wrote: > As a general thing I don't think we should be spending time trying to fix > this implementation of demandimport on Python 3 at all. This isn't really about python3, it's just about foreign code that expects a certain object to look a certain way, but because of demandimport it gets a demandimport object stub instead of an exception -- in python3 it would have at least gotten a stub for a real object. -- I don't know if the code works in py3 but that's a different adventure, and I'm happy to let a python3 demandimport solution worry about it. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 3 v3] demandimport: replace distutils.msvc9compiler ignore with reject
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474484334 0 # Wed Sep 21 18:58:54 2016 + # Node ID adb54fd7d90f0ca607432ed7ae884da55ec427de # Parent 33884775ee4b22109085387b0317aa17db73c483 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r adb54fd7d90f demandimport: replace distutils.msvc9compiler ignore with reject diff -r 33884775ee4b -r adb54fd7d90f mercurial/demandimport.py --- a/mercurial/demandimport.py Wed Sep 21 18:59:07 2016 + +++ b/mercurial/demandimport.py Wed Sep 21 18:58:54 2016 + @@ -296,8 +296,6 @@ 'rfc822', 'mimetools', 'sqlalchemy.events', # has import-time side effects (issue5085) -# setuptools 8 expects this module to explode early when not on windows -'distutils.msvc9compiler', ] rejects = {} @@ -310,6 +308,11 @@ if not mod in rejects: rejects[mod] = {} rejects[mod][prop] = [cls, msg] + +# setuptools 8 expects this module to explode early when not on windows +if os.name != 'nt': +reject('distutils', 'msvc9compiler', ImportError, 'No module named _winreg') + def isenabled(): return builtins.__import__ == _demandimport ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 3 v3] demandimport: reject contextlib._GeneratorContextManager on Py < 3.2
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474429683 0 # Wed Sep 21 03:48:03 2016 + # Node ID 0070696439eab002f6dd32bcb40eb671daff800a # Parent adb54fd7d90f0ca607432ed7ae884da55ec427de # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 0070696439ea demandimport: reject contextlib._GeneratorContextManager on Py < 3.2 decorator expects: from contextlib import _GeneratorContextManager to throw an exception on python < 3.2 (issue5373). We tell demandimport to throw it. diff -r adb54fd7d90f -r 0070696439ea mercurial/demandimport.py --- a/mercurial/demandimport.py Wed Sep 21 18:58:54 2016 + +++ b/mercurial/demandimport.py Wed Sep 21 03:48:03 2016 + @@ -313,6 +313,12 @@ if os.name != 'nt': reject('distutils', 'msvc9compiler', ImportError, 'No module named _winreg') +# decorator imported by ipython from pygments does an import which isn't +# friendly to demandimport. +if sys.version_info[0] < 3 or sys.version_info[1] < 2: +reject('contextlib', '_GeneratorContextManager', + ImportError, 'cannot import name _GeneratorContextManager') + def isenabled(): return builtins.__import__ == _demandimport diff -r adb54fd7d90f -r 0070696439ea tests/test-demandimport.py --- a/tests/test-demandimport.pyWed Sep 21 18:58:54 2016 + +++ b/tests/test-demandimport.pyWed Sep 21 03:48:03 2016 + @@ -71,6 +71,15 @@ except ImportError: pass +if sys.version_info[0] < 3 or sys.version_info[1] < 2: +try: +from contextlib import _GeneratorContextManager +print('contextlib._GeneratorContextManager needs to be an ' + 'immediate importerror on python <3.2') +_GeneratorContextManager.__doc__ +except ImportError: +pass + demandimport.disable() os.environ['HGDEMANDIMPORT'] = 'disable' # this enable call should not actually enable demandimport! ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 3 v3] demandimport: suppport rejecting modules based on requested properties
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474484347 0 # Wed Sep 21 18:59:07 2016 + # Node ID 33884775ee4b22109085387b0317aa17db73c483 # Parent 982fe7cdb28bb263a96b1bc2c9c3b8aedb025ab6 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 33884775ee4b demandimport: suppport rejecting modules based on requested properties Some code uses: try: from Foo import Bar except ImportError: from Foo import Bar2 demandimport exposes Bar as an unloaded module without checking to see whether or not it really exists this enables it to improve loading speed. Unfortunately, any code that expects to get an ImportError won't get one. This code enables callers to tell demandimport about the shape of some libraries to enable it to replicate the exception that callers expect. without demandimport: >>> from contextlib import _GeneratorContextManager Traceback (most recent call last): File "", line 1, in ImportError: cannot import name _GeneratorContextManager with demandimport without reject: >>> from __future__ import absolute_import >>> from mercurial import demandimport >>> demandimport.enable() >>> from contextlib import _GeneratorContextManager >>> _GeneratorContextManager with demandimport and reject: >>> from __future__ import absolute_import >>> from mercurial import demandimport >>> demandimport.enable() >>> demandimport.reject("contextlib", "_GeneratorContextManager", ImportError, >>> "cannot import name _GeneratorContextManager") >>> from contextlib import _GeneratorContextManager Traceback (most recent call last): File "", line 1, in File "mercurial/demandimport.py", line 260, in _demandimport processfromlist(mod, name, fromlist) File "mercurial/demandimport.py", line 235, in processfromlist raise cls(msg) ImportError: cannot import name _GeneratorContextManager diff -r 982fe7cdb28b -r 33884775ee4b mercurial/demandimport.py --- a/mercurial/demandimport.py Wed Sep 21 03:39:37 2016 + +++ b/mercurial/demandimport.py Wed Sep 21 18:59:07 2016 + @@ -158,6 +158,17 @@ _pypy = '__pypy__' in sys.builtin_module_names def _demandimport(name, globals=None, locals=None, fromlist=None, level=level): +def checksubimports(name, fromlist): +# for each item in fromlist, if a module property +# is registered for rejection, then raise the specified exception +if not name in rejects: +return +reject = rejects[name] +for x in fromlist: +if x in reject: +cls, msg = reject[x] +raise cls(msg) + if not locals or name in ignore or fromlist == ('*',): # these cases we can't really delay return _hgextimport(_import, name, globals, locals, fromlist, level) @@ -165,6 +176,7 @@ # import a [as b] if '.' in name: # a.b base, rest = name.split('.', 1) +checksubimports(base, [rest]) # email.__init__ loading email.mime if globals and globals.get('__name__', None) == base: return _import(name, globals, locals, fromlist, level) @@ -220,6 +232,7 @@ mod = getattr(mod, comp) return mod +checksubimports(name, fromlist) if level >= 0: if name: # "from a import b" or "from .a import b" style @@ -287,6 +300,16 @@ 'distutils.msvc9compiler', ] +rejects = {} + +def reject(mod, prop, cls, msg): +"""inform demandimport that a module does not have a property + +arguments are the class and message to raise when code tries to +import it.""" +if not mod in rejects: +rejects[mod] = {} +rejects[mod][prop] = [cls, msg] def isenabled(): return builtins.__import__ == _demandimport diff -r 982fe7cdb28b -r 33884775ee4b tests/test-demandimport.py --- a/tests/test-demandimport.pyWed Sep 21 03:39:37 2016 + +++ b/tests/test-demandimport.pyWed Sep 21 18:59:07 2016 + @@ -63,6 +63,14 @@ print("re.stderr =", f(re.stderr)) print("re =", f(re)) +demandimport.reject('chunk', 'Chunk', ImportError, 'boo') +try: +from chunk import Chunk +print('reject should prevent chunk from loading for Chunk') +Chunk.getname +except ImportError: +pass + demandimport.disable() os.environ['HGDEMANDIMPORT'] = 'disable' # this enable call should not actually enable demandimport! ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 3 of 3 v2] demandimport: reject contextlib._GeneratorContextManager on Py < 3.2
please hold off on v2. I'd like to try a v3 that handles distutils.msvc9compiler -- it turns out that processfromlist might really be too late and that I may have to really split out the iteration of fromlist into two places. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 5 of 5] demandimport: reject contextlib._GeneratorContextManager on Py < 3.2
Yuya Nishihara wrote: > Can't we simply ignore 'contextlib' ? I had a patch that did that. It felt gross (it clearly wasn't very elegant) > Since contextlib is imported by demandimport.py, there's no benefit to delay > importing contextlib. So, demandimport could just return a given module if it's already loaded w/o wrapping things, but it's possible for a module to be loaded w/o its submodules being loaded. We don't want to automatically load all submodules (that would more or less bypass demandimport, and thus defeat its purpose). I think that other modules have similarly unfriendly code, and that it thus makes sense to offer this feature. After looking through our list of ignores, I think that it should be possible to make distutils.msvc9compiler work with my general approach (although the specific implementation I have in v1 and v2 doesn't work, so I'll need a v3). ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 3 v2] demandimport: refactor processfromlist to ensure consistent handling
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474429251 0 # Wed Sep 21 03:40:51 2016 + # Node ID 32a4cb17f935c570817249721401e0d62033987d # Parent 982fe7cdb28bb263a96b1bc2c9c3b8aedb025ab6 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 32a4cb17f935 demandimport: refactor processfromlist to ensure consistent handling The next changeset will add a slow path for modules where certain properties should be treated as not present. In order to ensure that the codepath is handled the same for absolute_import and relative import, this code should be in a single location. diff -r 982fe7cdb28b -r 32a4cb17f935 mercurial/demandimport.py --- a/mercurial/demandimport.py Wed Sep 21 03:39:37 2016 + +++ b/mercurial/demandimport.py Wed Sep 21 03:40:51 2016 + @@ -220,6 +220,12 @@ mod = getattr(mod, comp) return mod +def processfromlist(mod, name, fromlist): +# call processfromitem for each item in fromlist +if True: +for x in fromlist: +processfromitem(mod, x) + if level >= 0: if name: # "from a import b" or "from .a import b" style @@ -242,8 +248,7 @@ mod = _hgextimport(_origimport, name, globals, locals, level=level) -for x in fromlist: -processfromitem(mod, x) +processfromlist(mod, name, fromlist) return mod @@ -251,9 +256,7 @@ # party modules. So handle level == -1. mod = _hgextimport(_origimport, name, globals, locals) mod = chainmodules(mod, name) - -for x in fromlist: -processfromitem(mod, x) +processfromlist(mod, name, fromlist) return mod ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 3 v2] demandimport: reject contextlib._GeneratorContextManager on Py < 3.2
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474429683 0 # Wed Sep 21 03:48:03 2016 + # Node ID b2d5ad899bbb3c6eace4547b975c84f155066f0b # Parent 20111b4d031e63596b93e162af9b8ca3ff1c98af # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r b2d5ad899bbb demandimport: reject contextlib._GeneratorContextManager on Py < 3.2 decorator expects: from contextlib import _GeneratorContextManager to throw an exception on python < 3.2 (issue5373). We tell demandimport to throw it. diff -r 20111b4d031e -r b2d5ad899bbb mercurial/demandimport.py --- a/mercurial/demandimport.py Wed Sep 21 03:47:35 2016 + +++ b/mercurial/demandimport.py Wed Sep 21 03:48:03 2016 + @@ -309,6 +309,13 @@ if not mod in rejects: rejects[mod] = {} rejects[mod][prop] = [cls, msg] + +# decorator imported by ipython from pygments does an import which isn't +# friendly to demandimport. +if sys.version_info[0] < 3 or sys.version_info[1] < 2: +reject('contextlib', '_GeneratorContextManager', + ImportError, 'cannot import name _GeneratorContextManager') + def isenabled(): return builtins.__import__ == _demandimport diff -r 20111b4d031e -r b2d5ad899bbb tests/test-demandimport.py --- a/tests/test-demandimport.pyWed Sep 21 03:47:35 2016 + +++ b/tests/test-demandimport.pyWed Sep 21 03:48:03 2016 + @@ -71,6 +71,15 @@ except ImportError: pass +if sys.version_info[0] < 3 or sys.version_info[1] < 2: +try: +from contextlib import _GeneratorContextManager +print('contextlib._GeneratorContextManager needs to be an ' + 'immediate importerror on python <3.2') +_GeneratorContextManager.__doc__ +except ImportError: +pass + demandimport.disable() os.environ['HGDEMANDIMPORT'] = 'disable' # this enable call should not actually enable demandimport! ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 3] help: add sections for revsets
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474478613 0 # Wed Sep 21 17:23:33 2016 + # Node ID 692f1e17fb708d83e6022fc1ef1fb69366d7ee45 # Parent 2ed8375eb6ca1fe2f00fac49f1b9c79d705a522a # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 692f1e17fb70 help: add sections for revsets diff -r 2ed8375eb6ca -r 692f1e17fb70 mercurial/help/revsets.txt --- a/mercurial/help/revsets.txtWed Sep 21 17:23:05 2016 + +++ b/mercurial/help/revsets.txtWed Sep 21 17:23:33 2016 + @@ -12,11 +12,17 @@ e.g., ``\n`` is interpreted as a newline. To prevent them from being interpreted, strings can be prefixed with ``r``, e.g. ``r'...'``. +Prefix +== + There is a single prefix operator: ``not x`` Changesets not in x. Short form is ``! x``. +Infix += + These are the supported infix operators: ``x::y`` @@ -71,16 +77,24 @@ in this case. This matches against all of "issue 1234", "issue:1234", "issue1234" and "bug(1234)". +Postfix +=== + There is a single postfix operator: ``x^`` Equivalent to ``x^1``, the first parent of each changeset in x. +Predicates +== The following predicates are supported: .. predicatesmarker +Aliases +=== + New predicates (known as "aliases") can be defined, using any combination of existing predicates or other aliases. An alias definition looks like:: @@ -102,6 +116,8 @@ defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is exactly equivalent to ``reverse(sort(0:tip, author))``. +Equivalents +=== Command line equivalents for :hg:`log`:: @@ -114,6 +130,9 @@ -P x -> !::x -l x -> limit(expr, x) +Examples + + Some sample queries: - Changesets on the default branch:: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 3] help: clarify quotes are needed for filesets.size expressions
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474475617 0 # Wed Sep 21 16:33:37 2016 + # Node ID 40410e96c0a2de344edd5a25a7d996731124ee45 # Parent 285a8c3e53f2183438f0cdbc238e4ab851d0d110 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 40410e96c0a2 help: clarify quotes are needed for filesets.size expressions diff -r 285a8c3e53f2 -r 40410e96c0a2 mercurial/fileset.py --- a/mercurial/fileset.py Tue May 03 13:36:12 2016 +0900 +++ b/mercurial/fileset.py Wed Sep 21 16:33:37 2016 + @@ -345,10 +345,10 @@ def size(mctx, x): """File size matches the given expression. Examples: -- 1k (files from 1024 to 2047 bytes) -- < 20k (files less than 20480 bytes) -- >= .5MB (files at least 524288 bytes) -- 4k - 1MB (files from 4096 bytes to 1048576 bytes) +- size('1k') - files from 1024 to 2047 bytes +- size('< 20k') - files less than 20480 bytes +- size('>= .5MB') - files at least 524288 bytes +- size('4k - 1MB') - files from 4096 bytes to 1048576 bytes """ # i18n: "size" is a keyword ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 3] help: move revsets.## documentation into infix section
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474478585 0 # Wed Sep 21 17:23:05 2016 + # Node ID 2ed8375eb6ca1fe2f00fac49f1b9c79d705a522a # Parent 40410e96c0a2de344edd5a25a7d996731124ee45 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 2ed8375eb6ca help: move revsets.## documentation into infix section diff -r 40410e96c0a2 -r 2ed8375eb6ca mercurial/help/revsets.txt --- a/mercurial/help/revsets.txtWed Sep 21 16:33:37 2016 + +++ b/mercurial/help/revsets.txtWed Sep 21 17:23:05 2016 + @@ -55,6 +55,22 @@ ``x~n`` The nth first ancestor of x; ``x~0`` is x; ``x~3`` is ``x^^^``. +``x ## y`` + Concatenate strings and identifiers into one string. + + All other prefix, infix and postfix operators have lower priority than + ``##``. For example, ``a1 ## a2~2`` is equivalent to ``(a1 ## a2)~2``. + + For example:: + +[revsetalias] +issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)') + +``issue(1234)`` is equivalent to +``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')`` +in this case. This matches against all of "issue 1234", "issue:1234", +"issue1234" and "bug(1234)". + There is a single postfix operator: ``x^`` @@ -86,18 +102,6 @@ defines three aliases, ``h``, ``d``, and ``rs``. ``rs(0:tip, author)`` is exactly equivalent to ``reverse(sort(0:tip, author))``. -An infix operator ``##`` can concatenate strings and identifiers into -one string. For example:: - - [revsetalias] - issue(a1) = grep(r'\bissue[ :]?' ## a1 ## r'\b|\bbug\(' ## a1 ## r'\)') - -``issue(1234)`` is equivalent to ``grep(r'\bissue[ :]?1234\b|\bbug\(1234\)')`` -in this case. This matches against all of "issue 1234", "issue:1234", -"issue1234" and "bug(1234)". - -All other prefix, infix and postfix operators have lower priority than -``##``. For example, ``a1 ## a2~2`` is equivalent to ``(a1 ## a2)~2``. Command line equivalents for :hg:`log`:: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 5] tests: clarify demandimport disabled state
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474429177 0 # Wed Sep 21 03:39:37 2016 + # Node ID 982fe7cdb28bb263a96b1bc2c9c3b8aedb025ab6 # Parent 24d85146985b7d2fef3c27b97d4be983e57ae5c7 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 982fe7cdb28b tests: clarify demandimport disabled state diff -r 24d85146985b -r 982fe7cdb28b tests/test-demandimport.py --- a/tests/test-demandimport.pyWed Sep 21 02:46:59 2016 + +++ b/tests/test-demandimport.pyWed Sep 21 03:39:37 2016 + @@ -65,6 +65,7 @@ demandimport.disable() os.environ['HGDEMANDIMPORT'] = 'disable' +# this enable call should not actually enable demandimport! demandimport.enable() from mercurial import node print("node =", f(node)) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 5 of 5] demandimport: reject contextlib._GeneratorContextManager on Py < 3.2
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474429683 0 # Wed Sep 21 03:48:03 2016 + # Node ID e07c3d398573f74a2e382deb06462bdc15ed437f # Parent 894cc47eb82a85d167f5717c9fe0a31392e5bb97 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r e07c3d398573 demandimport: reject contextlib._GeneratorContextManager on Py < 3.2 issue5373 diff -r 894cc47eb82a -r e07c3d398573 mercurial/demandimport.py --- a/mercurial/demandimport.py Wed Sep 21 03:47:35 2016 + +++ b/mercurial/demandimport.py Wed Sep 21 03:48:03 2016 + @@ -306,6 +306,13 @@ if not mod in rejects: rejects[mod] = {} rejects[mod][prop] = [cls, msg] + +# decorator imported by ipython from pygments does an import which isn't +# friendly to demandimport. +if sys.version_info[0] < 3 or sys.version_info[1] < 2: +reject('contextlib', '_GeneratorContextManager', + ImportError, 'cannot import name _GeneratorContextManager') + def isenabled(): return builtins.__import__ == _demandimport diff -r 894cc47eb82a -r e07c3d398573 tests/test-demandimport.py --- a/tests/test-demandimport.pyWed Sep 21 03:47:35 2016 + +++ b/tests/test-demandimport.pyWed Sep 21 03:48:03 2016 + @@ -71,6 +71,15 @@ except ImportError: pass +if sys.version_info[0] < 3 or sys.version_info[1] < 2: +try: +from contextlib import _GeneratorContextManager +print('contextlib._GeneratorContextManager needs to be an ' + 'immediate importerror on python <3.2') +_GeneratorContextManager.__doc__ +except ImportError: +pass + demandimport.disable() os.environ['HGDEMANDIMPORT'] = 'disable' # this enable call should not actually enable demandimport! ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 17 of 17] tests: favor single quotes for wrapping hg help
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415360 0 # Tue Sep 20 23:49:20 2016 + # Node ID 07306ec6e0c4e0accdaf3efee348361f36910295 # Parent 0f8eca5689fad5be2cef54141c8185b8bd5639f3 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 07306ec6e0c4 tests: favor single quotes for wrapping hg help ... diff -r 0f8eca5689fa -r 07306ec6e0c4 tests/test-help.t --- a/tests/test-help.t Tue Sep 20 23:49:00 2016 + +++ b/tests/test-help.t Tue Sep 20 23:49:20 2016 + @@ -1250,12 +1250,12 @@ $ hg help config.`hg help config|grep '^"'| \ > tail -1|sed 's![ "]*!!g'`| \ - > grep "hg help -c config" > /dev/null + > grep 'hg help -c config' > /dev/null [1] note to use help -c for general hg help config: - $ hg help config |grep "hg help -c config" > /dev/null + $ hg help config |grep 'hg help -c config' > /dev/null Test templating help @@ -1589,7 +1589,7 @@ > subsequent section > -- > - > This should be hidden at "hg help ambiguous" with section name. + > This should be hidden at 'hg help ambiguous' with section name. > ''' > """ % (escape(upper), escape(lower))) > EOF diff -r 0f8eca5689fa -r 07306ec6e0c4 tests/test-obsolete-checkheads.t --- a/tests/test-obsolete-checkheads.t Tue Sep 20 23:49:00 2016 + +++ b/tests/test-obsolete-checkheads.t Tue Sep 20 23:49:20 2016 + @@ -122,7 +122,7 @@ # pushing to $TESTTMP/remote # searching for changes # abort: push creates new remote head 71e3228bffe1! -# (merge or see "hg help push" for details about pushing new heads) +# (merge or see 'hg help push' for details about pushing new heads) # [255] old head is obsolete but replacement is not pushed ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 14 of 17] obsolete: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415299 0 # Tue Sep 20 23:48:19 2016 + # Node ID 7deb4156b10a2dc83fc0278fb5f9fcb42eb17f25 # Parent 745cb8e2928b177706cfee03f298ed0873c9d538 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 7deb4156b10a obsolete: use single quotes in use warning diff -r 745cb8e2928b -r 7deb4156b10a mercurial/obsolete.py --- a/mercurial/obsolete.py Tue Sep 20 23:48:08 2016 + +++ b/mercurial/obsolete.py Tue Sep 20 23:48:19 2016 + @@ -1236,7 +1236,7 @@ if not prec.mutable(): raise error.Abort(_("cannot obsolete public changeset: %s") % prec, - hint='see "hg help phases" for details') + hint="see 'hg help phases' for details") nprec = prec.node() nsucs = tuple(s.node() for s in sucs) npare = None ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 13 of 17] localrepo: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415288 0 # Tue Sep 20 23:48:08 2016 + # Node ID 745cb8e2928b177706cfee03f298ed0873c9d538 # Parent 07753ca55667d0079f2418084dbf4ebab523cb35 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 745cb8e2928b localrepo: use single quotes in use warning diff -r 07753ca55667 -r 745cb8e2928b mercurial/localrepo.py --- a/mercurial/localrepo.pyTue Sep 20 23:47:46 2016 + +++ b/mercurial/localrepo.pyTue Sep 20 23:48:08 2016 + @@ -1626,7 +1626,7 @@ if list(ms.unresolved()): raise error.Abort(_('unresolved merge conflicts ' -'(see "hg help resolve")')) +"(see 'hg help resolve')")) if ms.mdstate() != 's' or list(ms.driverresolved()): raise error.Abort(_('driver-resolved merge conflicts'), hint=_('run "hg resolve --all" to resolve')) diff -r 07753ca55667 -r 745cb8e2928b tests/test-commit-unresolved.t --- a/tests/test-commit-unresolved.tTue Sep 20 23:47:46 2016 + +++ b/tests/test-commit-unresolved.tTue Sep 20 23:48:08 2016 + @@ -34,7 +34,7 @@ $ echo "ABCD" > A $ hg commit -m "Merged" - abort: unresolved merge conflicts (see "hg help resolve") + abort: unresolved merge conflicts (see 'hg help resolve') [255] Mark the conflict as resolved and commit @@ -56,7 +56,7 @@ [1] $ hg rm --force A $ hg commit -m merged - abort: unresolved merge conflicts (see "hg help resolve") + abort: unresolved merge conflicts (see 'hg help resolve') [255] $ hg resolve -ma diff -r 07753ca55667 -r 745cb8e2928b tests/test-graft.t --- a/tests/test-graft.tTue Sep 20 23:47:46 2016 + +++ b/tests/test-graft.tTue Sep 20 23:48:08 2016 + @@ -253,7 +253,7 @@ $ hg graft -c grafting 4:9c233e8e184d "4" - abort: unresolved merge conflicts (see "hg help resolve") + abort: unresolved merge conflicts (see 'hg help resolve') [255] Fix up: diff -r 07753ca55667 -r 745cb8e2928b tests/test-rebase-conflicts.t --- a/tests/test-rebase-conflicts.t Tue Sep 20 23:47:46 2016 + +++ b/tests/test-rebase-conflicts.t Tue Sep 20 23:48:08 2016 + @@ -75,7 +75,7 @@ $ hg rebase --continue already rebased 3:3163e20567cc "L1" as 3e046f2ecedb rebasing 4:46f0b057b5c0 "L2" - abort: unresolved merge conflicts (see "hg help resolve") + abort: unresolved merge conflicts (see 'hg help resolve') [255] Conclude rebase: diff -r 07753ca55667 -r 745cb8e2928b tests/test-rename-merge2.t --- a/tests/test-rename-merge2.tTue Sep 20 23:47:46 2016 + +++ b/tests/test-rename-merge2.tTue Sep 20 23:48:08 2016 + @@ -719,7 +719,7 @@ -- M a M b - abort: unresolved merge conflicts (see "hg help resolve") + abort: unresolved merge conflicts (see 'hg help resolve') -- $ tm "up a b" "nm a b" " " "19 merge b no ancestor, prompt remove a" @@ -764,7 +764,7 @@ -- M b C a - abort: unresolved merge conflicts (see "hg help resolve") + abort: unresolved merge conflicts (see 'hg help resolve') -- $ tm "up a " "um a b" " " "20 merge a and b to b, remove a" ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 15 of 17] util: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415310 0 # Tue Sep 20 23:48:30 2016 + # Node ID 91d602cb454e0f5a7133e8302fa0cf1d86c7bfbe # Parent 7deb4156b10a2dc83fc0278fb5f9fcb42eb17f25 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 91d602cb454e util: use single quotes in use warning diff -r 7deb4156b10a -r 91d602cb454e mercurial/util.py --- a/mercurial/util.py Tue Sep 20 23:48:19 2016 + +++ b/mercurial/util.py Tue Sep 20 23:48:30 2016 + @@ -1953,7 +1953,7 @@ except ValueError: raise Abort(_("invalid day spec: %s") % date[1:]) if days < 0: -raise Abort(_('%s must be nonnegative (see "hg help dates")') +raise Abort(_("%s must be nonnegative (see 'hg help dates')") % date[1:]) when = makedate()[0] - days * 3600 * 24 return lambda x: x >= when diff -r 7deb4156b10a -r 91d602cb454e tests/test-parse-date.t --- a/tests/test-parse-date.t Tue Sep 20 23:48:19 2016 + +++ b/tests/test-parse-date.t Tue Sep 20 23:48:30 2016 + @@ -102,7 +102,7 @@ Negative range $ hg log -d "--2" - abort: -2 must be nonnegative (see "hg help dates") + abort: -2 must be nonnegative (see 'hg help dates') [255] Whitespace only ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 16 of 17] samplehgrcs: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415340 0 # Tue Sep 20 23:49:00 2016 + # Node ID 0f8eca5689fad5be2cef54141c8185b8bd5639f3 # Parent 91d602cb454e0f5a7133e8302fa0cf1d86c7bfbe # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 0f8eca5689fa samplehgrcs: use single quotes in use warning diff -r 91d602cb454e -r 0f8eca5689fa mercurial/ui.py --- a/mercurial/ui.py Tue Sep 20 23:48:30 2016 + +++ b/mercurial/ui.py Tue Sep 20 23:49:00 2016 + @@ -33,7 +33,7 @@ samplehgrcs = { 'user': -"""# example user config (see "hg help config" for more info) +"""# example user config (see 'hg help config' for more info) [ui] # name and email, e.g. # username = Jane Doe <j...@example.com> @@ -41,18 +41,18 @@ [extensions] # uncomment these lines to enable some popular extensions -# (see "hg help extensions" for more info) +# (see 'hg help extensions' for more info) # # pager = # color =""", 'cloned': -"""# example repository config (see "hg help config" for more info) +"""# example repository config (see 'hg help config' for more info) [paths] default = %s # path aliases to other clones of this repo in URLs or filesystem paths -# (see "hg help config.paths" for more info) +# (see 'hg help config.paths' for more info) # # default-push = ssh://j...@example.net/hg/jdoes-fork # my-fork = ssh://j...@example.net/hg/jdoes-fork @@ -64,10 +64,10 @@ """, 'local': -"""# example repository config (see "hg help config" for more info) +"""# example repository config (see 'hg help config' for more info) [paths] # path aliases to other clones of this repo in URLs or filesystem paths -# (see "hg help config.paths" for more info) +# (see 'hg help config.paths' for more info) # # default = http://example.com/hg/example-repo # default-push = ssh://j...@example.net/hg/jdoes-fork @@ -80,11 +80,11 @@ """, 'global': -"""# example system-wide hg config (see "hg help config" for more info) +"""# example system-wide hg config (see 'hg help config' for more info) [extensions] # uncomment these lines to enable some popular extensions -# (see "hg help extensions" for more info) +# (see 'hg help extensions' for more info) # # blackbox = # color = diff -r 91d602cb454e -r 0f8eca5689fa tests/test-hgrc.t --- a/tests/test-hgrc.t Tue Sep 20 23:48:30 2016 + +++ b/tests/test-hgrc.t Tue Sep 20 23:49:00 2016 + @@ -28,12 +28,12 @@ 0 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd foobar $ cat .hg/hgrc - # example repository config (see "hg help config" for more info) + # example repository config (see 'hg help config' for more info) [paths] default = $TESTTMP/foo%bar (glob) # path aliases to other clones of this repo in URLs or filesystem paths - # (see "hg help config.paths" for more info) + # (see 'hg help config.paths' for more info) # # default-push = ssh://j...@example.net/hg/jdoes-fork # my-fork = ssh://j...@example.net/hg/jdoes-fork diff -r 91d602cb454e -r 0f8eca5689fa tests/test-pull-http.t --- a/tests/test-pull-http.tTue Sep 20 23:48:30 2016 + +++ b/tests/test-pull-http.tTue Sep 20 23:49:00 2016 + @@ -26,12 +26,12 @@ updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cat test3/.hg/hgrc - # example repository config (see "hg help config" for more info) + # example repository config (see 'hg help config' for more info) [paths] default = http://foo@localhost:$HGPORT/ # path aliases to other clones of this repo in URLs or filesystem paths - # (see "hg help config.paths" for more info) + # (see 'hg help config.paths' for more info) # # default-push = ssh://j...@example.net/hg/jdoes-fork # my-fork = ssh://j...@example.net/hg/jdoes-fork diff -r 91d602cb454e -r 0f8eca5689fa tests/test-revset-outgoing.t --- a/tests/test-revset-outgoing.t Tue Sep 20 23:48:30 2016 + +++ b/tests/test-revset-outgoing.t Tue Sep 20 23:49:00 2016 + @@ -36,12 +36,12 @@ $ cd b $ cat .hg/hgrc - # example repository config (see "hg help config" for more info) + # example repository config (see 'hg help config' for more info) [paths] default = $TESTTMP/a#stable (glob) # path aliases to other clones of this repo in URLs or filesystem paths - # (see "hg help config.paths" for more info) + # (see 'hg help config.paths' for more info) # # default-push = ssh://j...@example.net/hg/jdoes-fork # my-fork = ssh://j...@example.net/hg/jdoes-fork @@ -88,12 +
[PATCH 12 of 17] help: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415266 0 # Tue Sep 20 23:47:46 2016 + # Node ID 07753ca55667d0079f2418084dbf4ebab523cb35 # Parent b9f5707703a6167686435348dc095a94c22b44b5 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 07753ca55667 help: use single quotes in use warning diff -r b9f5707703a6 -r 07753ca55667 mercurial/help.py --- a/mercurial/help.py Tue Sep 20 23:47:30 2016 + +++ b/mercurial/help.py Tue Sep 20 23:47:46 2016 + @@ -358,7 +358,7 @@ mod = extensions.find(name) doc = gettext(mod.__doc__) or '' if '\n' in doc.strip(): -msg = _('(use "hg help -e %s" to show help for ' +msg = _("(use 'hg help -e %s' to show help for " 'the %s extension)') % (name, name) rst.append('\n%s\n' % msg) except KeyError: @@ -374,7 +374,7 @@ if not ui.verbose: if not full: -rst.append(_('\n(use "hg %s -h" to show more help)\n') +rst.append(_("\n(use 'hg %s -h' to show more help)\n") % name) elif not ui.quiet: rst.append(_('\n(some details hidden, use --verbose ' @@ -450,20 +450,20 @@ rst.append('\n%s\n' % optrst(_("global options"), commands.globalopts, ui.verbose)) if name == 'shortlist': -rst.append(_('\n(use "hg help" for the full list ' +rst.append(_("\n(use 'hg help' for the full list " 'of commands)\n')) else: if name == 'shortlist': -rst.append(_('\n(use "hg help" for the full list of commands ' +rst.append(_("\n(use 'hg help' for the full list of commands " 'or "hg -v" for details)\n')) elif name and not full: -rst.append(_('\n(use "hg help %s" to show the full help ' +rst.append(_("\n(use 'hg help %s' to show the full help " 'text)\n') % name) elif name and cmds and name in cmds.keys(): -rst.append(_('\n(use "hg help -v -e %s" to show built-in ' +rst.append(_("\n(use 'hg help -v -e %s' to show built-in " 'aliases and global options)\n') % name) else: -rst.append(_('\n(use "hg help -v%s" to show built-in aliases ' +rst.append(_("\n(use 'hg help -v%s' to show built-in aliases " 'and global options)\n') % (name and " " + name or "")) return rst @@ -498,7 +498,7 @@ try: cmdutil.findcmd(name, commands.table) -rst.append(_('\nuse "hg help -c %s" to see help for ' +rst.append(_("\nuse 'hg help -c %s' to see help for " 'the %s command\n') % (name, name)) except error.UnknownCommand: pass @@ -536,7 +536,7 @@ modcmds = set([c.partition('|')[0] for c in ct]) rst.extend(helplist(modcmds.__contains__)) else: -rst.append(_('(use "hg help extensions" for information on enabling' +rst.append(_("(use 'hg help extensions' for information on enabling" ' extensions)\n')) return rst @@ -549,7 +549,7 @@ "extension:") % cmd, {ext: doc}, indent=4, showdeprecated=True) rst.append('\n') -rst.append(_('(use "hg help extensions" for information on enabling ' +rst.append(_("(use 'hg help extensions' for information on enabling " 'extensions)\n')) return rst @@ -575,7 +575,7 @@ rst.append('\n') if not rst: msg = _('no matches') -hint = _('try "hg help" for a list of topics') +hint = _("try 'hg help' for a list of topics") raise error.Abort(msg, hint=hint) elif name and name != 'shortlist': queries = [] @@ -598,7 +598,7 @@ raise error.UnknownCommand(name) else: msg = _('no such help topic: %s') % name -hint = _('try "hg help --keyword %s"') % name +hint = _("try 'hg help --keyword %s'") % name raise error.Abort(msg, hint=hint) else: # program name diff -r b9f5707703a6 -r 07753ca55667 tests/test-alias.t --- a/tests/test-al
[PATCH 05 of 17] pager: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415089 0 # Tue Sep 20 23:44:49 2016 + # Node ID 8086d07155c64bd12d28437eb0e403601293be9a # Parent 0ce8fb6cabe0657d1da7f741870bf9050f32fd9c # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 8086d07155c6 pager: use single quotes in use warning diff -r 0ce8fb6cabe0 -r 8086d07155c6 hgext/pager.py --- a/hgext/pager.pyTue Sep 20 23:44:28 2016 + +++ b/hgext/pager.pyTue Sep 20 23:44:49 2016 + @@ -10,7 +10,7 @@ # [extension] # pager = # -# Run "hg help pager" to get info on configuration. +# Run 'hg help pager' to get info on configuration. '''browse command output with an external pager ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 08 of 17] histedit: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415125 0 # Tue Sep 20 23:45:25 2016 + # Node ID 912436c3e806e4715a7a9f7af78895f91a3e6c32 # Parent 45ccea8f0646176c5e9801113f91df201bd9be31 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 912436c3e806 histedit: use single quotes in use warning diff -r 45ccea8f0646 -r 912436c3e806 hgext/histedit.py --- a/hgext/histedit.py Tue Sep 20 23:45:15 2016 + +++ b/hgext/histedit.py Tue Sep 20 23:45:25 2016 + @@ -854,7 +854,7 @@ roots = list(repo.revs("roots(%ln)", outgoing.missing)) if 1 < len(roots): msg = _('there are ambiguous outgoing revisions') -hint = _('see "hg help histedit" for more detail') +hint = _("see 'hg help histedit' for more detail") raise error.Abort(msg, hint=hint) return repo.lookup(roots[0]) @@ -1290,7 +1290,7 @@ root = ctxs[0] # list is already sorted by repo.set if not root.mutable(): raise error.Abort(_('cannot edit public changeset: %s') % root, - hint=_('see "hg help phases" for details')) + hint=_("see 'hg help phases' for details")) return [c.node() for c in ctxs] def ruleeditor(repo, ui, actions, editcomment=""): @@ -1402,7 +1402,7 @@ raise error.ParseError(_('missing rules for changeset %s') % node.short(missing[0]), hint=_('use "drop %s" to discard, see also: ' - '"hg help -e histedit.config"') + "'hg help -e histedit.config'") % node.short(missing[0])) def adjustreplacementsfrommarkers(repo, oldreplacements): diff -r 45ccea8f0646 -r 912436c3e806 tests/test-histedit-arguments.t --- a/tests/test-histedit-arguments.t Tue Sep 20 23:45:15 2016 + +++ b/tests/test-histedit-arguments.t Tue Sep 20 23:45:25 2016 + @@ -169,7 +169,7 @@ > pick 08d98a8350f3 4 five > EOF hg: parse error: missing rules for changeset c8e68270e35a - (use "drop c8e68270e35a" to discard, see also: "hg help -e histedit.config") + (use "drop c8e68270e35a" to discard, see also: 'hg help -e histedit.config') [255] Test that extra revisions are detected diff -r 45ccea8f0646 -r 912436c3e806 tests/test-histedit-drop.t --- a/tests/test-histedit-drop.tTue Sep 20 23:45:15 2016 + +++ b/tests/test-histedit-drop.tTue Sep 20 23:45:25 2016 + @@ -151,7 +151,7 @@ > pick ee283cb5f2d5 e > EOF hg: parse error: missing rules for changeset a4f7421b80f7 - (use "drop a4f7421b80f7" to discard, see also: "hg help -e histedit.config") + (use "drop a4f7421b80f7" to discard, see also: 'hg help -e histedit.config') $ hg --config histedit.dropmissing=True histedit cb9a9f314b8b --commands - 2>&1 << EOF | fixbundle > EOF hg: parse error: no rules provided diff -r 45ccea8f0646 -r 912436c3e806 tests/test-histedit-obsolete.t --- a/tests/test-histedit-obsolete.tTue Sep 20 23:45:15 2016 + +++ b/tests/test-histedit-obsolete.tTue Sep 20 23:45:25 2016 + @@ -299,7 +299,7 @@ $ hg histedit -r '.~2' abort: cannot edit public changeset: cb9a9f314b8b - (see "hg help phases" for details) + (see 'hg help phases' for details) [255] diff -r 45ccea8f0646 -r 912436c3e806 tests/test-histedit-outgoing.t --- a/tests/test-histedit-outgoing.tTue Sep 20 23:45:15 2016 + +++ b/tests/test-histedit-outgoing.tTue Sep 20 23:45:25 2016 + @@ -130,7 +130,7 @@ $ HGEDITOR=cat hg -q histedit --outgoing '../r' abort: there are ambiguous outgoing revisions - (see "hg help histedit" for more detail) + (see 'hg help histedit' for more detail) [255] $ hg -q update -C 2 @@ -147,7 +147,7 @@ $ HGEDITOR=cat hg -q histedit --outgoing '../r#default' abort: there are ambiguous outgoing revisions - (see "hg help histedit" for more detail) + (see 'hg help histedit' for more detail) [255] $ cd .. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 06 of 17] mq: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415099 0 # Tue Sep 20 23:44:59 2016 + # Node ID 2da79d8f58abd0b83dd605e65d26b16c31aab5ff # Parent 8086d07155c64bd12d28437eb0e403601293be9a # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 2da79d8f58ab mq: use single quotes in use warning diff -r 8086d07155c6 -r 2da79d8f58ab hgext/mq.py --- a/hgext/mq.py Tue Sep 20 23:44:49 2016 + +++ b/hgext/mq.py Tue Sep 20 23:44:59 2016 + @@ -1562,7 +1562,7 @@ if not repo[self.applied[-1].node].mutable(): raise error.Abort( _("popping would remove a public revision"), -hint=_('see "hg help phases" for details')) +hint=_("see 'hg help phases' for details")) # we know there are no local changes, so we can make a simplified # form of hg.update. @@ -1631,7 +1631,7 @@ raise error.Abort(_("cannot qrefresh a revision with children")) if not repo[top].mutable(): raise error.Abort(_("cannot qrefresh public revision"), - hint=_('see "hg help phases" for details')) + hint=_("see 'hg help phases' for details")) cparents = repo.changelog.parents(top) patchparent = self.qparents(repo, top) @@ -2117,7 +2117,7 @@ for r in rev: if not repo[r].mutable(): raise error.Abort(_('revision %d is not mutable') % r, - hint=_('see "hg help phases" ' + hint=_("see 'hg help phases' " 'for details')) p1, p2 = repo.changelog.parentrevs(r) n = repo.changelog.node(r) diff -r 8086d07155c6 -r 2da79d8f58ab tests/test-mq-qimport-fail-cleanup.t --- a/tests/test-mq-qimport-fail-cleanup.t Tue Sep 20 23:44:49 2016 + +++ b/tests/test-mq-qimport-fail-cleanup.t Tue Sep 20 23:44:59 2016 + @@ -36,7 +36,7 @@ $ hg pull -q -r 0 . # update phase $ hg qimport -r 0 abort: revision 0 is not mutable - (see "hg help phases" for details) + (see 'hg help phases' for details) [255] $ cd .. diff -r 8086d07155c6 -r 2da79d8f58ab tests/test-mq-qimport.t --- a/tests/test-mq-qimport.t Tue Sep 20 23:44:49 2016 + +++ b/tests/test-mq-qimport.t Tue Sep 20 23:44:59 2016 + @@ -40,7 +40,7 @@ $ hg qimport -r null abort: revision -1 is not mutable - (see "hg help phases" for details) + (see 'hg help phases' for details) [255] $ hg qseries diff -r 8086d07155c6 -r 2da79d8f58ab tests/test-mq-safety.t --- a/tests/test-mq-safety.tTue Sep 20 23:44:49 2016 + +++ b/tests/test-mq-safety.tTue Sep 20 23:44:59 2016 + @@ -26,17 +26,17 @@ $ echo babar >> foo $ hg qref abort: cannot qrefresh public revision - (see "hg help phases" for details) + (see 'hg help phases' for details) [255] $ hg revert -a reverting foo $ hg qpop abort: popping would remove a public revision - (see "hg help phases" for details) + (see 'hg help phases' for details) [255] $ hg qfold bar abort: cannot qrefresh public revision - (see "hg help phases" for details) + (see 'hg help phases' for details) [255] $ hg revert -a reverting foo ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 04 of 17] rebase: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415068 0 # Tue Sep 20 23:44:28 2016 + # Node ID 0ce8fb6cabe0657d1da7f741870bf9050f32fd9c # Parent ca073d2379d406e610450b957a955bf05ebf64f3 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 0ce8fb6cabe0 rebase: use single quotes in use warning diff -r ca073d2379d4 -r 0ce8fb6cabe0 hgext/rebase.py --- a/hgext/rebase.py Tue Sep 20 20:12:38 2016 + +++ b/hgext/rebase.py Tue Sep 20 23:44:28 2016 + @@ -296,7 +296,7 @@ if not self.keepf and not self.repo[root].mutable(): raise error.Abort(_("can't rebase public changeset %s") % self.repo[root], - hint=_('see "hg help phases" for details')) + hint=_("see 'hg help phases' for details")) (self.originalwd, self.target, self.state) = result if self.collapsef: @@ -1128,7 +1128,7 @@ if immutable: repo.ui.warn(_("warning: can't clean up public changesets %s\n") % ', '.join(str(repo[r]) for r in immutable), -hint=_('see "hg help phases" for details')) +hint=_("see 'hg help phases' for details")) cleanup = False descendants = set() diff -r ca073d2379d4 -r 0ce8fb6cabe0 tests/test-rebase-scenario-global.t --- a/tests/test-rebase-scenario-global.t Tue Sep 20 20:12:38 2016 + +++ b/tests/test-rebase-scenario-global.t Tue Sep 20 23:44:28 2016 + @@ -326,7 +326,7 @@ [1] $ hg rebase -d 5 -b 6 abort: can't rebase public changeset e1c4361dd923 - (see "hg help phases" for details) + (see 'hg help phases' for details) [255] $ hg rebase -d 5 -b 6 --keep ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 10 of 17] serve: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474415222 0 # Tue Sep 20 23:47:02 2016 + # Node ID 2134ed21fb04e4f1d0585ca46896b2698bd3cf70 # Parent 3f18ad2b5443cad55dd5e720a16ff03638e1878f # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 2134ed21fb04 serve: use single quotes in use warning diff -r 3f18ad2b5443 -r 2134ed21fb04 mercurial/commands.py --- a/mercurial/commands.py Tue Sep 20 23:46:15 2016 + +++ b/mercurial/commands.py Tue Sep 20 23:47:02 2016 + @@ -6543,7 +6543,7 @@ ('n', 'name', '', _('name to show in web pages (default: working directory)'), _('NAME')), ('', 'web-conf', '', - _('name of the hgweb config file (see "hg help hgweb")'), _('FILE')), + _("name of the hgweb config file (see 'hg help hgweb')"), _('FILE')), ('', 'webdir-conf', '', _('name of the hgweb config file (DEPRECATED)'), _('FILE')), ('', 'pid-file', '', _('name of file to write process ID to'), _('FILE')), ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 01 of 17] remove: specify hg in added warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1472852760 0 # Fri Sep 02 21:46:00 2016 + # Node ID 31e48b2f0db6a01c6c7f64a54d12719c48033eed # Parent 285a8c3e53f2183438f0cdbc238e4ab851d0d110 # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 31e48b2f0db6 remove: specify hg in added warning diff -r 285a8c3e53f2 -r 31e48b2f0db6 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue May 03 13:36:12 2016 +0900 +++ b/mercurial/cmdutil.py Fri Sep 02 21:46:00 2016 + @@ -2519,7 +2519,7 @@ count += 1 ui.progress(_('skipping'), count, total=total, unit=_('files')) warnings.append(_('not removing %s: file has been marked for add' - ' (use forget to undo)\n') % m.rel(f)) + " (use 'hg forget' to undo add)\n") % m.rel(f)) ret = 1 ui.progress(_('skipping'), None) diff -r 285a8c3e53f2 -r 31e48b2f0db6 tests/test-largefiles.t --- a/tests/test-largefiles.t Tue May 03 13:36:12 2016 +0900 +++ b/tests/test-largefiles.t Fri Sep 02 21:46:00 2016 + @@ -112,7 +112,7 @@ normalnew already tracked! $ hg remove normalnew largenew not removing largenew: file is untracked - not removing normalnew: file has been marked for add (use forget to undo) + not removing normalnew: file has been marked for add (use 'hg forget' to undo add) [1] $ rm normalnew largenew $ hg up -Cq diff -r 285a8c3e53f2 -r 31e48b2f0db6 tests/test-remove.t --- a/tests/test-remove.t Tue May 03 13:36:12 2016 +0900 +++ b/tests/test-remove.t Fri Sep 02 21:46:00 2016 + @@ -50,7 +50,7 @@ \r (no-eol) (esc) skipping [===>] 1/1\r (no-eol) (esc) \r (no-eol) (esc) - not removing bar: file has been marked for add (use forget to undo) + not removing bar: file has been marked for add (use 'hg forget' to undo add) exit code: 1 A bar ./bar ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 02 of 17] update: use single quotes in use warning
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1472852973 0 # Fri Sep 02 21:49:33 2016 + # Node ID 00192f6bab14f19bfd58738b732ea1a2d24317ea # Parent 31e48b2f0db6a01c6c7f64a54d12719c48033eed # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 00192f6bab14 update: use single quotes in use warning diff -r 31e48b2f0db6 -r 00192f6bab14 mercurial/destutil.py --- a/mercurial/destutil.py Fri Sep 02 21:46:00 2016 + +++ b/mercurial/destutil.py Fri Sep 02 21:49:33 2016 + @@ -417,7 +417,7 @@ (currentbranch)) if otherheads: ui.warn(_('(committing will reopen the head, ' -'use `hg heads .` to see %i other heads)\n') % +"use 'hg heads .' to see %i other heads)\n") % (len(otherheads))) else: ui.warn(_('(committing will reopen branch "%s")\n') % diff -r 31e48b2f0db6 -r 00192f6bab14 tests/test-update-branches.t --- a/tests/test-update-branches.t Fri Sep 02 21:46:00 2016 + +++ b/tests/test-update-branches.t Fri Sep 02 21:49:33 2016 + @@ -195,7 +195,7 @@ $ norevtest "on closed branch head" clean 6 0 files updated, 0 files merged, 0 files removed, 0 files unresolved no open descendant heads on branch "default", updating to a closed head - (committing will reopen the head, use `hg heads .` to see 1 other heads) + (committing will reopen the head, use 'hg heads .' to see 1 other heads) parent=6 if descendant non-closed branch head exists, and it is only one branch head: @@ -214,7 +214,7 @@ $ norevtest "all descendant branch heads are closed" clean 3 0 files updated, 0 files merged, 0 files removed, 0 files unresolved no open descendant heads on branch "default", updating to a closed head - (committing will reopen the head, use `hg heads .` to see 1 other heads) + (committing will reopen the head, use 'hg heads .' to see 1 other heads) parent=6 Test updating if all branch heads are closed ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 03 of 17] push: update help hint to point to config.paths section
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1474402358 0 # Tue Sep 20 20:12:38 2016 + # Node ID ca073d2379d406e610450b957a955bf05ebf64f3 # Parent 00192f6bab14f19bfd58738b732ea1a2d24317ea # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r ca073d2379d4 push: update help hint to point to config.paths section diff -r 00192f6bab14 -r ca073d2379d4 mercurial/commands.py --- a/mercurial/commands.py Fri Sep 02 21:49:33 2016 + +++ b/mercurial/commands.py Tue Sep 20 20:12:38 2016 + @@ -6020,7 +6020,7 @@ path = ui.paths.getpath(dest, default=('default-push', 'default')) if not path: raise error.Abort(_('default repository not configured!'), - hint=_('see the "path" section in "hg help config"')) + hint=_("see 'hg help config.paths'")) dest = path.pushloc or path.loc branches = (path.branch, opts.get('branch') or []) ui.status(_('pushing to %s\n') % util.hidepassword(dest)) diff -r 00192f6bab14 -r ca073d2379d4 tests/test-default-push.t --- a/tests/test-default-push.t Fri Sep 02 21:49:33 2016 + +++ b/tests/test-default-push.t Tue Sep 20 20:12:38 2016 + @@ -19,7 +19,7 @@ $ cd c $ hg push --config paths.default= abort: default repository not configured! - (see the "path" section in "hg help config") + (see 'hg help config.paths') [255] $ cd .. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH V3] update: warn if cwd was deleted
Yeah, cwd is especially foreign for Windows users. Perhaps: current directory was removed (consider changing to repo root: %s) On Sep 7, 2016 3:43 PM, "Kevin Bullock"wrote: > > On Sep 5, 2016, at 05:32, Stanislau Hlebik wrote: > > > > # HG changeset patch > > # User Stanislau Hlebik > > # Date 1473071480 25200 > > # Mon Sep 05 03:31:20 2016 -0700 > > # Node ID b43aa94306b8f50852a8176afec3839aa3826467 > > # Parent f148bfa40489269be2e48046734f81065129847a > > update: warn if cwd was deleted > > > > During update directories are deleted as soon as they have no entries. > > But if current working directory is deleted then it cause problems > > in complex commands like 'hg split'. This commit adds a warning > > that will help users figure the problem faster. > > > > diff --git a/mercurial/merge.py b/mercurial/merge.py > > --- a/mercurial/merge.py > > +++ b/mercurial/merge.py > > @@ -1043,7 +1043,20 @@ > > repo.ui.note(_("removing %s\n") % f) > > audit(f) > > try: > > -unlink(wjoin(f), ignoremissing=True) > > +try: > > +cwd = os.getcwd() > > +except OSError: > > +cwd = None > > +path = wjoin(f) > > +unlink(path, ignoremissing=True) > > +try: > > +os.getcwd() > > +except OSError: > > +# Print a warning if cwd was deleted > > +if cwd and path.startswith(cwd): > > +repo.ui.warn(_("cwd was deleted - consider " > > + "changing cwd to repo root %s\n") % > > + repo.root) > > Still not a fan of the 'cwd' abbreviation. Also our usual style would put > the hint in parentheses. Perhaps something like: > > current working directory was deleted > (consider changing to directory shown by "hg root") > > pacem in terris / мир / शान्ति / سَلاَم / 平和 > Kevin R. Bullock > > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH V3] update: warn if cwd was deleted
There should probably be a colon after "root" On Sep 5, 2016 6:33 AM, "Stanislau Hlebik"wrote: > # HG changeset patch > # User Stanislau Hlebik > # Date 1473071480 25200 > # Mon Sep 05 03:31:20 2016 -0700 > # Node ID b43aa94306b8f50852a8176afec3839aa3826467 > # Parent f148bfa40489269be2e48046734f81065129847a > update: warn if cwd was deleted > > During update directories are deleted as soon as they have no entries. > But if current working directory is deleted then it cause problems > in complex commands like 'hg split'. This commit adds a warning > that will help users figure the problem faster. > > diff --git a/mercurial/merge.py b/mercurial/merge.py > --- a/mercurial/merge.py > +++ b/mercurial/merge.py > @@ -1043,7 +1043,20 @@ > repo.ui.note(_("removing %s\n") % f) > audit(f) > try: > -unlink(wjoin(f), ignoremissing=True) > +try: > +cwd = os.getcwd() > +except OSError: > +cwd = None > +path = wjoin(f) > +unlink(path, ignoremissing=True) > +try: > +os.getcwd() > +except OSError: > +# Print a warning if cwd was deleted > +if cwd and path.startswith(cwd): > +repo.ui.warn(_("cwd was deleted - consider " > + "changing cwd to repo root %s\n") % > + repo.root) > except OSError as inst: > repo.ui.warn(_("update failed to remove %s: %s!\n") % > (f, inst.strerror)) > diff --git a/tests/test-rebase-scenario-global.t > b/tests/test-rebase-scenario-global.t > --- a/tests/test-rebase-scenario-global.t > +++ b/tests/test-rebase-scenario-global.t > @@ -758,6 +758,7 @@ >$ hg commit -m 'second source with subdir' >$ hg rebase -b . -d 1 --traceback >rebasing 2:779a07b1b7a0 "first source commit" > + cwd was deleted - consider changing cwd to repo root * (glob) >rebasing 3:a7d6f3a00bf3 "second source with subdir" (tip) >saved backup bundle to $TESTTMP/cwd-vanish/.hg/strip- > backup/779a07b1b7a0-853e0073-backup.hg (glob) > > diff --git a/tests/test-update-names.t b/tests/test-update-names.t > --- a/tests/test-update-names.t > +++ b/tests/test-update-names.t > @@ -72,3 +72,14 @@ >$ cd .. > > #endif > + > +Test that warning is printed if cwd is deleted during update > + $ hg init r4 && cd r4 > + $ mkdir dir > + $ cd dir > + $ echo a > a > + $ echo b > b > + $ hg add a b > + $ hg ci -m "file and dir" > + $ hg up -q null > + cwd was deleted - consider changing cwd to repo root * (glob) > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] crecord: properly handle files with No newline at eof (issue5268)
# HG changeset patch # User timeless <timel...@mozdev.org> # Date 1472847337 0 # Fri Sep 02 20:15:37 2016 + # Node ID 68a20f02785b24f08b13e21ffc9e2a05031b07f8 # Parent f148bfa40489269be2e48046734f81065129847a # Available At https://bitbucket.org/timeless/mercurial-crew # hg pull https://bitbucket.org/timeless/mercurial-crew -r 68a20f02785b crecord: properly handle files with No newline at eof (issue5268) Yes, this bug was a single character with the wrong case... diff -r f148bfa40489 -r 68a20f02785b mercurial/crecord.py --- a/mercurial/crecord.py Tue Jul 05 09:37:07 2016 +0200 +++ b/mercurial/crecord.py Fri Sep 02 20:15:37 2016 + @@ -387,7 +387,7 @@ contextlen = (len(self.before) + len(self.after) + removedconvertedtocontext) -if self.after and self.after[-1] == '\\ no newline at end of file\n': +if self.after and self.after[-1] == '\\ No newline at end of file\n': contextlen -= 1 fromlen = contextlen + self.removed tolen = contextlen + self.added diff -r f148bfa40489 -r 68a20f02785b tests/test-commit-interactive-curses.t --- a/tests/test-commit-interactive-curses.tTue Jul 05 09:37:07 2016 +0200 +++ b/tests/test-commit-interactive-curses.tFri Sep 02 20:15:37 2016 + @@ -9,6 +9,21 @@ > crecordtest = testModeCommands > EOF +Record with noeol at eof (issue5268) + $ hg init noeol + $ cd noeol + $ printf '0' > a + $ printf '0\n' > b + $ hg ci -Aqm initial + $ printf '1\n0' > a + $ printf '1\n0\n' > b + $ cat <testModeCommands + > c + > EOF + $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -m "add hunks" -d "0 0" + $ cd .. + +Normal repo $ hg init a $ cd a ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 4 of 8 v2] commands: stop abusing int-ness of Python booleans
Can we change ">1" to ">=2" to make this clearer? On Aug 31, 2016 5:33 PM, "Augie Fackler"wrote: > > > On Aug 31, 2016, at 17:19, Kevin Bullock org> wrote: > > > >> On Aug 30, 2016, at 15:16, Augie Fackler wrote: > >> > >> # HG changeset patch > >> # User Augie Fackler > >> # Date 1472586452 14400 > >> # Tue Aug 30 15:47:32 2016 -0400 > >> # Node ID c65c0181a9885d3c95e808272c2f609c3a9c8749 > >> # Parent 69d84366fa224f5dedfdd18a9f5e2413060a8121 > >> commands: stop abusing int-ness of Python booleans > >> > >> This will break as soon as fancyopts starts returning None for all > >> unspecified boolean flags. > >> > >> diff --git a/mercurial/commands.py b/mercurial/commands.py > >> --- a/mercurial/commands.py > >> +++ b/mercurial/commands.py > >> @@ -896,7 +896,8 @@ def bisect(ui, repo, rev=None, extra=Non > >>bad = True > >>else: > >>reset = True > >> -elif extra or good + bad + skip + reset + extend + bool(command) > > 1: > >> +elif extra or sum(1 for b in (good, bad, skip, > >> + reset, extend, command) if b) > 1: > > > > Couldn't we stop abusing math for this at all using any()? > > > >elif extra or any((good, bad, skip, reset, extend, command)): > > > > Docs say it was added in Python 2.5. > > No, because we care if *more than one* of the bools was true. I originally > had the same idea though. > > > > > pacem in terris / мир / शान्ति / سَلاَم / 平和 > > Kevin R. Bullock > > > > ___ > > Mercurial-devel mailing list > > Mercurial-devel@mercurial-scm.org > > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel > > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 8 of 8 v2] help: mark boolean flags with a ^ and explain that they can be negated (RFC)
> options ([+] can be repeated, [?] are flags): This is closer to how I was envisioning it. > Having --no-noninteractive seems really sad. We could make --noninteractive > hidden and then advertise --no-interactive as the long version. Agreed > Also, I don't think --no-no-backup is a good idea. --backup should be its > negation. Agreed ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 8 of 8 v2] help: mark boolean flags with a ^ and explain that they can be negated (RFC)
In principle you shouldn't use multi occur to guard this. if multioccur: -header += (_(" ([+] can be repeated)")) +m = _( +" ([+] can be repeated, flags marked ^ can be negated with --no-)") +header += (m) It's too hard for me you write the correct logic (you can use a set and dictionary). ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel