D3964: macosx: fixing macOS version generation after db9d1dd01bf0
rdamazio added a comment. In https://phab.mercurial-scm.org/D3964#61696, @glandium wrote: > This is python code, why is it parsing the version file instead of importing it? Great question, no idea :) I took the minimal fix approach to reduce the change of further breaking it. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3964 To: rdamazio, #hg-reviewers Cc: glandium, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3964: macosx: fixing macOS version generation after db9d1dd01bf0
rdamazio added a comment. Hmm and nevermind, the weird package name doesn't reproduce on a vanilla hg build, you can go ahead and review. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3964 To: rdamazio, #hg-reviewers Cc: glandium, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3964: macosx: fixing macOS version generation after db9d1dd01bf0
glandium added a comment. This is python code, why is it parsing the version file instead of importing it? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3964 To: rdamazio, #hg-reviewers Cc: glandium, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3964: macosx: fixing macOS version generation after db9d1dd01bf0
rdamazio added a comment. Er, actually, let me fix this again - this unbreaks the build but generates packages like 'Mercurial-"4.6.2+674-f83600efa1ca-macosx10.13.dmg'. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3964 To: rdamazio, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3964: macosx: fixing macOS version generation after dbbe45ae5ad1
rdamazio created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY With the Python3 change, the string is now something like version = b'4.6.2+848-88be288e8ac1' where it was previously just: version = '4.6.2+848-88be288e8ac1' REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3964 AFFECTED FILES contrib/genosxversion.py CHANGE DETAILS diff --git a/contrib/genosxversion.py b/contrib/genosxversion.py --- a/contrib/genosxversion.py +++ b/contrib/genosxversion.py @@ -117,9 +117,9 @@ return with open(opts.versionfile) as f: for l in f: -if l.startswith('version = '): +if l.startswith('version = b'): # version number is entire line minus the quotes -ver = l[len('version = ') + 1:-2] +ver = l[len('version = b') + 1:-2] break if opts.paranoid: print(paranoidver(ver)) To: rdamazio, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3901: histedit: add history-editing-backup config option
khanchi97 added a comment. >> And, should we drop the --no-backup option? @pulkit what do you think? > > Yep, we should either have this option everywhere or not have it anywhere. I too think that config option is better suited here. Let's drop it and comment on the bug which needed the flag about the config option. How do we drop a feature? Do I need to remove all the code related to --no-backup option? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3901 To: khanchi97, durin42, #hg-reviewers Cc: pulkit, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3901: histedit: add history-editing-backup config option
khanchi97 added a comment. > Because this option has not been part of a release yet. There is no point of releasing a deprecated feature. Got it. Thanks! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3901 To: khanchi97, durin42, #hg-reviewers Cc: pulkit, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3901: histedit: add history-editing-backup config option
pulkit added a comment. In https://phab.mercurial-scm.org/D3901#61681, @khanchi97 wrote: > > And, should we drop the --no-backup option? > > IIUC, > dropped -> user won't be able to use that option > deprecated -> can use, but this is not preferred option to use > Am I right above? Yes, you are right above. > If yes, why not deprecate then? Because this option has not been part of a release yet. There is no point of releasing a deprecated feature. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3901 To: khanchi97, durin42, #hg-reviewers Cc: pulkit, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3901: histedit: add history-editing-backup config option
pulkit added a comment. In https://phab.mercurial-scm.org/D3901#61668, @yuja wrote: > > +coreconfigitem('ui', 'historyediting_backup', > > +default=True, > > +) > > > > coreconfigitem('ui', 'interactive', > > default=None, > > ) > > > > diff --git a/hgext/histedit.py b/hgext/histedit.py > > > > - a/hgext/histedit.py +++ b/hgext/histedit.py @@ -,7 +,8 @@ fm.startitem() goal = _getgoal(opts) revs = opts.get('rev', []) > > - nobackup = opts.get('no_backup') +nobackup = (opts.get('no_backup') or +not ui.configbool('ui', 'historyediting_backup')) > > `history-editing-backup` per new rule. > > https://www.mercurial-scm.org/wiki/UIGuideline#config > > Can you add `# experimental config: ui.history-editing-backup` to silence > check-config? It's probably too late to add full support for this option > and make it documented. > > And, should we drop the --no-backup option? @pulkit what do you think? Yep, we should either have this option everywhere or not have it anywhere. I too think that config option is better suited here. Let's drop it and comment on the bug which needed the flag about the config option. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3901 To: khanchi97, durin42, #hg-reviewers Cc: pulkit, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3960: worker: use one pipe per posix worker and select() in parent process
hooper added a comment. Do you want to move the selector import stuff to pycompat? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3960 To: hooper, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3960: worker: use one pipe per posix worker and select() in parent process
hooper updated this revision to Diff 9626. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3960?vs=9618=9626 REVISION DETAIL https://phab.mercurial-scm.org/D3960 AFFECTED FILES mercurial/worker.py CHANGE DETAILS diff --git a/mercurial/worker.py b/mercurial/worker.py --- a/mercurial/worker.py +++ b/mercurial/worker.py @@ -14,6 +14,12 @@ import threading import time +try: +import selectors +selectors.BaseSelector +except ImportError: +from .thirdparty import selectors2 as selectors + from .i18n import _ from . import ( encoding, @@ -89,7 +95,6 @@ return func(*staticargs + (args,)) def _posixworker(ui, func, staticargs, args): -rfd, wfd = os.pipe() workers = _numworkers(ui) oldhandler = signal.getsignal(signal.SIGINT) signal.signal(signal.SIGINT, signal.SIG_IGN) @@ -138,7 +143,15 @@ oldchldhandler = signal.signal(signal.SIGCHLD, sigchldhandler) ui.flush() parentpid = os.getpid() +pipes = [] for pargs in partition(args, workers): +# Every worker gets its own pipe to send results on, so we don't have to +# implement atomic writes larger than PIPE_BUF. Each forked process has +# its own pipe's descriptors in the local variables, and the parent +# process has the full list of pipe descriptors (and it doesn't really +# care what order they're in). +rfd, wfd = os.pipe() +pipes.append((rfd, wfd)) # make sure we use os._exit in all worker code paths. otherwise the # worker may do some clean-ups which could cause surprises like # deadlock. see sshpeer.cleanup for example. @@ -154,6 +167,9 @@ signal.signal(signal.SIGCHLD, oldchldhandler) def workerfunc(): +for r, w in pipes[:-1]: +os.close(r) +os.close(w) os.close(rfd) for result in func(*(staticargs + (pargs,))): os.write(wfd, util.pickle.dumps(result)) @@ -175,8 +191,10 @@ finally: os._exit(ret & 255) pids.add(pid) -os.close(wfd) -fp = os.fdopen(rfd, r'rb', 0) +selector = selectors.DefaultSelector() +for rfd, wfd in pipes: +os.close(wfd) +selector.register(os.fdopen(rfd, r'rb', 0), selectors.EVENT_READ) def cleanup(): signal.signal(signal.SIGINT, oldhandler) waitforworkers() @@ -187,15 +205,19 @@ os.kill(os.getpid(), -status) sys.exit(status) try: -while True: -try: -yield util.pickle.load(fp) -except EOFError: -break -except IOError as e: -if e.errno == errno.EINTR: -continue -raise +openpipes = len(pipes) +while openpipes > 0: +for key, events in selector.select(): +try: +yield util.pickle.load(key.fileobj) +except EOFError: +selector.unregister(key.fileobj) +key.fileobj.close() +openpipes -= 1 +except IOError as e: +if e.errno == errno.EINTR: +continue +raise except: # re-raises killworkers() cleanup() To: hooper, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3901: histedit: add history-editing-backup config option
khanchi97 added a comment. > And, should we drop the --no-backup option? IIUC, dropped -> user won't be able to use that option deprecated -> can use, but this is not preferred option to use Am I right above? If yes, why not deprecate then? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3901 To: khanchi97, durin42, #hg-reviewers Cc: pulkit, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3901: histedit: add history-editing-backup config option
khanchi97 updated this revision to Diff 9625. khanchi97 edited the summary of this revision. khanchi97 retitled this revision from "histedit: add nobackup config option" to "histedit: add history-editing-backup config option". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3901?vs=9531=9625 REVISION DETAIL https://phab.mercurial-scm.org/D3901 AFFECTED FILES hgext/histedit.py mercurial/configitems.py tests/test-histedit-no-backup.t CHANGE DETAILS diff --git a/tests/test-histedit-no-backup.t b/tests/test-histedit-no-backup.t --- a/tests/test-histedit-no-backup.t +++ b/tests/test-histedit-no-backup.t @@ -93,3 +93,41 @@ o 0 36b4bdd91f5b 1970-01-01 00:00 + test one +== +Test histediting_backup config option| +== +Test when `histediting_backup` config option is not enabled: + $ hg histedit -r '36b4bdd91f5b' --commands - << EOF + > pick 36b4bdd91f5b 0 one + > pick 6153eb23e623 1 two + > roll 80d23dfa866d 2 three + > edit 7d5187087c79 3 four + > EOF + merging file + Editing (7d5187087c79), you may commit or record as needed now. + (hg histedit --continue to resume) + [1] + $ hg histedit --abort + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + saved backup bundle to $TESTTMP/foo/.hg/strip-backup/1d8f701c7b35-cf7be322-backup.hg + saved backup bundle to $TESTTMP/foo/.hg/strip-backup/5c0056670bce-b54b65d0-backup.hg + +Test when `histediting_backup` config option is enabled +Enable config option: + $ cat >>$HGRCPATH < [ui] + > history-editing-backup=False + > EOF + + $ hg histedit -r '36b4bdd91f5b' --commands - << EOF + > pick 36b4bdd91f5b 0 one + > pick 6153eb23e623 1 two + > roll 80d23dfa866d 2 three + > edit 7d5187087c79 3 four + > EOF + merging file + Editing (7d5187087c79), you may commit or record as needed now. + (hg histedit --continue to resume) + [1] + $ hg histedit --abort + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -1084,6 +1084,9 @@ coreconfigitem('ui', 'graphnodetemplate', default=None, ) +coreconfigitem('ui', 'history-editing-backup', +default=True, +) coreconfigitem('ui', 'interactive', default=None, ) diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -,7 +,9 @@ fm.startitem() goal = _getgoal(opts) revs = opts.get('rev', []) -nobackup = opts.get('no_backup') +nobackup = (opts.get('no_backup') or +not ui.configbool('ui', 'history-editing-backup')) +# experimental config: ui.history-editing-backup rules = opts.get('commands', '') state.keep = opts.get('keep', False) To: khanchi97, durin42, #hg-reviewers Cc: pulkit, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@38728: 7 new changesets
7 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/2009d84f245a changeset: 38722:2009d84f245a user:Matt Harbison date:Sun Jul 15 23:46:09 2018 -0400 summary: hook: disable the shell to native command translation by default https://www.mercurial-scm.org/repo/hg/rev/f9b2d996ffa5 changeset: 38723:f9b2d996ffa5 user:Matt Harbison date:Sun Jul 15 23:51:43 2018 -0400 summary: hook: only print the note about native cmd translation if it actually changes https://www.mercurial-scm.org/repo/hg/rev/02b5b5c1bba8 changeset: 38724:02b5b5c1bba8 user:Matt Harbison date:Sun Jul 15 23:58:39 2018 -0400 summary: windows: replace single quote with double quote when translating to cmd.exe https://www.mercurial-scm.org/repo/hg/rev/c382c19ce9bd changeset: 38725:c382c19ce9bd user:Matt Harbison date:Mon Jul 16 00:32:33 2018 -0400 summary: windows: expand '~/' and '~\' to %USERPROFILE% when translating to cmd.exe https://www.mercurial-scm.org/repo/hg/rev/d79f3afb079e changeset: 38726:d79f3afb079e user:Kyle Lippincott date:Mon Jul 16 11:38:56 2018 -0700 summary: curses: use "text" interface if TERM=dumb https://www.mercurial-scm.org/repo/hg/rev/fcb517ff9562 changeset: 38727:fcb517ff9562 user:Boris Feld date:Mon Jul 16 18:02:30 2018 +0200 summary: debug: move extensions debug behind a dedicated flag https://www.mercurial-scm.org/repo/hg/rev/88be288e8ac1 changeset: 38728:88be288e8ac1 bookmark:@ tag: tip user:Joerg Sonnenberger date:Sun Jan 28 13:20:52 2018 +0100 summary: tests: refactor common bundle2 capabilities -- Repository URL: 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
D3963: merge: mark file gets as not thread safe
indygreg updated this revision to Diff 9624. indygreg edited the summary of this revision. indygreg retitled this revision from "merge: mark file gets as CPU heavy" to "merge: mark file gets as not thread safe". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3963?vs=9621=9624 REVISION DETAIL https://phab.mercurial-scm.org/D3963 AFFECTED FILES mercurial/configitems.py mercurial/merge.py CHANGE DETAILS diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1637,9 +1637,12 @@ wctx[f0].remove() progress.increment(item=f) -# get in parallel +# get in parallel. +threadsafe= repo.ui.configbool('experimental', + 'worker.wdir-get-thread-safe') prog = worker.worker(repo.ui, cost, batchget, (repo, mctx, wctx), - actions[ACTION_GET]) + actions[ACTION_GET], + threadsafe=threadsafe) for i, item in prog: progress.increment(step=i, item=item) updated = len(actions[ACTION_GET]) diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -623,6 +623,9 @@ coreconfigitem('experimental', 'web.api.debugreflect', default=False, ) +coreconfigitem('experimental', 'worker.wdir-get-thread-safe', +default=False, +) coreconfigitem('experimental', 'xdiff', default=False, ) To: indygreg, #hg-reviewers Cc: yuja, wlis, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3962: worker: ability to disable thread unsafe tasks
indygreg updated this revision to Diff 9623. indygreg edited the summary of this revision. indygreg retitled this revision from "worker: ability to disable worker for CPU heavy tasks" to "worker: ability to disable thread unsafe tasks". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3962?vs=9620=9623 REVISION DETAIL https://phab.mercurial-scm.org/D3962 AFFECTED FILES mercurial/worker.py tests/test-simple-update.t CHANGE DETAILS diff --git a/tests/test-simple-update.t b/tests/test-simple-update.t --- a/tests/test-simple-update.t +++ b/tests/test-simple-update.t @@ -65,7 +65,7 @@ $ cat < forceworker.py > from mercurial import extensions, worker - > def nocost(orig, ui, costperop, nops): + > def nocost(orig, ui, costperop, nops, threadsafe=True): > return worker._numworkers(ui) > 1 > def uisetup(ui): > extensions.wrapfunction(worker, 'worthwhile', nocost) diff --git a/mercurial/worker.py b/mercurial/worker.py --- a/mercurial/worker.py +++ b/mercurial/worker.py @@ -57,18 +57,27 @@ if pycompat.isposix or pycompat.iswindows: _STARTUP_COST = 0.01 +# The Windows worker is thread based. If tasks are CPU bound, threads +# in the presence of the GIL result in excessive context switching and +# this overhead can slow down execution. +_DISALLOW_THREAD_UNSAFE = True else: _STARTUP_COST = 1e30 +_DISALLOW_THREAD_UNSAFE = False -def worthwhile(ui, costperop, nops): +def worthwhile(ui, costperop, nops, threadsafe=True): '''try to determine whether the benefit of multiple processes can outweigh the cost of starting them''' + +if not threadsafe and _DISALLOW_THREAD_UNSAFE: +return False + linear = costperop * nops workers = _numworkers(ui) benefit = linear - (_STARTUP_COST * workers + linear / workers) return benefit >= 0.15 -def worker(ui, costperarg, func, staticargs, args): +def worker(ui, costperarg, func, staticargs, args, threadsafe=True): '''run a function, possibly in parallel in multiple worker processes. @@ -82,9 +91,13 @@ args - arguments to split into chunks, to pass to individual workers + +threadsafe - whether work items are thread safe and can be executed using +a thread-based worker. Should be disabled for CPU heavy tasks that don't +release the GIL. ''' enabled = ui.configbool('worker', 'enabled') -if enabled and worthwhile(ui, costperarg, len(args)): +if enabled and worthwhile(ui, costperarg, len(args), threadsafe=threadsafe): return _platformworker(ui, func, staticargs, args) return func(*staticargs + (args,)) To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@38721: 9 new changesets
9 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/27391d74aaa2 changeset: 38713:27391d74aaa2 user:Joerg Sonnenberger date:Thu Jul 12 18:46:10 2018 +0200 summary: ssh: avoid reading beyond the end of stream when using compression https://www.mercurial-scm.org/repo/hg/rev/abcf500d527c changeset: 38714:abcf500d527c user:Danny Hooper date:Fri Jul 13 13:48:56 2018 -0700 summary: shelve: improve help text for --patch and --stat https://www.mercurial-scm.org/repo/hg/rev/905b66681004 changeset: 38715:905b66681004 user:Danny Hooper date:Mon Jul 16 14:04:48 2018 -0700 summary: shelve: pick the most recent shelve if none specified for --patch/--stat https://www.mercurial-scm.org/repo/hg/rev/c67093e81a3e changeset: 38716:c67093e81a3e user:Paul Morelle date:Mon Jun 04 12:12:00 2018 +0200 summary: revlog: extract `deltainfo.distance` for future conditional redefinition https://www.mercurial-scm.org/repo/hg/rev/aa21a9ad46ea changeset: 38717:aa21a9ad46ea user:Paul Morelle date:Mon Jun 04 22:23:18 2018 +0200 summary: sparse-revlog: new requirement enabled with format.sparse-revlog https://www.mercurial-scm.org/repo/hg/rev/f8762ea73e0d changeset: 38718:f8762ea73e0d user:Paul Morelle date:Tue Jun 05 08:19:35 2018 +0200 summary: sparse-revlog: implement algorithm to write sparse delta chains (issue5480) https://www.mercurial-scm.org/repo/hg/rev/4ad2a1ff0404 changeset: 38719:4ad2a1ff0404 user:Paul Morelle date:Mon Jul 16 17:10:52 2018 -0700 summary: upgrade: add information about sparse-revlog https://www.mercurial-scm.org/repo/hg/rev/d12415b8f833 changeset: 38720:d12415b8f833 user:Paul Morelle date:Thu Jun 21 18:05:55 2018 +0200 summary: upgrade: enable adding or removing sparse-revlog requirement https://www.mercurial-scm.org/repo/hg/rev/dbbe45ae5ad1 changeset: 38721:dbbe45ae5ad1 bookmark:@ tag: tip user:Mike Hommey date:Mon Jul 16 17:47:58 2018 -0700 summary: setup: allow to run setup.py with python 3 without a mercurial checkout -- Repository URL: 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
mercurial@38712: 8 new changesets
8 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/e4b270a32ba8 changeset: 38705:e4b270a32ba8 user:Yuya Nishihara date:Thu Jul 12 23:07:29 2018 +0900 summary: revset: special case commonancestors(none()) to be empty set https://www.mercurial-scm.org/repo/hg/rev/83d965803325 changeset: 38706:83d965803325 user:Yuya Nishihara date:Sun Jul 15 18:22:40 2018 +0900 summary: obsolete: clarify users in markerusers() never contain None https://www.mercurial-scm.org/repo/hg/rev/6b5ca1d0aa1e changeset: 38707:6b5ca1d0aa1e user:Yuya Nishihara date:Sun Jul 15 18:24:57 2018 +0900 summary: obsolete: store user name and note in UTF-8 (issue5754) (BC) https://www.mercurial-scm.org/repo/hg/rev/ff1182d166a2 changeset: 38708:ff1182d166a2 user:Yuya Nishihara date:Sun Jul 15 18:32:17 2018 +0900 summary: obsolete: explode if metadata contains invalid UTF-8 sequence (API) https://www.mercurial-scm.org/repo/hg/rev/6a032a8f741b changeset: 38709:6a032a8f741b user:Boris Feld date:Mon Jul 16 16:21:12 2018 +0200 summary: context: reintroduce `ctx.descendant` as deprecated https://www.mercurial-scm.org/repo/hg/rev/4ac3c2078567 changeset: 38710:4ac3c2078567 user:Boris Feld date:Mon Jul 16 16:22:43 2018 +0200 summary: revlog: reintroduce `revlog.descendant` as deprecated https://www.mercurial-scm.org/repo/hg/rev/240ebbd328e0 changeset: 38711:240ebbd328e0 user:Boris Feld date:Mon Jul 16 16:43:35 2018 +0200 summary: revset-benchmark: use a generic revset to test `heads(commonancestors())` https://www.mercurial-scm.org/repo/hg/rev/70a4289896b0 changeset: 38712:70a4289896b0 bookmark:@ tag: tip user:Boris Feld date:Mon Jul 16 16:46:32 2018 +0200 summary: revset: add larger test for heads(ancestors(…)) -- Repository URL: 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 4 of 4] windows: expand '~/' and '~\' to %USERPROFILE% when translating to cmd.exe
On Wed, 18 Jul 2018 08:32:32 -0400, Matt Harbison wrote: > > > On Jul 18, 2018, at 8:13 AM, Yuya Nishihara wrote: > > > > On Tue, 17 Jul 2018 10:42:33 -0400, Matt Harbison wrote: > On Jul 17, 2018, at 8:27 AM, Yuya Nishihara wrote: > On Mon, 16 Jul 2018 17:31:35 -0400, Matt Harbison wrote: > # HG changeset patch > # User Matt Harbison > # Date 1531715553 14400 > # Mon Jul 16 00:32:33 2018 -0400 > # Node ID 54611420fcf7868ee195e9fa3070efc0d57e9757 > # Parent e71e478d5e49768357287a2f181e8a2b23213239 > windows: expand '~/' and '~\' to %USERPROFILE% when translating to > cmd.exe > >>> > >>> Queued, thanks. > >>> > +elif (c == b'~' and index + 1 < pathlen > + and path[index + 1] in (b'\\', b'/')): > +res += "%USERPROFILE%" > >>> > >>> Nit: ~/ is substituted only at the beginning. ('"~/"' and 'foo~/' > >>> shouldn't > >>> be expanded.) > >> > >> Good catch. > >> > >> Is there a way to mark this (tilde expansion) experimental? (Or just > >> undocumented it?) I see we use os.path.expanduser() for various things, > >> which uses a slightly more elaborate scheme. The downside is it checks > >> HOME first, which has a different definition under msys. The config files > >> under ~/ in msys gets read before the regular Windows user’s > >> mercurial.ini, which means there’s no way to disable expansion under msys, > >> but leave it enabled when run with cmd.exe. So it seems to boil down to > >> consistency vs portability, and I’d probably lean slightly to portable, > >> based on my usage. > > > > Should I drop this for now? > > > > I think this patch is good enough, and the excessive tilde expansion can > > be fixed later. > > If you think this can be fixed later, it’s probably OK to keep. I was just > toying with expanduser(), and wondering out loud if we would be able to shift > to approximately that after releasing this. Leave it as is then. It should be okay to fix this to do more correct substitution. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D3959: rebase: add --stop option to stop rebase at any point (issue5206)
> +def _stoprebase(self): > +"""stop the interrupted rebase""" > +self.restorestatus() > +if not self.stateobj.exists(): > +raise error.Abort(_("no interrupted rebase found")) > +allowunstable = obsolete.isenabled(self.repo, > obsolete.allowunstableopt) > +if not (self.keepf or allowunstable): > +raise error.Abort(_("can't remove original changesets with" > + " unrebased descendants"), > +hint=_('either enable evolve extension to allow unstable ' > + 'revisions or use --keep to keep original > changesets')) > + > +# update to the last rebased node if any > +ctx = self.repo[None] > +pars = [p.node() for p in ctx.parents()] > +p1 = pars[0] > +hg.updaterepo(self.repo, p1, overwrite=True) Perhaps this differs from what a successful rebase would do. Unlike graft, `hg rebase` goes back to the original working directory. > +# either mark obsolete or keep rebased revisions > +repo, ui, opts = self.repo, self.ui, self.opts > +fm = ui.formatter('rebase', opts) > +fm.startitem() > +clearrebased(ui, repo, self.destmap, self.state, self.skipped, > + collapsedas=None, keepf=self.keepf, fm=fm) > +clearstatus(self.repo) > +fm.end() > +return 0 I doubt if this would work with --collapse. Can you try writing some tests? I'm not pretty sure, but it might be possible to utilize `_finishrebase()` to implement --stop, roughly by: 1. restore status 2. drop revisions that aren't rebased yet 3. finish it > +elif stop: > +#todo: raise error for conflicting options Yes! ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3959: rebase: add --stop option to stop rebase at any point (issue5206)
yuja added a comment. > +def _stoprebase(self): > +"""stop the interrupted rebase""" > +self.restorestatus() > +if not self.stateobj.exists(): > +raise error.Abort(_("no interrupted rebase found")) > +allowunstable = obsolete.isenabled(self.repo, obsolete.allowunstableopt) > +if not (self.keepf or allowunstable): > +raise error.Abort(_("can't remove original changesets with" > + " unrebased descendants"), > +hint=_('either enable evolve extension to allow unstable ' > + 'revisions or use --keep to keep original changesets')) > + > +# update to the last rebased node if any > +ctx = self.repo[None] > +pars = [p.node() for p in ctx.parents()] > +p1 = pars[0] > +hg.updaterepo(self.repo, p1, overwrite=True) Perhaps this differs from what a successful rebase would do. Unlike graft, `hg rebase` goes back to the original working directory. > +# either mark obsolete or keep rebased revisions > +repo, ui, opts = self.repo, self.ui, self.opts > +fm = ui.formatter('rebase', opts) > +fm.startitem() > +clearrebased(ui, repo, self.destmap, self.state, self.skipped, > + collapsedas=None, keepf=self.keepf, fm=fm) > +clearstatus(self.repo) > +fm.end() > +return 0 I doubt if this would work with --collapse. Can you try writing some tests? I'm not pretty sure, but it might be possible to utilize `_finishrebase()` to implement --stop, roughly by: 1. restore status 2. drop revisions that aren't rebased yet 3. finish it > +elif stop: > +#todo: raise error for conflicting options Yes! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3959 To: khanchi97, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3901: histedit: add nobackup config option
yuja added a subscriber: pulkit. yuja added a comment. > +coreconfigitem('ui', 'historyediting_backup', > +default=True, > +) > > coreconfigitem('ui', 'interactive', > default=None, > ) > > diff --git a/hgext/histedit.py b/hgext/histedit.py > > - a/hgext/histedit.py +++ b/hgext/histedit.py @@ -,7 +,8 @@ fm.startitem() goal = _getgoal(opts) revs = opts.get('rev', []) > - nobackup = opts.get('no_backup') +nobackup = (opts.get('no_backup') or +not ui.configbool('ui', 'historyediting_backup')) `history-editing-backup` per new rule. https://www.mercurial-scm.org/wiki/UIGuideline#config Can you add `# experimental config: ui.history-editing-backup` to silence check-config? It's probably too late to add full support for this option and make it documented. And, should we drop the --no-backup option? @pulkit what do you think? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3901 To: khanchi97, durin42, #hg-reviewers Cc: pulkit, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D3901: histedit: add nobackup config option
> +coreconfigitem('ui', 'historyediting_backup', > +default=True, > +) > coreconfigitem('ui', 'interactive', > default=None, > ) > diff --git a/hgext/histedit.py b/hgext/histedit.py > --- a/hgext/histedit.py > +++ b/hgext/histedit.py > @@ -,7 +,8 @@ > fm.startitem() > goal = _getgoal(opts) > revs = opts.get('rev', []) > -nobackup = opts.get('no_backup') > +nobackup = (opts.get('no_backup') or > +not ui.configbool('ui', 'historyediting_backup')) `history-editing-backup` per new rule. https://www.mercurial-scm.org/wiki/UIGuideline#config Can you add `# experimental config: ui.history-editing-backup` to silence check-config? It's probably too late to add full support for this option and make it documented. And, should we drop the --no-backup option? @pulkit what do you think? ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 4 of 4] windows: expand '~/' and '~\' to %USERPROFILE% when translating to cmd.exe
> On Jul 18, 2018, at 8:13 AM, Yuya Nishihara wrote: > > On Tue, 17 Jul 2018 10:42:33 -0400, Matt Harbison wrote: On Jul 17, 2018, at 8:27 AM, Yuya Nishihara wrote: On Mon, 16 Jul 2018 17:31:35 -0400, Matt Harbison wrote: # HG changeset patch # User Matt Harbison # Date 1531715553 14400 # Mon Jul 16 00:32:33 2018 -0400 # Node ID 54611420fcf7868ee195e9fa3070efc0d57e9757 # Parent e71e478d5e49768357287a2f181e8a2b23213239 windows: expand '~/' and '~\' to %USERPROFILE% when translating to cmd.exe >>> >>> Queued, thanks. >>> +elif (c == b'~' and index + 1 < pathlen + and path[index + 1] in (b'\\', b'/')): +res += "%USERPROFILE%" >>> >>> Nit: ~/ is substituted only at the beginning. ('"~/"' and 'foo~/' shouldn't >>> be expanded.) >> >> Good catch. >> >> Is there a way to mark this (tilde expansion) experimental? (Or just >> undocumented it?) I see we use os.path.expanduser() for various things, >> which uses a slightly more elaborate scheme. The downside is it checks HOME >> first, which has a different definition under msys. The config files under >> ~/ in msys gets read before the regular Windows user’s mercurial.ini, which >> means there’s no way to disable expansion under msys, but leave it enabled >> when run with cmd.exe. So it seems to boil down to consistency vs >> portability, and I’d probably lean slightly to portable, based on my usage. > > Should I drop this for now? > > I think this patch is good enough, and the excessive tilde expansion can > be fixed later. If you think this can be fixed later, it’s probably OK to keep. I was just toying with expanduser(), and wondering out loud if we would be able to shift to approximately that after releasing this. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1945: tests: refactor common bundle2 capabilities
This revision was automatically updated to reflect the committed changes. Closed by commit rHG88be288e8ac1: tests: refactor common bundle2 capabilities (authored by joerg.sonnenberger, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1945?vs=9606=9622 REVISION DETAIL https://phab.mercurial-scm.org/D1945 AFFECTED FILES tests/common-pattern.py tests/test-http-bad-server.t CHANGE DETAILS diff --git a/tests/test-http-bad-server.t b/tests/test-http-bad-server.t --- a/tests/test-http-bad-server.t +++ b/tests/test-http-bad-server.t @@ -120,7 +120,7 @@ write(41) -> Content-Type: application/mercurial-0.1\r\n write(21) -> Content-Length: 436\r\n write(2) -> \r\n - write(436) -> batch branchmap bundle2=HG20%0Abookmarks%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps%0Arev-branch-cache changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(436) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(4? from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob) readline(1? from -1) -> (1?) Accept-Encoding* (glob) read limit reached; closing socket @@ -161,7 +161,7 @@ write(41) -> Content-Type: application/mercurial-0.1\r\n write(21) -> Content-Length: 436\r\n write(2) -> \r\n - write(436) -> batch branchmap bundle2=HG20%0Abookmarks%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps%0Arev-branch-cache changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(436) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(13? from 65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob) readline(1?? from -1) -> (27) Accept-Encoding: identity\r\n (glob) readline(8? from -1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob) @@ -218,7 +218,7 @@ write(41) -> Content-Type: application/mercurial-0.1\r\n write(21) -> Content-Length: 449\r\n write(2) -> \r\n - write(449) -> batch branchmap bundle2=HG20%0Abookmarks%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps%0Arev-branch-cache changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(449) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(1?? from 65537) -> (27) POST /?cmd=batch HTTP/1.1\r\n (glob) readline(1?? from -1) -> (27) Accept-Encoding: identity\r\n (glob) readline(1?? from -1) -> (41) content-type: application/mercurial-0.1\r\n (glob) @@ -329,7 +329,7 @@ write(41 from 41) -> (577) Content-Type: application/mercurial-0.1\r\n write(21 from 21) -> (556) Content-Length: 436\r\n write(2 from 2) -> (554) \r\n - write(436 from 436) -> (118) batch branchmap bundle2=HG20%0Abookmarks%0Achangegroup%3D01%2C02%0Adigests%3Dmd5%2Csha1%2Csha512%0Aerror%3Dabort%2Cunsupportedcontent%2Cpushraced%2Cpushkey%0Ahgtagsfnodes%0Alistkeys%0Apushkey%0Aremote-changegroup%3Dhttp%2Chttps%0Arev-branch-cache changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash + write(436 from 436) -> (118) batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=generaldelta,revlogv1 unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash readline(65537) -> (26) GET /?cmd=batch HTTP/1.1\r\n readline(-1) -> (27) Accept-Encoding: identity\r\n readline(-1) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n @@ -377,7 +377,7 @@ write(41 from 41) -> (642) Content-Type: application/mercurial-0.1\r\n write(21 from
Re: [PATCH 4 of 4] windows: expand '~/' and '~\' to %USERPROFILE% when translating to cmd.exe
On Tue, 17 Jul 2018 10:42:33 -0400, Matt Harbison wrote: > > On Jul 17, 2018, at 8:27 AM, Yuya Nishihara wrote: > >> On Mon, 16 Jul 2018 17:31:35 -0400, Matt Harbison wrote: > >> # HG changeset patch > >> # User Matt Harbison > >> # Date 1531715553 14400 > >> # Mon Jul 16 00:32:33 2018 -0400 > >> # Node ID 54611420fcf7868ee195e9fa3070efc0d57e9757 > >> # Parent e71e478d5e49768357287a2f181e8a2b23213239 > >> windows: expand '~/' and '~\' to %USERPROFILE% when translating to cmd.exe > > > > Queued, thanks. > > > >> +elif (c == b'~' and index + 1 < pathlen > >> + and path[index + 1] in (b'\\', b'/')): > >> +res += "%USERPROFILE%" > > > > Nit: ~/ is substituted only at the beginning. ('"~/"' and 'foo~/' shouldn't > > be expanded.) > > Good catch. > > Is there a way to mark this (tilde expansion) experimental? (Or just > undocumented it?) I see we use os.path.expanduser() for various things, > which uses a slightly more elaborate scheme. The downside is it checks HOME > first, which has a different definition under msys. The config files under > ~/ in msys gets read before the regular Windows user’s mercurial.ini, which > means there’s no way to disable expansion under msys, but leave it enabled > when run with cmd.exe. So it seems to boil down to consistency vs > portability, and I’d probably lean slightly to portable, based on my usage. Should I drop this for now? I think this patch is good enough, and the excessive tilde expansion can be fixed later. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3963: merge: mark file gets as CPU heavy
yuja added a comment. > +cpuheavy = repo.ui.configbool('experimental', 'worker.wdir-get-cpu-heavy') > > prog = worker.worker(repo.ui, cost, batchget, (repo, mctx, wctx), > > - actions[ACTION_GET]) + actions[ACTION_GET], + cpuheavy=cpuheavy) My two cents. It's better to add a flag to enable threading (e.g. `threadsafe`) instead of `cpuheavy`, and make it off by default. This is somewhat related to the issue5933. In short, merge functions aren't thread safe if keywords extension is involved. I suspect the "fix" extension would be also unsafe since it calls `repo[rev]`. https://bz.mercurial-scm.org/show_bug.cgi?id=5933 REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3963 To: indygreg, #hg-reviewers Cc: yuja, wlis, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D3963: merge: mark file gets as CPU heavy
> +cpuheavy = repo.ui.configbool('experimental', > 'worker.wdir-get-cpu-heavy') > prog = worker.worker(repo.ui, cost, batchget, (repo, mctx, wctx), > - actions[ACTION_GET]) > + actions[ACTION_GET], > + cpuheavy=cpuheavy) My two cents. It's better to add a flag to enable threading (e.g. `threadsafe`) instead of `cpuheavy`, and make it off by default. This is somewhat related to the issue5933. In short, merge functions aren't thread safe if keywords extension is involved. I suspect the "fix" extension would be also unsafe since it calls `repo[rev]`. https://bz.mercurial-scm.org/show_bug.cgi?id=5933 ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3955: mail: modernize check for Python-with-TLS
yuja added a comment. > > Maybe we can simply remove the check since we've dropped support for > > Python 2.5. > > No, we're looking to see if the ssl module is importable - if it's not, that means Python was compiled without TLS support (which is an option, even on 3.x and 2.7). I'm just sniffing for this particular attribute to force the import. That's true, but I don't think we've ever had support for Python 2.6+ without OpenSSL. Some commands would work thanks to our demandimport, but it also means some stdlib modules (e.g. httlib) would be broken because `import ssl` doesn't fail. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3955 To: durin42, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D3955: mail: modernize check for Python-with-TLS
> > Maybe we can simply remove the check since we've dropped support for > > Python 2.5. > > No, we're looking to see if the ssl module is importable - if it's not, > that means Python was compiled without TLS support (which is an option, even > on 3.x and 2.7). I'm just sniffing for this particular attribute to force the > import. That's true, but I don't think we've ever had support for Python 2.6+ without OpenSSL. Some commands would work thanks to our demandimport, but it also means some stdlib modules (e.g. httlib) would be broken because `import ssl` doesn't fail. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D3960: worker: use one pipe per posix worker and select() in parent process
> @@ -138,7 +138,15 @@ > oldchldhandler = signal.signal(signal.SIGCHLD, sigchldhandler) > ui.flush() > parentpid = os.getpid() > +pipes = [] > for pargs in partition(args, workers): > +# Every worker gets its own pipe to send results on, so we don't > have to > +# implement atomic writes larger than PIPE_BUF. Each forked process > has > +# its own pipe's descriptors in the local variables, and the parent > +# process has the full list of pipe descriptors (and it doesn't > really > +# care what order they're in). > +rfd, wfd = os.pipe() > +pipes.append((rfd, wfd)) > # make sure we use os._exit in all worker code paths. otherwise the > # worker may do some clean-ups which could cause surprises like > # deadlock. see sshpeer.cleanup for example. > @@ -175,8 +183,10 @@ > finally: > os._exit(ret & 255) > pids.add(pid) > -os.close(wfd) > -fp = os.fdopen(rfd, r'rb', 0) > +fps = [] > +for rfd, wfd in pipes: > +os.close(wfd) > +fps.append(os.fdopen(rfd, r'rb', 0)) This isn't enough. For child processes, all pipe fds except for the last wfd have to be closed at the beginning of `workerfunc()`. > +rlist, wlist, xlist = select.select(fps, [], fps) Can you rewrite it to use the selectors module? commandserver.py has an example. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3960: worker: use one pipe per posix worker and select() in parent process
yuja added a comment. > @@ -138,7 +138,15 @@ > > oldchldhandler = signal.signal(signal.SIGCHLD, sigchldhandler) > ui.flush() > parentpid = os.getpid() > > +pipes = [] > > for pargs in partition(args, workers): > > +# Every worker gets its own pipe to send results on, so we don't have to > +# implement atomic writes larger than PIPE_BUF. Each forked process has > +# its own pipe's descriptors in the local variables, and the parent > +# process has the full list of pipe descriptors (and it doesn't really > +# care what order they're in). > +rfd, wfd = os.pipe() > +pipes.append((rfd, wfd)) > > 1. make sure we use os._exit in all worker code paths. otherwise the > 2. worker may do some clean-ups which could cause surprises like > 3. deadlock. see sshpeer.cleanup for example. @@ -175,8 +183,10 @@ finally: os._exit(ret & 255) pids.add(pid) > - os.close(wfd) > - fp = os.fdopen(rfd, r'rb', 0) +fps = [] +for rfd, wfd in pipes: + os.close(wfd) +fps.append(os.fdopen(rfd, r'rb', 0)) This isn't enough. For child processes, all pipe fds except for the last wfd have to be closed at the beginning of `workerfunc()`. > +rlist, wlist, xlist = select.select(fps, [], fps) Can you rewrite it to use the selectors module? commandserver.py has an example. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3960 To: hooper, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH evolve-ext] topic: use self instead of repo in topicrepo methods
# HG changeset patch # User Anton Shestakov # Date 1531909036 -28800 # Wed Jul 18 18:17:16 2018 +0800 # Node ID 3e63522314b688d32c393d783c501a5eab88c74e # Parent 1fa3bf6e9e93cc244dea752196955a6d0c6b25b1 topic: use self instead of repo in topicrepo methods Referring to repo here was somehow preventing it from being garbage-collected (important in hgweb, where currently every request gets a new repo). diff --git a/hgext3rd/topic/__init__.py b/hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py +++ b/hgext3rd/topic/__init__.py @@ -364,7 +364,7 @@ def reposetup(ui, repo): def commit(self, *args, **kwargs): backup = self.ui.backupconfig('ui', 'allowemptycommit') try: -if repo.currenttopic != repo['.'].topic(): +if self.currenttopic != self['.'].topic(): # bypass the core "nothing changed" logic self.ui.setconfig('ui', 'allowemptycommit', True) return super(topicrepo, self).commit(*args, **kwargs) @@ -374,7 +374,7 @@ def reposetup(ui, repo): def commitctx(self, ctx, error=None): topicfilter = topicmap.topicfilter(self.filtername) if topicfilter != self.filtername: -other = repo.filtered(topicmap.topicfilter(repo.filtername)) +other = self.filtered(topicmap.topicfilter(self.filtername)) other.commitctx(ctx, error=error) if isinstance(ctx, context.workingcommitctx): @@ -409,7 +409,7 @@ def reposetup(ui, repo): def branchmap(self, topic=None): if topic is None: -topic = getattr(repo, '_autobranchmaptopic', False) +topic = getattr(self, '_autobranchmaptopic', False) topicfilter = topicmap.topicfilter(self.filtername) if not topic or topicfilter == self.filtername: return super(topicrepo, self).branchmap() @@ -437,7 +437,7 @@ def reposetup(ui, repo): return tr reporef = weakref.ref(self) -if repo.ui.configbool('experimental', 'enforce-single-head'): +if self.ui.configbool('experimental', 'enforce-single-head'): origvalidator = tr.validator def validator(tr2): @@ -446,7 +446,7 @@ def reposetup(ui, repo): origvalidator(tr2) tr.validator = validator -topicmodeserver = repo.ui.config('experimental', +topicmodeserver = self.ui.config('experimental', 'topic-mode.server', 'ignore') ispush = (desc.startswith('push') or desc.startswith('serve')) if (topicmodeserver != 'ignore' and ispush): @@ -458,7 +458,7 @@ def reposetup(ui, repo): return origvalidator(tr2) tr.validator = validator -elif (repo.ui.configbool('experimental', 'topic.publish-bare-branch') +elif (self.ui.configbool('experimental', 'topic.publish-bare-branch') and (desc.startswith('push') or desc.startswith('serve')) ): ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel