D930: merge: add tests to show current behavior on failed filemerges
quark added inline comments. INLINE COMMENTS > test-merge-halt.t:32 > + [1] > + > + $ hg rebase --abort Should we have an `hg resolve -l` here? > test-merge-halt.t:36 > + > +Halting works on first failure > + $ echo onfailure=halt >> $HGRCPATH It feels a bit strange that the text says "works". Maybe use some neutral words like "Testing onfailure=continue", "Testing onfailure=halt", and "Testing onfailure=halt". REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D930 To: ryanmce, #hg-reviewers Cc: quark, krbullock, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D817: histedit: add move histedit action
quark added a comment. In https://phab.mercurial-scm.org/D817#15385, @mbthomas wrote: > I'm thinking now that maybe we don't want `move` at all. If someone does want to move a commit using histedit, they can `copy` it in and then strip/hide the old commit. At the moment there is no way for histedit to affect commits outside the history range that it is editing, and I think that's a good thing. With the current design, copy X to Y then prune (which could be different from "hide", I think our "hide" implementation is still subject to change) X will not create an obsmarker from X to Y. That is the reason why move is needed. That's also mentioned in IRC: Sep 25 11:14:00I think they probably both need to exist Sep 25 11:14:05since move should record an obsolete marker It might be possible to make things smarter so copy X to Y then hide X is equivalent to move X to Y. But the existing code does not support that yet. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D817 To: mbthomas, #hg-reviewers, ryanmce Cc: quark, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D975: test-rebase-base: clarify it is about the "--base" flag
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It happened several times that people use `test-rebase-base.t` as a general purposed test file for rebase. But it is intended to be only related to the `--base` flag. This patch split, renamed the test, and added a note to clarify. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D975 AFFECTED FILES tests/test-rebase-base-flag.t tests/test-rebase-base.t tests/test-rebase-transaction.t CHANGE DETAILS diff --git a/tests/test-rebase-base.t b/tests/test-rebase-transaction.t rename from tests/test-rebase-base.t rename to tests/test-rebase-transaction.t --- a/tests/test-rebase-base.t +++ b/tests/test-rebase-transaction.t @@ -10,375 +10,6 @@ > tglog = log -G --template "{rev}: {desc}" > EOF - $ rebasewithdag() { - > N=`$PYTHON -c "print($N+1)"` - > hg init repo$N && cd repo$N - > hg debugdrawdag - > hg rebase "$@" > _rebasetmp - > r=$? - > grep -v 'saved backup bundle' _rebasetmp - > [ $r -eq 0 ] && hg tglog - > cd .. - > return $r - > } - -Single branching point, without merge: - - $ rebasewithdag -b D -d Z <<'EOS' - > D E - > |/ - > Z B C # C: branching point, E should be picked - > \|/# B should not be picked - > A - > | - > R - > EOS - rebasing 3:d6003a550c2c "C" (C) - rebasing 5:4526cf523425 "D" (D) - rebasing 6:b296604d9846 "E" (E tip) - o 6: E - | - | o 5: D - |/ - o 4: C - | - o 3: Z - | - | o 2: B - |/ - o 1: A - | - o 0: R - -Multiple branching points caused by selecting a single merge changeset: - - $ rebasewithdag -b E -d Z <<'EOS' - > E - >/| - > B C D # B, C: multiple branching points - > | |/ # D should not be picked - > Z | / - > \|/ - > A - > | - > R - > EOS - rebasing 2:c1e6b162678d "B" (B) - rebasing 3:d6003a550c2c "C" (C) - rebasing 6:54c8f00cb91c "E" (E tip) - o6: E - |\ - | o 5: C - | | - o | 4: B - |/ - o 3: Z - | - | o 2: D - |/ - o 1: A - | - o 0: R - -Rebase should not extend the "--base" revset using "descendants": - - $ rebasewithdag -b B -d Z <<'EOS' - > E - >/| - > Z B C # descendants(B) = B+E. With E, C will be included incorrectly - > \|/ - > A - > | - > R - > EOS - rebasing 2:c1e6b162678d "B" (B) - rebasing 5:54c8f00cb91c "E" (E tip) - o5: E - |\ - | o 4: B - | | - | o 3: Z - | | - o | 2: C - |/ - o 1: A - | - o 0: R - -Rebase should not simplify the "--base" revset using "roots": - - $ rebasewithdag -b B+E -d Z <<'EOS' - > E - >/| - > Z B C # roots(B+E) = B. Without E, C will be missed incorrectly - > \|/ - > A - > | - > R - > EOS - rebasing 2:c1e6b162678d "B" (B) - rebasing 3:d6003a550c2c "C" (C) - rebasing 5:54c8f00cb91c "E" (E tip) - o5: E - |\ - | o 4: C - | | - o | 3: B - |/ - o 2: Z - | - o 1: A - | - o 0: R - -The destination is one of the two branching points of a merge: - - $ rebasewithdag -b F -d Z <<'EOS' - > F - >/ \ - > E D - > / / - > Z C - > \ / - > B - > | - > A - > EOS - nothing to rebase - [1] - -Multiple branching points caused by multiple bases (issue5420): - - $ rebasewithdag -b E1+E2+C2+B1 -d Z <<'EOS' - > ZE2 - > | / - > F E1 C2 - > |/ / - > E C1 B2 - > |/ / - > C B1 - > |/ - > B - > | - > A - > | - > R - > EOS - rebasing 3:a113dbaa660a "B1" (B1) - rebasing 5:06ce7b1cc8c2 "B2" (B2) - rebasing 6:0ac98cce32d3 "C1" (C1) - rebasing 8:781512f5e33d "C2" (C2) - rebasing 9:428d8c18f641 "E1" (E1) - rebasing 11:e1bf82f6b6df "E2" (E2) - o 12: E2 - | - o 11: E1 - | - | o 10: C2 - | | - | o 9: C1 - |/ - | o 8: B2 - | | - | o 7: B1 - |/ - o 6: Z - | - o 5: F - | - o 4: E - | - o 3: C - | - o 2: B - | - o 1: A - | - o 0: R - -Multiple branching points with multiple merges: - - $ rebasewithdag -b G+P -d Z <<'EOS' - > G H P - > |\ /| |\ - > F E D M N - > \|/| /| |\ - > Z C B I J K L - > \|/ |/ |/ - > A A A - > EOS - rebasing 2:dc0947a82db8 "C" (C) - rebasing 8:4e4f9194f9f1 "D" (D) - rebasing 9:03ca77807e91 "E" (E) - rebasing 10:afc707c82df0 "F" (F) - rebasing 13:690dfff91e9e "G" (G) - rebasing 14:2893b886bb10 "H" (H) - rebasing 3:08ebfeb61bac "I" (I) - rebasing 4:a0a5005cec67 "J" (J) - rebasing 5:83780307a7e8 "K" (K) - rebasing 6:e131637a1cb6 "L" (L) - rebasing 11:d1f6d0c3c7e4 "M" (M) - rebasing 12:7aaec6f81888 "N" (N) - rebasing 15:325bc8f1760d "P" (P tip) - o15: P - |\ - | o14: N - | |\ - o \ \13: M - |\ \ \ - | | | o 12: L - | | | | - | | o | 11: K - | | |/ - | o / 10: J - | |/ - o / 9: I - |/ - | o8: H - | |\ - | | | o 7: G - | | |/| - | | | o 6: F - | | | | - | | o | 5: E - | | |/ - | o | 4: D - | |\| - +---o 3: C - | | - o |
mercurial@34486: 6 new changesets (1 on stable)
6 new changesets (1 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/bb14dbab4df6 changeset: 34481:bb14dbab4df6 branch: stable parent: 34356:c74d6d870073 user:Augie Facklerdate:Wed Oct 04 09:04:52 2017 -0400 summary: tests: invoke run-tests.py in test-hghave using $PYTHON (issue5697) https://www.mercurial-scm.org/repo/hg/rev/75de5d456b60 changeset: 34482:75de5d456b60 parent: 34480:cbda631c1dde user:Augie Fackler date:Sun Oct 01 12:10:48 2017 -0400 summary: ui: convert to/from Optional[bytes] to Optional[str] in password manager https://www.mercurial-scm.org/repo/hg/rev/a6d95a8b7243 changeset: 34483:a6d95a8b7243 user:Saurabh Singh date:Wed Oct 04 18:39:26 2017 -0700 summary: serve: make tests compatible with chg https://www.mercurial-scm.org/repo/hg/rev/a8a9c0d3232b changeset: 34484:a8a9c0d3232b user:Jun Wu date:Mon Oct 02 16:48:58 2017 -0700 summary: test-alias: make it compatible with chg https://www.mercurial-scm.org/repo/hg/rev/37b7581e5737 changeset: 34485:37b7581e5737 user:Jun Wu date:Mon Oct 02 19:25:11 2017 -0700 summary: eol: make [eol] config section sensitive for chg confighash https://www.mercurial-scm.org/repo/hg/rev/a57c938e7ac8 changeset: 34486:a57c938e7ac8 bookmark:@ tag: tip user:Alex Gaynor date:Fri Sep 29 15:48:34 2017 + summary: style: never use a space before a colon or comma -- 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
D966: hgweb: produce native string for etag value
quark added inline comments. INLINE COMMENTS > common.py:211 > def caching(web, req): > -tag = 'W/"%s"' % web.mtime > +tag = r'W/"%d"' % web.mtime > if req.env.get('HTTP_IF_NONE_MATCH') == tag: It seems we are depending on `os.stat_float_times(False)`. But that is deprecated in Python 3. If the API gets removed, `mtime` might be a float. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D966 To: durin42, #hg-reviewers Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D972: py3: fix keyword arguments handling in mq
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This patch fixes the handling of keyword arguments to functions on Python 3. On python3, the keys of keyword arguments need to str which is unicode. So any keyword argument will get will have str keys and any dictionary we pass as kwargs must have all the keys as str. This patch uses pycompat.(strkwargs|byteskwargs) to do so conversion between bytes keys and str keys and use r'' if there are very less uses and conversion can be prevented. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D972 AFFECTED FILES hgext/mq.py CHANGE DETAILS diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -2266,6 +2266,7 @@ Returns 0 on success.""" q = repo.mq +opts = pycompat.byteskwargs(opts) if patch: if patch not in q.series: @@ -2299,6 +2300,7 @@ Returns 0 on success.""" q = repo.mq +opts = pycompat.byteskwargs(opts) if patch: if patch not in q.series: raise error.Abort(_("patch %s is not in series file") % patch) @@ -2361,6 +2363,7 @@ Returns 0 if import succeeded. """ +opts = pycompat.byteskwargs(opts) with repo.lock(): # cause this may move phase q = repo.mq try: @@ -2415,7 +2418,7 @@ This command is deprecated. Without -c, it's implied by other relevant commands. With -c, use :hg:`init --mq` instead.""" -return qinit(ui, repo, create=opts.get('create_repo')) +return qinit(ui, repo, create=opts.get(r'create_repo')) @command("qclone", [('', 'pull', None, _('use pull protocol to copy metadata')), @@ -2445,6 +2448,7 @@ Return 0 on success. ''' +opts = pycompat.byteskwargs(opts) def patchdir(repo): """compute a patch repo url from a repo object""" url = repo.url() @@ -2526,8 +2530,8 @@ """print the entire series file Returns 0 on success.""" -repo.mq.qseries(repo, missing=opts.get('missing'), -summary=opts.get('summary')) +repo.mq.qseries(repo, missing=opts.get(r'missing'), +summary=opts.get(r'summary')) return 0 @command("qtop", seriesopts, _('hg qtop [-s]')) @@ -2543,7 +2547,7 @@ if t: q.qseries(repo, start=t - 1, length=1, status='A', - summary=opts.get('summary')) + summary=opts.get(r'summary')) else: ui.write(_("no patches applied\n")) return 1 @@ -2558,7 +2562,7 @@ if end == len(q.series): ui.write(_("all patches applied\n")) return 1 -q.qseries(repo, start=end, length=1, summary=opts.get('summary')) +q.qseries(repo, start=end, length=1, summary=opts.get(r'summary')) @command("qprev", seriesopts, _('hg qprev [-s]')) def prev(ui, repo, **opts): @@ -2575,7 +2579,7 @@ return 1 idx = q.series.index(q.applied[-2].name) q.qseries(repo, start=idx, length=1, status='A', - summary=opts.get('summary')) + summary=opts.get(r'summary')) def setupheaderopts(ui, opts): if not opts.get('user') and opts.get('currentuser'): @@ -2621,11 +2625,12 @@ Returns 0 on successful creation of a new patch. """ +opts = pycompat.byteskwargs(opts) msg = cmdutil.logmessage(ui, opts) q = repo.mq opts['msg'] = msg setupheaderopts(ui, opts) -q.new(repo, patch, *args, **opts) +q.new(repo, patch, *args, **pycompat.strkwargs(opts)) q.savedirty() return 0 @@ -2666,11 +2671,12 @@ Returns 0 on success. """ +opts = pycompat.byteskwargs(opts) q = repo.mq message = cmdutil.logmessage(ui, opts) setupheaderopts(ui, opts) with repo.wlock(): -ret = q.refresh(repo, pats, msg=message, **opts) +ret = q.refresh(repo, pats, msg=message, **pycompat.strkwargs(opts)) q.savedirty() return ret @@ -2694,7 +2700,7 @@ Returns 0 on success. """ ui.pager('qdiff') -repo.mq.diff(repo, pats, opts) +repo.mq.diff(repo, pats, pycompat.byteskwargs(opts)) return 0 @command('qfold', @@ -2716,6 +2722,7 @@ current patch header, separated by a line of ``* * *``. Returns 0 on success.""" +opts = pycompat.byteskwargs(opts) q = repo.mq if not files: raise error.Abort(_('qfold requires at least one patch name')) @@ -2774,6 +2781,7 @@ '''push or pop patches until named patch is at top of stack Returns 0 on success.''' +opts = pycompat.byteskwargs(opts) opts = fixkeepchangesopts(ui, opts) q = repo.mq patch = q.lookup(patch) @@ -2839,7 +2847,7 @@ applied = set(p.name for p in q.applied) patch = None args = list(args) -if opts.get('list'): +if opts.get(r'list'): if args or opts.get('none'): raise error.Abort(_('cannot mix
D974: py3: handle keyword arguments correctly in hgext/patchbomb.py
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The keys of keyword arguments must be str on Python 3 which is unicode. This patch make sure we pass keyword arguments with keys are str everywhere in this file and access the keys depending on whether they are bytes or str. This patch uses pycompat.{byteskwargs|strkwargs} and somewhere it also added r'' to prevent transformer from adding a b'' over there. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D974 AFFECTED FILES hgext/patchbomb.py CHANGE DETAILS diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -306,7 +306,7 @@ tmpfn = os.path.join(tmpdir, 'bundle') btype = ui.config('patchbomb', 'bundletype') if btype: -opts['type'] = btype +opts[r'type'] = btype try: commands.bundle(ui, repo, tmpfn, dest, **opts) return util.readfile(tmpfn) @@ -326,8 +326,8 @@ the user through the editor. """ ui = repo.ui -if opts.get('desc'): -body = open(opts.get('desc')).read() +if opts.get(r'desc'): +body = open(opts.get(r'desc')).read() else: ui.write(_('\nWrite the introductory message for the ' 'patch series.\n\n')) @@ -347,21 +347,21 @@ """ ui = repo.ui _charsets = mail._charsets(ui) -subj = (opts.get('subject') +subj = (opts.get(r'subject') or prompt(ui, 'Subject:', 'A bundle for your repository')) body = _getdescription(repo, '', sender, **opts) msg = emailmod.MIMEMultipart.MIMEMultipart() if body: -msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test'))) +msg.attach(mail.mimeencode(ui, body, _charsets, opts.get(r'test'))) datapart = emailmod.MIMEBase.MIMEBase('application', 'x-mercurial-bundle') datapart.set_payload(bundle) -bundlename = '%s.hg' % opts.get('bundlename', 'bundle') +bundlename = '%s.hg' % opts.get(r'bundlename', 'bundle') datapart.add_header('Content-Disposition', 'attachment', filename=bundlename) emailmod.Encoders.encode_base64(datapart) msg.attach(datapart) -msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test')) +msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get(r'test')) return [(msg, subj, None)] def _makeintro(repo, sender, revs, patches, **opts): @@ -372,27 +372,27 @@ _charsets = mail._charsets(ui) # use the last revision which is likely to be a bookmarked head -prefix = _formatprefix(ui, repo, revs.last(), opts.get('flag'), +prefix = _formatprefix(ui, repo, revs.last(), opts.get(r'flag'), 0, len(patches), numbered=True) -subj = (opts.get('subject') or +subj = (opts.get(r'subject') or prompt(ui, '(optional) Subject: ', rest=prefix, default='')) if not subj: return None # skip intro if the user doesn't bother subj = prefix + ' ' + subj body = '' -if opts.get('diffstat'): +if opts.get(r'diffstat'): # generate a cumulative diffstat of the whole patch series diffstat = patch.diffstat(sum(patches, [])) body = '\n' + diffstat else: diffstat = None body = _getdescription(repo, body, sender, **opts) -msg = mail.mimeencode(ui, body, _charsets, opts.get('test')) +msg = mail.mimeencode(ui, body, _charsets, opts.get(r'test')) msg['Subject'] = mail.headencode(ui, subj, _charsets, - opts.get('test')) + opts.get(r'test')) return (msg, subj, diffstat) def _getpatchmsgs(repo, sender, revs, patchnames=None, **opts): @@ -402,6 +402,7 @@ This function returns a list of "email" tuples (subject, content, None). """ +bytesopts = pycompat.byteskwargs(opts) ui = repo.ui _charsets = mail._charsets(ui) patches = list(_getpatches(repo, revs, **opts)) @@ -411,7 +412,7 @@ % len(patches)) # build the intro message, or skip it if the user declines -if introwanted(ui, opts, len(patches)): +if introwanted(ui, bytesopts, len(patches)): msg = _makeintro(repo, sender, revs, patches, **opts) if msg: msgs.append(msg) @@ -425,8 +426,8 @@ for i, (r, p) in enumerate(zip(revs, patches)): if patchnames: name = patchnames[i] -msg = makepatch(ui, repo, r, p, opts, _charsets, i + 1, -len(patches), numbered, name) +msg = makepatch(ui, repo, r, p, bytesopts, _charsets, +i + 1, len(patches), numbered, name) msgs.append(msg) return msgs @@ -567,6 +568,8 @@ Before using this command, you will need to enable email in your hgrc. See the [email] section in
D965: templatefilters: be sure we always feed cgi.escape a str
pulkit accepted this revision. pulkit added a comment. Checked docs and made sure `cgi.escape` on Python 3 accepts str only. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D965 To: durin42, #hg-reviewers, pulkit Cc: pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D821: unamend: move fb extension unamend to core
pulkit updated this revision to Diff 2493. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D821?vs=2128=2493 REVISION DETAIL https://phab.mercurial-scm.org/D821 AFFECTED FILES hgext/uncommit.py tests/test-unamend.t CHANGE DETAILS diff --git a/tests/test-unamend.t b/tests/test-unamend.t new file mode 100644 --- /dev/null +++ b/tests/test-unamend.t @@ -0,0 +1,362 @@ +Test for command `hg unamend` which lives in uncommit extension +=== + + $ cat >> $HGRCPATH << EOF + > [alias] + > glog = log -G -T '{rev}:{node|short} {desc}' + > [experimental] + > evolution = createmarkers, allowunstable + > [extensions] + > rebase = + > amend = + > uncommit = + > EOF + +Repo Setup +- + + $ hg init repo + $ cd repo + $ for ch in {a..h}; do touch $ch; echo "foo" >> $ch; hg ci -Aqm "Added "$ch; done + + $ hg glog + @ 7:ec2426147f0e Added h + | + o 6:87d6d6676308 Added g + | + o 5:825660c69f0c Added f + | + o 4:aa98ab95a928 Added e + | + o 3:62615734edd5 Added d + | + o 2:28ad74487de9 Added c + | + o 1:29becc82797a Added b + | + o 0:18d04c59bb5d Added a + + +Trying to unamend when there was no amend done +-- + + $ hg unamend + abort: changeset must have one predecessor, found 0 predecessors + [255] + +Unamend on clean wdir and tip +-- + + $ echo "bar" >> h + $ hg amend + + $ hg exp + # HG changeset patch + # User test + # Date 0 0 + # Thu Jan 01 00:00:00 1970 + + # Node ID c9fa1a715c1b7661c0fafb362a9f30bd75878d7d + # Parent 87d6d66763085b629e6d7ed56778c79827273022 + Added h + + diff -r 87d6d6676308 -r c9fa1a715c1b h + --- /dev/nullThu Jan 01 00:00:00 1970 + + +++ b/h Thu Jan 01 00:00:00 1970 + + @@ -0,0 +1,2 @@ + +foo + +bar + + $ hg glog --hidden + @ 8:c9fa1a715c1b Added h + | + | x 7:ec2426147f0e Added h + |/ + o 6:87d6d6676308 Added g + | + o 5:825660c69f0c Added f + | + o 4:aa98ab95a928 Added e + | + o 3:62615734edd5 Added d + | + o 2:28ad74487de9 Added c + | + o 1:29becc82797a Added b + | + o 0:18d04c59bb5d Added a + + $ hg unamend + $ hg glog --hidden + @ 9:8da14a1fd653 Added h + | + | x 8:c9fa1a715c1b Added h + |/ + | x 7:ec2426147f0e Added h + |/ + o 6:87d6d6676308 Added g + | + o 5:825660c69f0c Added f + | + o 4:aa98ab95a928 Added e + | + o 3:62615734edd5 Added d + | + o 2:28ad74487de9 Added c + | + o 1:29becc82797a Added b + | + o 0:18d04c59bb5d Added a + + $ hg diff + diff -r 8da14a1fd653 h + --- a/h Thu Jan 01 00:00:00 1970 + + +++ b/h Thu Jan 01 00:00:00 1970 + + @@ -1,1 +1,2 @@ + foo + +bar + + $ hg exp + # HG changeset patch + # User test + # Date 0 0 + # Thu Jan 01 00:00:00 1970 + + # Node ID 8da14a1fd653c3f07fdad5760511c9e12652a306 + # Parent 87d6d66763085b629e6d7ed56778c79827273022 + Added h + + diff -r 87d6d6676308 -r 8da14a1fd653 h + --- /dev/nullThu Jan 01 00:00:00 1970 + + +++ b/h Thu Jan 01 00:00:00 1970 + + @@ -0,0 +1,1 @@ + +foo + + $ hg status + M h + + $ hg log -r . -T '{extras % "{extra}\n"}' --config alias.log=log + branch=default + unamend_source=\xc9\xfa\x1aq\\\x1bva\xc0\xfa\xfb6*\x9f0\xbdu\x87\x8d} + +Unamend on a dirty working directory + + + $ hg ci -m "Added bar to h" + $ echo "bar" >> a + $ hg amend + $ echo "foobar" >> a + $ echo "bar" >> b + $ hg status + M a + M b + + $ hg unamend + + $ hg status + M a + M b + + $ hg diff + diff -r 49f03646f7a0 a + --- a/a Thu Jan 01 00:00:00 1970 + + +++ b/a Thu Jan 01 00:00:00 1970 + + @@ -1,1 +1,3 @@ + foo + +bar + +foobar + diff -r 49f03646f7a0 b + --- a/b Thu Jan 01 00:00:00 1970 + + +++ b/b Thu Jan 01 00:00:00 1970 + + @@ -1,1 +1,2 @@ + foo + +bar + +Unamending an added file + + + $ hg ci -m "Added things to a and b" + $ echo foo > bar + $ hg add bar + $ hg amend + + $ hg unamend + $ hg status + A bar + + $ hg revert --all + forgetting bar + +Unamending a removed file +- + + $ hg remove a + $ hg amend + + $ hg unamend + $ hg status + R a + ? bar + + $ hg revert --all + undeleting a + +Unamending an added file with dirty wdir status +--- + + $ hg add bar + $ hg amend + $ echo bar >> bar + $ hg status + M bar + + $ hg unamend + $ hg status + A bar + $ hg diff + diff -r 738d71740456 bar + --- /dev/nullThu Jan 01 00:00:00 1970 + + +++ b/barThu Jan 01 00:00:00 1970 + + @@ -0,0 +1,2 @@ + +foo + +bar + + $ hg revert --all + forgetting bar + +Unamending in middle of a stack +--- + + $ hg glog + @ 19:738d71740456 Added things to a and b + | + o
D971: uncommit: unify functions _uncommitdirstate and _unamenddirstate to one
pulkit created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The _unamenddirstate() function was inspired by _uncommitdirstate() function as the logic was same but we were unable to use the latter function directly. So previous patch introduced the _unamenddirstate() function and now this patch unifies both the function and we have a _fixdirstate() function. Adding function in previous patch and unifying in a later patch makes the reasoning easier and also leaves the last patch dedicated to what it is meant to be. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D971 AFFECTED FILES hgext/uncommit.py CHANGE DETAILS diff --git a/hgext/uncommit.py b/hgext/uncommit.py --- a/hgext/uncommit.py +++ b/hgext/uncommit.py @@ -90,15 +90,13 @@ newid = repo.commitctx(new) return newid -def _uncommitdirstate(repo, oldctx, match): -"""Fix the dirstate after switching the working directory from -oldctx to a copy of oldctx not containing changed files matched by -match. +def _fixdirstate(repo, oldctx, newctx, status): +""" fix the dirstate after switching the working directory from oldctx to +newctx which can be result of either unamend or uncommit. """ -ctx = repo['.'] ds = repo.dirstate copies = dict(ds.copies()) -s = repo.status(oldctx.p1(), oldctx, match=match) +s = status for f in s.modified: if ds[f] == 'r': # modified + removed -> removed @@ -130,7 +128,7 @@ for dst, src in oldcopies.iteritems()) # Adjust the dirstate copies for dst, src in copies.iteritems(): -if (src not in ctx or dst in ctx or ds[dst] != 'a'): +if (src not in newctx or dst in newctx or ds[dst] != 'a'): src = None ds.copy(src, dst) @@ -185,54 +183,14 @@ with repo.dirstate.parentchange(): repo.dirstate.setparents(newid, node.nullid) -_uncommitdirstate(repo, old, match) +s = repo.status(old.p1(), old, match=match) +_fixdirstate(repo, old, repo[newid], s) def predecessormarkers(ctx): """yields the obsolete markers marking the given changeset as a successor""" for data in ctx.repo().obsstore.predecessors.get(ctx.node(), ()): yield obsutil.marker(ctx.repo(), data) -def _unamenddirstate(repo, predctx, curctx): -"" - -s = repo.status(predctx, curctx) -ds = repo.dirstate -copies = dict(ds.copies()) -for f in s.modified: -if ds[f] == 'r': -# modified + removed -> removed -continue -ds.normallookup(f) - -for f in s.added: -if ds[f] == 'r': -# added + removed -> unknown -ds.drop(f) -elif ds[f] != 'a': -ds.add(f) - -for f in s.removed: -if ds[f] == 'a': -# removed + added -> normal -ds.normallookup(f) -elif ds[f] != 'r': -ds.remove(f) - -# Merge old parent and old working dir copies -oldcopies = {} -for f in (s.modified + s.added): -src = curctx[f].renamed() -if src: -oldcopies[f] = src[0] -oldcopies.update(copies) -copies = dict((dst, oldcopies.get(src, src)) - for dst, src in oldcopies.iteritems()) -# Adjust the dirstate copies -for dst, src in copies.iteritems(): -if (src not in predctx or dst in predctx or ds[dst] != 'a'): -src = None -ds.copy(src, dst) - @command('^unamend', []) def unamend(ui, repo, **opts): """undo the amend operation on a current changeset @@ -300,7 +258,8 @@ with dirstate.parentchange(): dirstate.setparents(newprednode, node.nullid) -_unamenddirstate(repo, newpredctx, curctx) +s = repo.status(predctx, curctx) +_fixdirstate(repo, curctx, newpredctx, s) mapping = {curctx.node(): (newprednode,)} scmutil.cleanupnodes(repo, mapping, 'unamend') To: pulkit, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 5700] New: hg unshelve not allowed while mid-histedit
https://bz.mercurial-scm.org/show_bug.cgi?id=5700 Bug ID: 5700 Summary: hg unshelve not allowed while mid-histedit Product: Mercurial Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: feature Priority: wish Component: histedit Assignee: bugzi...@mercurial-scm.org Reporter: alex.gay...@gmail.com CC: mercurial-devel@mercurial-scm.org Currently if you are in the middle of a histedit, hg unshelve errors out. Per durin42, this is a bug and it should be allowed :-) -- You are receiving this mail because: You are on the CC list for the bug. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D943: chg: move only first time relevant if condition out of loop
singhsrb added a comment. In my opinion, just checking for `hg -R ... serve` would not solve the problem. If we go through that route, we would probably want to always detect the serve command rather than mostly detecting the serve command. However, if we do go in that direction and it makes sense to get rid of the special case for `i == 0`, then sure we should go ahead and delete this code whenever we do that. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D943 To: singhsrb, #hg-reviewers, yuja Cc: yuja, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D942: histedit: removing the experimental config 'histeditng'
This revision was automatically updated to reflect the committed changes. Closed by commit rHG270e344a6c74: histedit: removing the experimental config histeditng (authored by singhsrb, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D942?vs=2489=2492 REVISION DETAIL https://phab.mercurial-scm.org/D942 AFFECTED FILES hgext/histedit.py tests/test-histedit-arguments.t tests/test-histedit-base.t tests/test-histedit-bookmark-motion.t tests/test-histedit-commute.t tests/test-histedit-edit.t tests/test-histedit-obsolete.t tests/test-histedit-outgoing.t CHANGE DETAILS diff --git a/tests/test-histedit-outgoing.t b/tests/test-histedit-outgoing.t --- a/tests/test-histedit-outgoing.t +++ b/tests/test-histedit-outgoing.t @@ -52,6 +52,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -86,6 +87,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -112,6 +114,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t --- a/tests/test-histedit-obsolete.t +++ b/tests/test-histedit-obsolete.t @@ -132,6 +132,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -476,6 +476,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, fold = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t --- a/tests/test-histedit-commute.t +++ b/tests/test-histedit-commute.t @@ -70,6 +70,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -348,6 +349,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-bookmark-motion.t b/tests/test-histedit-bookmark-motion.t --- a/tests/test-histedit-bookmark-motion.t +++ b/tests/test-histedit-bookmark-motion.t @@ -76,6 +76,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -132,6 +133,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there #
D958: i18n: clean msgcache when encoding changes
quark updated this revision to Diff 2490. quark edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D958?vs=2473=2490 REVISION DETAIL https://phab.mercurial-scm.org/D958 AFFECTED FILES mercurial/dispatch.py mercurial/encoding.py mercurial/hgweb/hgweb_mod.py mercurial/hgweb/hgwebdir_mod.py mercurial/i18n.py tests/test-i18n.t CHANGE DETAILS diff --git a/tests/test-i18n.t b/tests/test-i18n.t --- a/tests/test-i18n.t +++ b/tests/test-i18n.t @@ -48,3 +48,23 @@ $ $PYTHON check-translation.py *.po $ $PYTHON check-translation.py --doctest $ cd $TESTTMP + +Check i18n cache gets invalidated correctly with encoding change: + + $ cat > $TESTTMP/encodingchange.py << EOF + > from mercurial import encoding, registrar + > from mercurial.i18n import _ + > cmdtable = {} + > command = registrar.command(cmdtable) + > @command('encodingchange', norepo=True) + > def encodingchange(ui): + > for encode in ('ascii', 'UTF-8', 'ascii', 'UTF-8'): + > encoding.setencoding(encode) + > ui.write('%s\n' % encoding.jsonescape(_('(EXPERIMENTAL)'))) + > EOF + + $ LANGUAGE=ja hg --config extensions.encodingchange=$TESTTMP/encodingchange.py encodingchange + (?) + (\xe5\xae\x9f\xe9\xa8\x93\xe7\x9a\x84\xe5\xae\x9f\xe8\xa3\x85) (esc) + (?) + (\xe5\xae\x9f\xe9\xa8\x93\xe7\x9a\x84\xe5\xae\x9f\xe8\xa3\x85) (esc) diff --git a/mercurial/i18n.py b/mercurial/i18n.py --- a/mercurial/i18n.py +++ b/mercurial/i18n.py @@ -60,6 +60,8 @@ _msgcache = {} +encoding.setencodingcallbacks.append(_msgcache.clear) + def gettext(message): """Translate message. diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -173,7 +173,7 @@ self.repos = repos self.ui = u -encoding.encoding = self.ui.config('web', 'encoding') +encoding.setencoding(self.ui.config('web', 'encoding')) self.style = self.ui.config('web', 'style') self.templatepath = self.ui.config('web', 'templates', untrusted=False) self.stripecount = self.ui.config('web', 'stripes') diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -320,7 +320,7 @@ rctx = requestcontext(self, repo) # This state is global across all threads. -encoding.encoding = rctx.config('web', 'encoding') +encoding.setencoding(rctx.config('web', 'encoding')) rctx.repo.ui.environ = req.env if rctx.csp: diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -581,6 +581,20 @@ r += c return r +# used by i18n to clean its message cache after encoding change +setencodingcallbacks = [] + +def setencoding(newencoding=None, newencodingmode=None): +global encoding, encodingmode +oldvalues = (encoding, encodingmode) +if newencoding: +encoding = newencoding +if newencodingmode: +encodingmode = newencodingmode +if oldvalues != (encoding, encodingmode): +for func in setencodingcallbacks: +func() + if pycompat.ispy3: class strio(io.TextIOWrapper): """Wrapper around TextIOWrapper that respects hg's encoding assumptions. diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -811,10 +811,8 @@ "option -R has to be separated from other options (e.g. not " "-qR) and --repository may only be abbreviated as --repo!")) -if options["encoding"]: -encoding.encoding = options["encoding"] -if options["encodingmode"]: -encoding.encodingmode = options["encodingmode"] +encoding.setencoding(options["encoding"], options["encodingmode"]) + if options["time"]: def get_times(): t = os.times() To: quark, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D959: patch: invalidate messages after encoding change
quark updated this revision to Diff 2491. quark edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D959?vs=2474=2491 REVISION DETAIL https://phab.mercurial-scm.org/D959 AFFECTED FILES mercurial/patch.py CHANGE DETAILS diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -994,50 +994,59 @@ def __repr__(self): return '' % (self.filename(), self.fromline) -messages = { -'multiple': { -'discard': _("discard change %d/%d to '%s'?"), -'record': _("record change %d/%d to '%s'?"), -'revert': _("revert change %d/%d to '%s'?"), -}, -'single': { -'discard': _("discard this change to '%s'?"), -'record': _("record this change to '%s'?"), -'revert': _("revert this change to '%s'?"), -}, -'help': { -'discard': _('[Ynesfdaq?]' - '$$ , discard this change' - '$$ , skip this change' - '$$ this change manually' - '$$ remaining changes to this file' - '$$ Discard remaining changes to this ' - '$$ , skip remaining changes and files' - '$$ Discard changes to all remaining files' - '$$ , discarding no changes' - '$$ &? (display help)'), -'record': _('[Ynesfdaq?]' -'$$ , record this change' -'$$ , skip this change' -'$$ this change manually' -'$$ remaining changes to this file' -'$$ Record remaining changes to this ' -'$$ , skip remaining changes and files' -'$$ Record changes to all remaining files' -'$$ , recording no changes' -'$$ &? (display help)'), -'revert': _('[Ynesfdaq?]' -'$$ , revert this change' -'$$ , skip this change' -'$$ this change manually' -'$$ remaining changes to this file' -'$$ Revert remaining changes to this ' -'$$ , skip remaining changes and files' -'$$ Revert changes to all remaining files' -'$$ , reverting no changes' -'$$ &? (display help)') +def _getmessages(): +return { +'multiple': { +'discard': _("discard change %d/%d to '%s'?"), +'record': _("record change %d/%d to '%s'?"), +'revert': _("revert change %d/%d to '%s'?"), +}, +'single': { +'discard': _("discard this change to '%s'?"), +'record': _("record this change to '%s'?"), +'revert': _("revert this change to '%s'?"), +}, +'help': { +'discard': _('[Ynesfdaq?]' + '$$ , discard this change' + '$$ , skip this change' + '$$ this change manually' + '$$ remaining changes to this file' + '$$ Discard remaining changes to this ' + '$$ , skip remaining changes and files' + '$$ Discard changes to all remaining files' + '$$ , discarding no changes' + '$$ &? (display help)'), +'record': _('[Ynesfdaq?]' +'$$ , record this change' +'$$ , skip this change' +'$$ this change manually' +'$$ remaining changes to this file' +'$$ Record remaining changes to this ' +'$$ , skip remaining changes and files' +'$$ Record changes to all remaining files' +'$$ , recording no changes' +'$$ &? (display help)'), +'revert': _('[Ynesfdaq?]' +'$$ , revert this change' +'$$ , skip this change' +'$$ this change manually' +'$$ remaining changes to this file' +'$$ Revert remaining changes to this ' +'$$ , skip remaining changes and files' +'$$ Revert changes to all remaining files' +'$$ , reverting no changes' +'$$ &? (display help)') +} } -} + +messages = _getmessages() + +def _resetmessages(): +global messages +messages = _getmessages() + +encoding.setencodingcallbacks.append(_resetmessages) def filterpatch(ui, headers, operation=None): """Interactively filter patch chunks into applied-only chunks""" To: quark, #hg-reviewers Cc: mercurial-devel
D942: histedit: removing the experimental config 'histeditng'
singhsrb updated this revision to Diff 2489. singhsrb edited the test plan for this revision. singhsrb added a comment. Updating https://phab.mercurial-scm.org/D942: Modified test plan to account for documentation. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D942?vs=2488=2489 BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D942 AFFECTED FILES hgext/histedit.py tests/test-histedit-arguments.t tests/test-histedit-base.t tests/test-histedit-bookmark-motion.t tests/test-histedit-commute.t tests/test-histedit-edit.t tests/test-histedit-obsolete.t tests/test-histedit-outgoing.t CHANGE DETAILS diff --git a/tests/test-histedit-outgoing.t b/tests/test-histedit-outgoing.t --- a/tests/test-histedit-outgoing.t +++ b/tests/test-histedit-outgoing.t @@ -52,6 +52,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -86,6 +87,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -112,6 +114,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t --- a/tests/test-histedit-obsolete.t +++ b/tests/test-histedit-obsolete.t @@ -132,6 +132,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -476,6 +476,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, fold = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t --- a/tests/test-histedit-commute.t +++ b/tests/test-histedit-commute.t @@ -70,6 +70,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -348,6 +349,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-bookmark-motion.t b/tests/test-histedit-bookmark-motion.t --- a/tests/test-histedit-bookmark-motion.t +++ b/tests/test-histedit-bookmark-motion.t @@ -76,6 +76,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -132,6 +133,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and
D942: histedit: removing the experimental config 'histeditng'
singhsrb updated this revision to Diff 2488. singhsrb added a comment. Updating https://phab.mercurial-scm.org/D942: Addressing the review comments and adding some documentation. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D942?vs=2440=2488 BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D942 AFFECTED FILES hgext/histedit.py tests/test-histedit-arguments.t tests/test-histedit-base.t tests/test-histedit-bookmark-motion.t tests/test-histedit-commute.t tests/test-histedit-edit.t tests/test-histedit-obsolete.t tests/test-histedit-outgoing.t CHANGE DETAILS diff --git a/tests/test-histedit-outgoing.t b/tests/test-histedit-outgoing.t --- a/tests/test-histedit-outgoing.t +++ b/tests/test-histedit-outgoing.t @@ -52,6 +52,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -86,6 +87,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -112,6 +114,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t --- a/tests/test-histedit-obsolete.t +++ b/tests/test-histedit-obsolete.t @@ -132,6 +132,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-edit.t b/tests/test-histedit-edit.t --- a/tests/test-histedit-edit.t +++ b/tests/test-histedit-edit.t @@ -476,6 +476,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, fold = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-commute.t b/tests/test-histedit-commute.t --- a/tests/test-histedit-commute.t +++ b/tests/test-histedit-commute.t @@ -70,6 +70,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -348,6 +349,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date diff --git a/tests/test-histedit-bookmark-motion.t b/tests/test-histedit-bookmark-motion.t --- a/tests/test-histedit-bookmark-motion.t +++ b/tests/test-histedit-bookmark-motion.t @@ -76,6 +76,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there # d, drop = remove commit from history # f, fold = use commit, but combine it with the one above # r, roll = like fold, but discard this commit's description and date @@ -132,6 +133,7 @@ # e, edit = use commit, but stop for amending # m, mess = edit commit message without changing commit content # p, pick = use commit + # b, base = checkout changeset and apply further changesets from there #
D936: convert: fix the RevisionSpec import in the bzr module
This revision was automatically updated to reflect the committed changes. Closed by commit rHG6bda8a9d8431: convert: fix the RevisionSpec import in the bzr module (authored by singhsrb, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D936?vs=2444=2487 REVISION DETAIL https://phab.mercurial-scm.org/D936 AFFECTED FILES hgext/convert/bzr.py CHANGE DETAILS diff --git a/hgext/convert/bzr.py b/hgext/convert/bzr.py --- a/hgext/convert/bzr.py +++ b/hgext/convert/bzr.py @@ -30,11 +30,12 @@ import bzrlib.bzrdir import bzrlib.errors import bzrlib.revision -import bzrlib.revisionspec.RevisionSpec +import bzrlib.revisionspec bzrdir = bzrlib.bzrdir errors = bzrlib.errors revision = bzrlib.revision revisionspec = bzrlib.revisionspec +revisionspec.RevisionSpec except ImportError: pass To: singhsrb, #hg-reviewers, quark, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D963: hgweb: in protocol adapter, look for bytes instances, not str
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D963 AFFECTED FILES mercurial/hgweb/protocol.py CHANGE DETAILS diff --git a/mercurial/hgweb/protocol.py b/mercurial/hgweb/protocol.py --- a/mercurial/hgweb/protocol.py +++ b/mercurial/hgweb/protocol.py @@ -164,7 +164,7 @@ yield chunk rsp = wireproto.dispatch(repo, p, cmd) -if isinstance(rsp, str): +if isinstance(rsp, bytes): req.respond(HTTP_OK, HGTYPE, body=rsp) return [] elif isinstance(rsp, wireproto.streamres): To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D966: hgweb: produce native string for etag value
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Also use %d since we know mtime is numeric. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D966 AFFECTED FILES mercurial/hgweb/common.py CHANGE DETAILS diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py +++ b/mercurial/hgweb/common.py @@ -208,7 +208,7 @@ encoding.environ.get("EMAIL") or "") def caching(web, req): -tag = 'W/"%s"' % web.mtime +tag = r'W/"%d"' % web.mtime if req.env.get('HTTP_IF_NONE_MATCH') == tag: raise ErrorResponse(HTTP_NOT_MODIFIED) req.headers.append(('ETag', tag)) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D967: hgweb: when constructing or adding to a wsgi environ dict, use native strs
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY That's what's required of us to work with the WSGI API on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D967 AFFECTED FILES mercurial/hgweb/request.py mercurial/hgweb/server.py mercurial/hgweb/wsgicgi.py CHANGE DETAILS diff --git a/mercurial/hgweb/wsgicgi.py b/mercurial/hgweb/wsgicgi.py --- a/mercurial/hgweb/wsgicgi.py +++ b/mercurial/hgweb/wsgicgi.py @@ -24,28 +24,28 @@ util.setbinary(util.stdout) environ = dict(encoding.environ.iteritems()) -environ.setdefault('PATH_INFO', '') -if environ.get('SERVER_SOFTWARE', '').startswith('Microsoft-IIS'): +environ.setdefault(r'PATH_INFO', '') +if environ.get(r'SERVER_SOFTWARE', r'').startswith(r'Microsoft-IIS'): # IIS includes script_name in PATH_INFO -scriptname = environ['SCRIPT_NAME'] -if environ['PATH_INFO'].startswith(scriptname): -environ['PATH_INFO'] = environ['PATH_INFO'][len(scriptname):] +scriptname = environ[r'SCRIPT_NAME'] +if environ[r'PATH_INFO'].startswith(scriptname): +environ[r'PATH_INFO'] = environ[r'PATH_INFO'][len(scriptname):] stdin = util.stdin -if environ.get('HTTP_EXPECT', '').lower() == '100-continue': +if environ.get(r'HTTP_EXPECT', r'').lower() == r'100-continue': stdin = common.continuereader(stdin, util.stdout.write) -environ['wsgi.input'] = stdin -environ['wsgi.errors'] = util.stderr -environ['wsgi.version'] = (1, 0) -environ['wsgi.multithread'] = False -environ['wsgi.multiprocess'] = True -environ['wsgi.run_once'] = True +environ[r'wsgi.input'] = stdin +environ[r'wsgi.errors'] = util.stderr +environ[r'wsgi.version'] = (1, 0) +environ[r'wsgi.multithread'] = False +environ[r'wsgi.multiprocess'] = True +environ[r'wsgi.run_once'] = True -if environ.get('HTTPS', 'off').lower() in ('on', '1', 'yes'): -environ['wsgi.url_scheme'] = 'https' +if environ.get(r'HTTPS', r'off').lower() in (r'on', r'1', r'yes'): +environ[r'wsgi.url_scheme'] = r'https' else: -environ['wsgi.url_scheme'] = 'http' +environ[r'wsgi.url_scheme'] = r'http' headers_set = [] headers_sent = [] diff --git a/mercurial/hgweb/server.py b/mercurial/hgweb/server.py --- a/mercurial/hgweb/server.py +++ b/mercurial/hgweb/server.py @@ -63,7 +63,7 @@ """Prepare .socket of new HTTPServer instance""" def __init__(self, *args, **kargs): -self.protocol_version = 'HTTP/1.1' +self.protocol_version = r'HTTP/1.1' httpservermod.basehttprequesthandler.__init__(self, *args, **kargs) def _log_any(self, fp, format, *args): @@ -112,45 +112,45 @@ path, query = _splitURI(self.path) env = {} -env['GATEWAY_INTERFACE'] = 'CGI/1.1' -env['REQUEST_METHOD'] = self.command -env['SERVER_NAME'] = self.server.server_name -env['SERVER_PORT'] = str(self.server.server_port) -env['REQUEST_URI'] = self.path -env['SCRIPT_NAME'] = self.server.prefix -env['PATH_INFO'] = path[len(self.server.prefix):] -env['REMOTE_HOST'] = self.client_address[0] -env['REMOTE_ADDR'] = self.client_address[0] +env[r'GATEWAY_INTERFACE'] = r'CGI/1.1' +env[r'REQUEST_METHOD'] = self.command +env[r'SERVER_NAME'] = self.server.server_name +env[r'SERVER_PORT'] = str(self.server.server_port) +env[r'REQUEST_URI'] = self.path +env[r'SCRIPT_NAME'] = self.server.prefix +env[r'PATH_INFO'] = path[len(self.server.prefix):] +env[r'REMOTE_HOST'] = self.client_address[0] +env[r'REMOTE_ADDR'] = self.client_address[0] if query: -env['QUERY_STRING'] = query +env[r'QUERY_STRING'] = query if self.headers.typeheader is None: -env['CONTENT_TYPE'] = self.headers.type +env[r'CONTENT_TYPE'] = self.headers.type else: -env['CONTENT_TYPE'] = self.headers.typeheader +env[r'CONTENT_TYPE'] = self.headers.typeheader length = self.headers.getheader('content-length') if length: -env['CONTENT_LENGTH'] = length +env[r'CONTENT_LENGTH'] = length for header in [h for h in self.headers.keys() if h not in ('content-type', 'content-length')]: -hkey = 'HTTP_' + header.replace('-', '_').upper() -hval = self.headers.getheader(header) -hval = hval.replace('\n', '').strip() +hkey = r'HTTP_' + header.replace(r'-', r'_').upper() +hval = self.headers.get(header) +hval = hval.replace(r'\n', r'').strip() if hval: env[hkey] = hval -env['SERVER_PROTOCOL'] = self.request_version -env['wsgi.version']
D969: request: coerce content-type to native str
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Again, required by WSGI. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D969 AFFECTED FILES mercurial/hgweb/request.py CHANGE DETAILS diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py --- a/mercurial/hgweb/request.py +++ b/mercurial/hgweb/request.py @@ -19,6 +19,7 @@ ) from .. import ( +pycompat, util, ) @@ -89,6 +90,8 @@ pass def respond(self, status, type, filename=None, body=None): +if not isinstance(type, str): +type = pycompat.sysstr(type) if self._start_response is not None: self.headers.append(('Content-Type', type)) if filename: To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D942: histedit: removing the experimental config 'histeditng'
singhsrb added a comment. I totally missed the decorator. Thanks guys! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D942 To: singhsrb, #hg-reviewers, quark, durin42 Cc: durin42, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D970: hgweb: extract function for loading style from request context
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Also make it work on Python 3. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D970 AFFECTED FILES mercurial/hgweb/hgweb_mod.py mercurial/hgweb/hgwebdir_mod.py CHANGE DETAILS diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -503,12 +503,8 @@ url += '/' vars = {} -styles = ( -req.form.get('style', [None])[0], -config('web', 'style'), -'paper' -) -style, mapfile = templater.stylemap(styles, self.templatepath) +styles, (style, mapfile) = hgweb_mod.getstyle(req, config, + self.templatepath) if style == styles[0]: vars['style'] = style diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -30,6 +30,7 @@ hg, hook, profiling, +pycompat, repoview, templatefilters, templater, @@ -60,6 +61,17 @@ ('bz2', ('application/x-bzip2', 'tbz2', '.tar.bz2', None)), )) +def getstyle(req, configfn, templatepath): +fromreq = req.form.get('style', [None])[0] +if fromreq is not None: +fromreq = pycompat.sysbytes(fromreq) +styles = ( +fromreq, +configfn('web', 'style'), +'paper', +) +return styles, templater.stylemap(styles, templatepath) + def makebreadcrumb(url, prefix=''): '''Return a 'URL breadcrumb' list @@ -170,12 +182,8 @@ # figure out which style to use vars = {} -styles = ( -req.form.get('style', [None])[0], -self.config('web', 'style'), -'paper', -) -style, mapfile = templater.stylemap(styles, self.templatepath) +styles, (style, mapfile) = getstyle(req, self.config, +self.templatepath) if style == styles[0]: vars['style'] = style To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D964: python3: add and use adapter for func_name attr, now known as __name__
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D964 AFFECTED FILES mercurial/peer.py mercurial/pycompat.py mercurial/templater.py CHANGE DETAILS diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -412,9 +412,10 @@ sym = findsymbolicname(arg) if sym: msg = (_("template filter '%s' is not compatible with keyword '%s'") - % (filt.func_name, sym)) + % (pycompat.funcname(filt), sym)) else: -msg = _("incompatible use of template filter '%s'") % filt.func_name +msg = _("incompatible use of template filter '%s'") % ( +pycompat.funcname(filt)) raise error.Abort(msg) def buildmap(exp, context): diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py --- a/mercurial/pycompat.py +++ b/mercurial/pycompat.py @@ -71,6 +71,9 @@ stdout = sys.stdout.buffer stderr = sys.stderr.buffer +def funcname(func): +return sysbytes(func.__name__) + # Since Python 3 converts argv to wchar_t type by Py_DecodeLocale() on Unix, # we can use os.fsencode() to get back bytes argv. # @@ -305,6 +308,10 @@ stdin = sys.stdin stdout = sys.stdout stderr = sys.stderr + +def funcname(func): +return func.func_name + if getattr(sys, 'argv', None) is not None: sysargv = sys.argv sysplatform = sys.platform diff --git a/mercurial/peer.py b/mercurial/peer.py --- a/mercurial/peer.py +++ b/mercurial/peer.py @@ -10,6 +10,7 @@ from . import ( error, +pycompat, util, ) @@ -90,7 +91,7 @@ if not encresref: return encargsorres # a local result in this case self = args[0] -encresref.set(self._submitone(f.func_name, encargsorres)) +encresref.set(self._submitone(pycompat.funcname(f), encargsorres)) return next(batchable) setattr(plain, 'batchable', f) return plain To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D968: request: use trivial iterator over dictionary keys
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D968 AFFECTED FILES mercurial/hgweb/request.py CHANGE DETAILS diff --git a/mercurial/hgweb/request.py b/mercurial/hgweb/request.py --- a/mercurial/hgweb/request.py +++ b/mercurial/hgweb/request.py @@ -39,7 +39,7 @@ def normalize(form): # first expand the shortcuts -for k in shortcuts.iterkeys(): +for k in shortcuts: if k in form: for name, value in shortcuts[k]: if value is None: To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D965: templatefilters: be sure we always feed cgi.escape a str
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D965 AFFECTED FILES mercurial/templatefilters.py CHANGE DETAILS diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py --- a/mercurial/templatefilters.py +++ b/mercurial/templatefilters.py @@ -128,7 +128,8 @@ """Any text. Replaces the special XML/XHTML characters "&", "<" and ">" with XML entities, and filters out NUL characters. """ -return cgi.escape(text.replace('\0', ''), True) +return pycompat.sysbytes( +cgi.escape(pycompat.sysstr(text.replace('\0', '')), True)) para_re = None space_re = None To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D962: hgweb: in protocol adapter, avoid control reaching end of non-void function
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This greatly confounded some Python 3 porting work, once it was managing to get this far. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D962 AFFECTED FILES mercurial/hgweb/protocol.py CHANGE DETAILS diff --git a/mercurial/hgweb/protocol.py b/mercurial/hgweb/protocol.py --- a/mercurial/hgweb/protocol.py +++ b/mercurial/hgweb/protocol.py @@ -15,6 +15,7 @@ ) from .. import ( +error, util, wireproto, ) @@ -199,3 +200,4 @@ rsp = rsp.message req.respond(HTTP_OK, HGERRTYPE, body=rsp) return [] +raise error.ProgrammingError('hgweb.protocol internal failure', rsp) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D961: test-check-code: fail new commits which use 'atexit' instead of 'ui.atexit'
singhsrb created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Callbacks registered with 'atexit' are sometimes not called (like when hg aborts and calls os._exit). On the other hand, callbacks registered with 'ui.atexit' are called in most cases. Therefore, encouraging the use of 'ui.atexit' by failing the test 'test-check-code.t' appropriately. TEST PLAN Ran the test 'test-check-code.t' after importing 'atexit' in one of the py files and confirmed that the test fails. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D961 AFFECTED FILES contrib/check-code.py CHANGE DETAILS diff --git a/contrib/check-code.py b/contrib/check-code.py --- a/contrib/check-code.py +++ b/contrib/check-code.py @@ -345,6 +345,7 @@ (r'def.*[( ]\w+=\{\}', "don't use mutable default arguments"), (r'\butil\.Abort\b', "directly use error.Abort"), (r'^@(\w*\.)?cachefunc', "module-level @cachefunc is risky, please avoid"), +(r'^import atexit', "don't use atexit, use ui.atexit"), (r'^import Queue', "don't use Queue, use util.queue + util.empty"), (r'^import cStringIO', "don't use cStringIO.StringIO, use util.stringio"), (r'^import urllib', "don't use urllib, use util.urlreq/util.urlerr"), To: singhsrb, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D960: bundle2: immediate exit for ctrl+c (issue5692)
durham created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY https://phab.mercurial-scm.org/rHG21c2df59a1dad534bfac45acc0bbfb6cb2afe9b4 regressed bundle2 by catching all exceptions and trying to handle them. The old behavior was to allow KeyboardInterrupts to throw and not have graceful cleanup, which allowed it to exit immediately. Let's go back to that behavior. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D960 AFFECTED FILES mercurial/bundle2.py CHANGE DETAILS diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -370,7 +370,10 @@ if not self.iterator: return -if exc: +# Only gracefully abort in a normal exception situation. User aborts +# like Ctrl+C throw a KeyboardInterrupt which is not a base Exception, +# and should not gracefully cleanup. +if isinstance(exc, Exception): # If exiting or interrupted, do not attempt to seek the stream in # the finally block below. This makes abort faster. if (self.current and To: durham, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D957: test-push-race: use 'ui.atexit' instead of python's 'atexit'
singhsrb updated this revision to Diff 2475. singhsrb edited the summary of this revision. singhsrb added a comment. Updating to a more correct summary. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D957?vs=2472=2475 BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D957 AFFECTED FILES tests/test-push-race.t CHANGE DETAILS diff --git a/tests/test-push-race.t b/tests/test-push-race.t --- a/tests/test-push-race.t +++ b/tests/test-push-race.t @@ -15,7 +15,6 @@ > Client with the extensions will create a file when ready and get stuck until > a file is created.""" > - > import atexit > import errno > import os > import time @@ -51,7 +50,7 @@ > except OSError as exc: > if exc.errno != errno.ENOENT: > raise - > atexit.register(delete) + > ui.atexit(delete) > return orig(pushop) > > def uisetup(ui): To: singhsrb, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D958: i18n: clean msgcache when encoding changes
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY In rare cases (ex. chg), encoding may change on the fly and existing i18n msgcache needs to be cleared. This reveals an issue of test-commit-interactive.t, which will be fixed by the next patch. That said, test-commit-interactive.t now passes both with and without chg. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D958 AFFECTED FILES mercurial/dispatch.py mercurial/encoding.py mercurial/hgweb/hgweb_mod.py mercurial/hgweb/hgwebdir_mod.py mercurial/i18n.py tests/test-commit-interactive.t tests/test-i18n.t CHANGE DETAILS diff --git a/tests/test-i18n.t b/tests/test-i18n.t --- a/tests/test-i18n.t +++ b/tests/test-i18n.t @@ -48,3 +48,23 @@ $ $PYTHON check-translation.py *.po $ $PYTHON check-translation.py --doctest $ cd $TESTTMP + +Check i18n cache gets invalidated correctly with encoding change: + + $ cat > $TESTTMP/encodingchange.py << EOF + > from mercurial import encoding, registrar + > from mercurial.i18n import _ + > cmdtable = {} + > command = registrar.command(cmdtable) + > @command('encodingchange', norepo=True) + > def encodingchange(ui): + > for encode in ('ascii', 'UTF-8', 'ascii', 'UTF-8'): + > encoding.setencoding(encode) + > ui.write('%s\n' % encoding.jsonescape(_('(EXPERIMENTAL)'))) + > EOF + + $ LANGUAGE=ja hg --config extensions.encodingchange=$TESTTMP/encodingchange.py encodingchange + (?) + (\xe5\xae\x9f\xe9\xa8\x93\xe7\x9a\x84\xe5\xae\x9f\xe8\xa3\x85) (esc) + (?) + (\xe5\xae\x9f\xe9\xa8\x93\xe7\x9a\x84\xe5\xae\x9f\xe8\xa3\x85) (esc) diff --git a/tests/test-commit-interactive.t b/tests/test-commit-interactive.t --- a/tests/test-commit-interactive.t +++ b/tests/test-commit-interactive.t @@ -913,7 +913,7 @@ > ? > q > EOF - y - \x82\xb1\x82\xcc\x95\xcf\x8dX\x82\xf0\x8bL\x98^(yes) + y - ???(yes) $ LANGUAGE= #endif diff --git a/mercurial/i18n.py b/mercurial/i18n.py --- a/mercurial/i18n.py +++ b/mercurial/i18n.py @@ -60,6 +60,8 @@ _msgcache = {} +encoding.setencodingcallbacks.append(_msgcache.clear) + def gettext(message): """Translate message. diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -173,7 +173,7 @@ self.repos = repos self.ui = u -encoding.encoding = self.ui.config('web', 'encoding') +encoding.setencoding(self.ui.config('web', 'encoding')) self.style = self.ui.config('web', 'style') self.templatepath = self.ui.config('web', 'templates', untrusted=False) self.stripecount = self.ui.config('web', 'stripes') diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -320,7 +320,7 @@ rctx = requestcontext(self, repo) # This state is global across all threads. -encoding.encoding = rctx.config('web', 'encoding') +encoding.setencoding(rctx.config('web', 'encoding')) rctx.repo.ui.environ = req.env if rctx.csp: diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -581,6 +581,20 @@ r += c return r +# used by i18n to clean its message cache after encoding change +setencodingcallbacks = [] + +def setencoding(newencoding=None, newencodingmode=None): +global encoding, encodingmode +oldvalues = (encoding, encodingmode) +if newencoding: +encoding = newencoding +if newencodingmode: +encodingmode = newencodingmode +if oldvalues != (encoding, encodingmode): +for func in setencodingcallbacks: +func() + if pycompat.ispy3: class strio(io.TextIOWrapper): """Wrapper around TextIOWrapper that respects hg's encoding assumptions. diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -811,10 +811,8 @@ "option -R has to be separated from other options (e.g. not " "-qR) and --repository may only be abbreviated as --repo!")) -if options["encoding"]: -encoding.encoding = options["encoding"] -if options["encodingmode"]: -encoding.encodingmode = options["encodingmode"] +encoding.setencoding(options["encoding"], options["encodingmode"]) + if options["time"]: def get_times(): t = os.times() To: quark, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D959: patch: invalidate messages after encoding change
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Previously the code caches i18n._ results in module variables. That should be invalidated with encoding change. This makes test-commit-interactive.t work as expected. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D959 AFFECTED FILES mercurial/patch.py tests/test-commit-interactive.t CHANGE DETAILS diff --git a/tests/test-commit-interactive.t b/tests/test-commit-interactive.t --- a/tests/test-commit-interactive.t +++ b/tests/test-commit-interactive.t @@ -913,7 +913,7 @@ > ? > q > EOF - y - ???(yes) + y - \x82\xb1\x82\xcc\x95\xcf\x8dX\x82\xf0\x8bL\x98^(yes) $ LANGUAGE= #endif diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -994,50 +994,59 @@ def __repr__(self): return '' % (self.filename(), self.fromline) -messages = { -'multiple': { -'discard': _("discard change %d/%d to '%s'?"), -'record': _("record change %d/%d to '%s'?"), -'revert': _("revert change %d/%d to '%s'?"), -}, -'single': { -'discard': _("discard this change to '%s'?"), -'record': _("record this change to '%s'?"), -'revert': _("revert this change to '%s'?"), -}, -'help': { -'discard': _('[Ynesfdaq?]' - '$$ , discard this change' - '$$ , skip this change' - '$$ this change manually' - '$$ remaining changes to this file' - '$$ Discard remaining changes to this ' - '$$ , skip remaining changes and files' - '$$ Discard changes to all remaining files' - '$$ , discarding no changes' - '$$ &? (display help)'), -'record': _('[Ynesfdaq?]' -'$$ , record this change' -'$$ , skip this change' -'$$ this change manually' -'$$ remaining changes to this file' -'$$ Record remaining changes to this ' -'$$ , skip remaining changes and files' -'$$ Record changes to all remaining files' -'$$ , recording no changes' -'$$ &? (display help)'), -'revert': _('[Ynesfdaq?]' -'$$ , revert this change' -'$$ , skip this change' -'$$ this change manually' -'$$ remaining changes to this file' -'$$ Revert remaining changes to this ' -'$$ , skip remaining changes and files' -'$$ Revert changes to all remaining files' -'$$ , reverting no changes' -'$$ &? (display help)') +def _getmessages(): +return { +'multiple': { +'discard': _("discard change %d/%d to '%s'?"), +'record': _("record change %d/%d to '%s'?"), +'revert': _("revert change %d/%d to '%s'?"), +}, +'single': { +'discard': _("discard this change to '%s'?"), +'record': _("record this change to '%s'?"), +'revert': _("revert this change to '%s'?"), +}, +'help': { +'discard': _('[Ynesfdaq?]' + '$$ , discard this change' + '$$ , skip this change' + '$$ this change manually' + '$$ remaining changes to this file' + '$$ Discard remaining changes to this ' + '$$ , skip remaining changes and files' + '$$ Discard changes to all remaining files' + '$$ , discarding no changes' + '$$ &? (display help)'), +'record': _('[Ynesfdaq?]' +'$$ , record this change' +'$$ , skip this change' +'$$ this change manually' +'$$ remaining changes to this file' +'$$ Record remaining changes to this ' +'$$ , skip remaining changes and files' +'$$ Record changes to all remaining files' +'$$ , recording no changes' +'$$ &? (display help)'), +'revert': _('[Ynesfdaq?]' +'$$ , revert this change' +'$$ , skip this change' +'$$ this change manually' +'$$ remaining changes to this file' +'$$ Revert remaining changes to this ' +'$$ , skip remaining changes and files' +'$$ Revert changes to all remaining files' +
D957: test-push-race: use 'ui.atexit' instead of python's 'atexit'.
singhsrb updated this revision to Diff 2472. singhsrb added a comment. Removing the full-stop at the end of commit message. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D957?vs=2471=2472 BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D957 AFFECTED FILES tests/test-push-race.t CHANGE DETAILS diff --git a/tests/test-push-race.t b/tests/test-push-race.t --- a/tests/test-push-race.t +++ b/tests/test-push-race.t @@ -15,7 +15,6 @@ > Client with the extensions will create a file when ready and get stuck until > a file is created.""" > - > import atexit > import errno > import os > import time @@ -51,7 +50,7 @@ > except OSError as exc: > if exc.errno != errno.ENOENT: > raise - > atexit.register(delete) + > ui.atexit(delete) > return orig(pushop) > > def uisetup(ui): To: singhsrb, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D957: test-push-race: use 'ui.atexit' instead of python's 'atexit'.
singhsrb created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 'atexit' is sometimes not called (like when a process is killed by the SIGTERM signal). Therefore, this commit replaces it with 'ui.atexit' which is always called. This also makes the test compatible with chg. TEST PLAN Ran the test 'test-push-race.t' with and without the '--chg' option. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D957 AFFECTED FILES tests/test-push-race.t CHANGE DETAILS diff --git a/tests/test-push-race.t b/tests/test-push-race.t --- a/tests/test-push-race.t +++ b/tests/test-push-race.t @@ -15,7 +15,6 @@ > Client with the extensions will create a file when ready and get stuck until > a file is created.""" > - > import atexit > import errno > import os > import time @@ -51,7 +50,7 @@ > except OSError as exc: > if exc.errno != errno.ENOENT: > raise - > atexit.register(delete) + > ui.atexit(delete) > return orig(pushop) > > def uisetup(ui): To: singhsrb, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: rfc for a change in an error message (cross branch dirty update)
Thanks Denis, I see I was late to the party. Maybe, once "experimental.updatecheck=noconflict" stabilizes, we could suggest "--merge" only if it is not going to cause a conflict. On 10/05/2017 09:39 AM, Denis Laxalde wrote: muxator via Mercurial-devel a écrit : # HG changeset patch # User muxator # Date 1507151594 -7200 # Wed Oct 04 23:13:14 2017 +0200 # Node ID fb134b55bce708f567cb4f32c0d96bb032c2651c # Parent c67db5dc131d0facdfdadc8c3344a8f3e689867d ux: propose "hg update --merge" in the error message of a nonlinear dirty update For the record, this has been proposed previously when the option got introduced. See https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-February/093128.html (follow replies for the rationale). When trying an "hg update" of a dirty working copy across branches, mercurial protects the user aborting with: abort: uncommitted changes (commit or update --clean to discard changes) Since mercurial 4.2, however, it is possible to perform such updates invoking "hg up --merge", but this is not signaled in the error message. Only for these type of updates, this commit modifies the hint after the error message to: abort: uncommitted changes (commit or update --merge to merge the changes. To discard the changes, update --clean) The case in which the update is aborted due to conflicting changes keeps printing the old error message: abort: conflicting changes (commit or update --clean to discard changes) diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1615,7 +1615,7 @@ pass # allow updating to successors else: msg = _("uncommitted changes") - hint = _("commit or update --clean to discard changes") + hint = _("commit or update --merge to merge the changes. To discard the changes, update --clean") raise error.UpdateAbort(msg, hint=hint) else: # Allow jumping branches if clean and specific rev given diff --git a/tests/test-merge5.t b/tests/test-merge5.t --- a/tests/test-merge5.t +++ b/tests/test-merge5.t @@ -26,7 +26,7 @@ $ hg update 1 abort: uncommitted changes - (commit or update --clean to discard changes) + (commit or update --merge to merge the changes. To discard the changes, update --clean) [255] $ mv c a [...] the same for the other tests (where applies: not for the "conflicting changes" case) [...] ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D956: test-annotate: fix up expected output for pure
This revision was automatically updated to reflect the committed changes. Closed by commit rHG323bed58cf57: test-annotate: fix up expected output for pure (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D956?vs=2469=2470 REVISION DETAIL https://phab.mercurial-scm.org/D956 AFFECTED FILES tests/test-annotate.t CHANGE DETAILS diff --git a/tests/test-annotate.t b/tests/test-annotate.t --- a/tests/test-annotate.t +++ b/tests/test-annotate.t @@ -261,8 +261,8 @@ $ hg annotate -nlf b --skip 6 0 a:1: a - 0 a:1: z (pure !) - 1 a:2* z + 1 a:2* z (no-pure !) + 0 a:1* z (pure !) 1 a:3: a 3 b:4: b4 4 b:5: c To: durin42, #hg-reviewers, krbullock Cc: krbullock, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D956: test-annotate: fix up expected output for pure
krbullock added a comment. Sure, queued. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D956 To: durin42, #hg-reviewers Cc: krbullock, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D943: chg: move only first time relevant if condition out of loop
quark added a comment. I think the general rule of extracting one-time condition to outside a loop is correct. But the `i == 0` check may be subject to change - if we do want to support `hg -R ... serve` for example, `i == 0` may be changed to `iscmdname` or something. And this diff would make that change harder. Maybe we can change `i == 0` to `iscmdname` now and leave some TODO notes about `iscmdname` to clarify the intention and current defect. Performance-wise I'd expect compiler to do smart things. Unfortunately it seems gcc and clang are not that smart as of today. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D943 To: singhsrb, #hg-reviewers, yuja Cc: yuja, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D956: test-annotate: fix up expected output for pure
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is just a side effect of surfacing the "revisions were skipped" state in the blame output. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D956 AFFECTED FILES tests/test-annotate.t CHANGE DETAILS diff --git a/tests/test-annotate.t b/tests/test-annotate.t --- a/tests/test-annotate.t +++ b/tests/test-annotate.t @@ -261,8 +261,8 @@ $ hg annotate -nlf b --skip 6 0 a:1: a - 0 a:1: z (pure !) - 1 a:2* z + 1 a:2* z (no-pure !) + 0 a:1* z (pure !) 1 a:3: a 3 b:4: b4 4 b:5: c To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D943: chg: move only first time relevant if condition out of loop
singhsrb added a comment. Just to be clear: this change was also for readability apart from performance improvement. I personally prefer conditional code inside the loops to not keep checking if its the first or last iteration because then one can say that `the loop checks for conditions A, B and so on in each iteration` rather than `the loops checks for condition A, B and so on in each iteration but also checks for C in first iteration`. But in the end, its just a subjective personal preference more than anything else. So, I am happy to revert to the old code if you guys feel so :). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D943 To: singhsrb, #hg-reviewers, yuja Cc: yuja, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D934: rebase: add an experimental.showhashchanges config to show hash changes
quark added a comment. I'm trying to write a version that decouples the rendering logic from the data. But it's trickier than I thought (ex. issue5699). I guess some refactoring needs to be done. Meanwhile I think it would be good enough if you can avoid passing `fm` around. INLINE COMMENTS > rebase.py:556 > +fm = None > +if repo.ui.configbool('experimental', 'showhashchanges'): > +fm = repo.ui.formatter('rebase', opts) I think it's unnecessary to have a config option - there is no behavior change if users use rebase as before. > rebase.py:560 > clearrebased(ui, repo, self.destmap, self.state, self.skipped, > - collapsedas, self.keepf) > + collapsedas, self.keepf, fm=fm) > + Instead of passing `fm` around, it would be cleaner if the content could be generated, like: # "fm" is not passed elsewhere with ui.formatter('rebase', opts) as fm: fm.startitem() fm.data(nodechanges=calculatenodechanges(mapping)) (`node` seems to be more consistent with existing terms than `hash`) But this might be difficult without the `args` templatekeywords context. > test-rebase-base.t:418 > > +Enabling obsolete markers > + The `-base.t` test was intended for testing `--base` flag. We probably want a new `.t` file like `test-rebase-templates.t`. > test-rebase-base.t:462 > + $ hg rebase -s 8 -d 2 -T '{hashchanges|json}' -q > + {"38bd5f90ba6a": ["28cb79571ec7"], "583565ab89ac": ["89a178738706"]} > (no-eol) > + For JSON output, it's usually for automation and better to use full hashes. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D934 To: pulkit, #hg-reviewers Cc: quark, dlax, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D943: chg: move only first time relevant if condition out of loop
singhsrb updated this revision to Diff 2468. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D943?vs=2441=2468 REVISION DETAIL https://phab.mercurial-scm.org/D943 AFFECTED FILES contrib/chg/chg.c CHANGE DETAILS diff --git a/contrib/chg/chg.c b/contrib/chg/chg.c --- a/contrib/chg/chg.c +++ b/contrib/chg/chg.c @@ -372,14 +372,21 @@ TIME = 4, }; unsigned int state = 0; - int i; - for (i = 0; i < argc; ++i) { + int i = 0; + + if (argc > 0) { + const char *const firstarg = argv[i]; + if (strcmp("serve", firstarg) == 0) { + state |= SERVE; + ++i; + } + } + + for (; i < argc; ++i) { if (strcmp(argv[i], "--") == 0) break; - if (i == 0 && strcmp("serve", argv[i]) == 0) - state |= SERVE; - else if (strcmp("-d", argv[i]) == 0 || -strcmp("--daemon", argv[i]) == 0) + if (strcmp("-d", argv[i]) == 0 || + strcmp("--daemon", argv[i]) == 0) state |= DAEMON; else if (strcmp("--time", argv[i]) == 0) state |= TIME; To: singhsrb, #hg-reviewers, yuja Cc: yuja, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Welcome new reviewers!
At the 4.4 sprint, the steering committee extended the following offers of reviewer status, which were accepted: Anton Shestakov> has reviewer access for hgweb Ryan McElroy > has general reviewer access Also, we've granted reviewer Gregory Szorc full committer status, bringing us to a total of 5 full committers. As before, we're hoping to hand out more reviewer and committer bits, so even if you don't have the ability to push please consider spending time on reviews. It helps the reviewers we already have, and it's the only way we have for the steering committee to get a good idea of whom we can trust with more access. Thanks! Augie on behalf of the steering committee signature.asc Description: Message signed with OpenPGP ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D934: rebase: add an experimental.showhashchanges config to show hash changes
durin42 added a comment. In https://phab.mercurial-scm.org/D934#15995, @pulkit wrote: > In https://phab.mercurial-scm.org/D934#15939, @durin42 wrote: > > > I see what it does, but why? What's the motivation for the feature? > > > It's for automation and helping editors such as Nuclide. Could you please put that in the commit message? I wonder if we could make this stuff that was just --verbose output for rebase, and always put it in the json output (-Tjson) via the formatter, and not require a config. What do you think of taht approach? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D934 To: pulkit, #hg-reviewers Cc: dlax, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D934: rebase: add an experimental.showhashchanges config to show hash changes
pulkit added a comment. In https://phab.mercurial-scm.org/D934#15939, @durin42 wrote: > I see what it does, but why? What's the motivation for the feature? It's for automation and helping editors such as Nuclide. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D934 To: pulkit, #hg-reviewers Cc: dlax, durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D955: merge: improve comments in mergestate._makerecords
ryanmce accepted this revision. ryanmce added a comment. so good! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D955 To: mbthomas, #hg-reviewers, ryanmce Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D861: commands: tidy up merge state decoding in resolve
ryanmce accepted this revision. ryanmce added a comment. nice! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D861 To: mbthomas, #hg-reviewers, dlax, ryanmce Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D787: tests: add test for path conflicts during merge
ryanmce accepted this revision. ryanmce added a comment. lgtmacro REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D787 To: mbthomas, #hg-reviewers, swhitaker, ryanmce Cc: ryanmce, swhitaker, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D785: context: also consider path conflicts when clearing unknown files
ryanmce accepted this revision. ryanmce added a comment. Updated version looks good to me REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D785 To: mbthomas, #hg-reviewers, ryanmce Cc: ryanmce, kiilerix, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D784: merge: check for path conflicts when merging (issue5628)
ryanmce added inline comments. INLINE COMMENTS > merge.py:927 > +if p not in deletedfiles: > +ctxname = str(wctx).rstrip('+') > +pnew = util.safename(p, ctxname, wctx, set(actions.keys())) nit: worth a comment as to why we strip the + REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D784 To: mbthomas, #hg-reviewers, ryanmce Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D785: context: also consider path conflicts when clearing unknown files
mbthomas marked 2 inline comments as done. mbthomas added inline comments. INLINE COMMENTS > mbthomas wrote in test-pathconflicts-basic.t:38 > I will strip the `+` characters. I didn't know these caused problems on > Windows. Now stripping '+' symbols in https://phab.mercurial-scm.org/D784. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D785 To: mbthomas, #hg-reviewers Cc: kiilerix, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D784: merge: check for path conflicts when merging (issue5628)
ryanmce accepted this revision. ryanmce added a comment. I'm so excited by these improvements. one nit inline but this is such an improvement! INLINE COMMENTS > mbthomas wrote in merge.py:903-921 > This is potentially slow for large repos, as it has to iterate over the whole > manifest. > > What I actually want to do is find the files in the directories named by > `remoteconflicts`, which should be a small set, however I can't see a way to > do that with the manifest API. Suggestions for improvement welcome. Correct is more important. In a future with treemanifest, I could see some potential optimization opportunities. We may consider experimenting with them inside of treemanifest and upstream the results if this turns out to be a performance concern in very large repos in the wild. > merge.py:952 > +for p in invalidconflicts: > +repo.ui.warn(_("%s: is both a file and a directory\n") % p) > +raise error.Abort(_("destination manifest contains path conflicts")) nit: we can be more precise here for clarity: repo.ui.warn(_("%s: is both a file and a directory at destination\n") % p) > test-audit-path.t:106-107 >$ hg update -Cr2 > - abort: path 'back/test' traverses symbolic link 'back' > + back: is both a file and a directory > + abort: destination manifest contains path conflicts >[255] so much better! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D784 To: mbthomas, #hg-reviewers, ryanmce Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D782: merge: improve error messages for path conflicts during update
ryanmce accepted this revision. ryanmce added a comment. still looks good after updates REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D782 To: mbthomas, #hg-reviewers, ryanmce Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D779: merge: add _checkunknowndirs function for detecting path conflicts
ryanmce accepted this revision. ryanmce added a comment. Would love to see the comment added, but the code looks good to me. INLINE COMMENTS > mbthomas wrote in merge.py:654 > As in `_checkunknownfile`, this is to avoid symlink traversal while checking > these files. > > Consider: > > $ ln -s bar foo > $ hg add foo > $ hg up > > When checking `foo/dir1/file1`, we will go through `foo` then `foo/dir1` in > this loop. The first case doesn't trigger the rule, as although `foo` is a > link, it's in the dirstate, so should have been resolved by the merge. The > second loop will dereference `foo` and look at `bar/dir1`, which we don't > want it to do. > > Doing nothing is the right thing here - we will resolve the pathconflict via > the merge resolution (there will be a `'pr'` action for this link). This should be turned into a comment in the code. It's super useful to have this concrete example so future readers don't have the same question I did here. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D779 To: mbthomas, #hg-reviewers, ryanmce Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D781: merge: check for path conflicts when updating (issue5628)
ryanmce accepted this revision. ryanmce added a comment. Still looks good. The test looks much better now! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D781 To: mbthomas, #hg-reviewers, ryanmce Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D780: merge: rename conflicts to fileconflicts in _checkunknownfiles
ryanmce accepted this revision. ryanmce added a comment. still lookin good here REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D780 To: mbthomas, #hg-reviewers, ryanmce Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D778: merge: backup conflicting directories when getting files
ryanmce accepted this revision. ryanmce added a comment. lgtm INLINE COMMENTS > kiilerix wrote in merge.py:1175 > This seems quite a bit slower. But I guess it never will happen in tight > loops? If we have to backup a lot of files, then we have lost anyway? > If we have to backup a lot of files, then we have lost anyway? I think that's essentially the case. The other option here is to always rename conflcting files/directories, but then you end up with unbounded growth in the size of backup files (either in working copy or in some other dir), so that's not really awesome either. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D778 To: mbthomas, #hg-reviewers, ryanmce Cc: kiilerix, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D777: merge: add merge action 'pr' to rename files during update
ryanmce accepted this revision. ryanmce added a comment. lgtm REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D777 To: mbthomas, #hg-reviewers, ryanmce Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@34480: 16 new changesets
16 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/80d4681150b9 changeset: 34465:80d4681150b9 user:Augie Facklerdate:Sun Oct 01 10:45:03 2017 -0400 summary: urllibcompat: new library to help abstract out some python3 urllib2 stuff https://www.mercurial-scm.org/repo/hg/rev/1232f7fa00c3 changeset: 34466:1232f7fa00c3 user:Augie Fackler date:Sun Oct 01 12:14:21 2017 -0400 summary: cleanup: use urllibcompat for renamed methods on urllib request objects https://www.mercurial-scm.org/repo/hg/rev/192f7b126ed2 changeset: 34467:192f7b126ed2 user:Augie Fackler date:Wed Oct 04 11:58:00 2017 -0400 summary: urllibcompat: move some adapters from pycompat to urllibcompat https://www.mercurial-scm.org/repo/hg/rev/7bcce17b87e8 changeset: 34468:7bcce17b87e8 user:Boris Feld date:Fri Jun 30 03:44:29 2017 +0200 summary: configitems: register the 'transplant.filter' config https://www.mercurial-scm.org/repo/hg/rev/61275d0f6157 changeset: 34469:61275d0f6157 user:Boris Feld date:Fri Jun 30 03:44:30 2017 +0200 summary: configitems: register the 'transplant.log' config https://www.mercurial-scm.org/repo/hg/rev/6567002ae87e changeset: 34470:6567002ae87e user:Boris Feld date:Fri Jun 30 03:42:37 2017 +0200 summary: configitems: register the 'histedit.defaultrev' config https://www.mercurial-scm.org/repo/hg/rev/1e37cb4da6f8 changeset: 34471:1e37cb4da6f8 user:Boris Feld date:Fri Jun 30 03:42:38 2017 +0200 summary: configitems: register the 'histedit.dropmissing' config https://www.mercurial-scm.org/repo/hg/rev/12c068377273 changeset: 34472:12c068377273 user:Boris Feld date:Fri Jun 30 03:42:39 2017 +0200 summary: configitems: register the 'histedit.linelen' config https://www.mercurial-scm.org/repo/hg/rev/a746472c3d09 changeset: 34473:a746472c3d09 user:Boris Feld date:Fri Jun 30 03:42:40 2017 +0200 summary: configitems: register the 'histedit.singletransaction' config https://www.mercurial-scm.org/repo/hg/rev/b068a87e951d changeset: 34474:b068a87e951d user:Boris Feld date:Fri Jun 30 03:41:19 2017 +0200 summary: configitems: register the 'experimental.histedit.autoverb' config https://www.mercurial-scm.org/repo/hg/rev/272b83a6b591 changeset: 34475:272b83a6b591 user:Boris Feld date:Fri Jun 30 03:41:23 2017 +0200 summary: configitems: register the 'experimental.histeditng' config https://www.mercurial-scm.org/repo/hg/rev/9d78dfc78d93 changeset: 34476:9d78dfc78d93 user:Boris Feld date:Fri Jun 30 03:43:48 2017 +0200 summary: configitems: register the 'phases.new-commit' config https://www.mercurial-scm.org/repo/hg/rev/a27718efb290 changeset: 34477:a27718efb290 user:Boris Feld date:Fri Jun 30 03:44:24 2017 +0200 summary: configitems: register the 'smtp.port' config https://www.mercurial-scm.org/repo/hg/rev/ef303daefdf7 changeset: 34478:ef303daefdf7 user:Boris Feld date:Fri Jun 30 03:39:10 2017 +0200 summary: configitems: register the 'email.from' config https://www.mercurial-scm.org/repo/hg/rev/99c3dee3f6ce changeset: 34479:99c3dee3f6ce user:Boris Feld date:Fri Jun 30 03:43:13 2017 +0200 summary: configitems: register the 'merge.preferancestor' config https://www.mercurial-scm.org/repo/hg/rev/cbda631c1dde changeset: 34480:cbda631c1dde bookmark:@ tag: tip user:Boris Feld date:Fri Jun 30 03:37:05 2017 +0200 summary: configitems: register the 'debug.dirstate.delaywrite' config -- 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
D777: merge: add merge action 'pr' to rename files during update
mbthomas added inline comments. INLINE COMMENTS > mbthomas wrote in merge.py:1461 > I had tested transitive renames after update, but not before. I'll fix it up > and add a test. Test added as `Update - local renamed file conflicts with remote directory` in https://phab.mercurial-scm.org/D786. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D777 To: mbthomas, #hg-reviewers Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 2 of 4] diff: pass down line range information from changeset_printer to patch.diff()
On Wed, 04 Oct 2017 17:04:00 +0200, Denis Laxalde wrote: > # HG changeset patch > # User Denis Laxalde> # Date 1507127862 -7200 > # Wed Oct 04 16:37:42 2017 +0200 > # Node ID f7b31d85dc0e7c7e60b85d0a7fd728a32ba210ea > # Parent 3d8ed7dafee4676b49922a3dde0edf1b1fad63ec > # Available At http://hg.logilab.org/users/dlaxalde/hg > # hg pull http://hg.logilab.org/users/dlaxalde/hg -r f7b31d85dc0e > # EXP-Topic followlines-cli > diff: pass down line range information from changeset_printer to patch.diff() > diff --git a/mercurial/patch.py b/mercurial/patch.py > --- a/mercurial/patch.py > +++ b/mercurial/patch.py > @@ -2293,7 +2293,8 @@ def difffeatureopts(ui, opts=None, untru > return mdiff.diffopts(**pycompat.strkwargs(buildopts)) > > def diff(repo, node1=None, node2=None, match=None, changes=None, > - opts=None, losedatafn=None, prefix='', relroot='', copy=None): > + opts=None, losedatafn=None, prefix='', relroot='', copy=None, > + lineranges=None): > '''yields diff of changes to files between two nodes, or node and > working directory. > > @@ -2315,11 +2316,23 @@ def diff(repo, node1=None, node2=None, m > patterns that fall outside it will be ignored. > > copy, if not empty, should contain mappings {dst@y: src@x} of copy > -information.''' > +information. > + > +lineranges, if not None, must be a mapping from filename to line range > +tuples and is used to filter diff hunks not in specified range. > +''' > for hdr, hunks in diffhunks(repo, node1=node1, node2=node2, match=match, > changes=changes, opts=opts, > losedatafn=losedatafn, prefix=prefix, > relroot=relroot, copy=copy): > +if lineranges is not None and hdr: > +fname = header(hdr).filename() Parsing header line doesn't seem right. Can we get the original filename or file ctxs instead? > +flineranges = lineranges.get(fname) > +if flineranges is not None: > +hunks = ( > +(hr, lines) for hr, lines in hunks > +if any(mdiff.hunkinrange(hr[2:], lr) for lr in > flineranges) > +) Nested iterators seems hard to read. Maybe this could be a filter function, which could optionally be an argument. i.e. diff(..., filter) instead of diff(..., lineranges). ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 4 of 4] log: add -L/--line-range option to follow file history by line range
On Wed, 04 Oct 2017 17:04:02 +0200, Denis Laxalde wrote: > # HG changeset patch > # User Denis Laxalde> # Date 1507127733 -7200 > # Wed Oct 04 16:35:33 2017 +0200 > # Node ID 0f2d8b304223a8d00163f917fdc18082a88bceae > # Parent 9274bdbba0f913672305ed3d91c7e05f38d1eab7 > # Available At http://hg.logilab.org/users/dlaxalde/hg > # hg pull http://hg.logilab.org/users/dlaxalde/hg -r 0f2d8b304223 > # EXP-Topic followlines-cli > log: add -L/--line-range option to follow file history by line range > > We add a -L/--line-range option to 'hg log' taking file patterns along with a > line range using the (new) FILE,FROMLINE-TOLINE syntax where FILE may be a > pattern (matching exactly one file). The resulting history is similar to what > the "followlines" revset except that, if --patch is specified, only diff hunks > within specified line range are shown (it's also more convenient to type). > > Basically, this brings the CLI on par with what currently only exists in hgweb > through line selection in "file" and "annotate" views resulting in a file log > with filtered patch to only display followed line range. > > The option may be specified multiple times and can be combined with --rev or > regular file pattern in a meaningful way. It also respects --follow semantics. > Only the --graph option is currently not supported. > > Some debatable UI choices (I did not think too much about this for now). > > * "," as a separator between the FILE and line range information; the idea > is to avoid confusion with file pattern syntax which uses ":". > > * "-" in the line range information may not be the best choice; in > particular, we might want to add support for an offset +/- syntax. Nit: we use ':' in revset. > The implementation spreads between commands.log() and cmdutil module. > In commands.log(), the main loop now works with tuples of (rev, matchfn, > lineranges), where 'rev' and 'matchfn' are similar to before except that > 'matchfn' is now built out the loop. Without any -L option, "lineranges" is > None. With a -L option, 'matchfn' is a new matcher function built from files > specified in -L option(s) and any other regular FILE pattern. > > The logic to build revisions from -L/--line-range options lives in > cmdutil.getloglineranges() and the resulting information is combined with > information from --rev option and file patterns in commands.log(). Options > --rev and file patterns act as restrictions to the revisions obtained by > following line-range history of files specified in -L/--line-range patterns. [...] > +def getloglineranges(repo, opts): > +"""Return a generator of tuples (rev, fpath, [line range]) obtained by > +processing "line-range" log options and walking block ancestors of each > +specified file/line-range. > +""" > +wctx = repo[None] > +follow = bool(opts.get('follow')) > +# Two-levels map of "rev -> file path -> [line range]". > +linerangesbyrev = {} > +for fname, (fromline, toline) in _parselinerangelogopt(repo, opts): > +fctx = wctx.filectx(fname) > +for fctx, linerange in dagop.blockancestors(fctx, fromline, toline): > +fpath = fctx.path() > +if not follow and fpath != fname: > +continue > +linerangesbyrev.setdefault( > +fctx.rev(), {}).setdefault( > +fpath, []).append(linerange) > +return sorted(linerangesbyrev.iteritems(), reverse=follow) --follow isn't the option to flip the order. I think --follow should be implied (or required) given how line-range works. > diff --git a/mercurial/commands.py b/mercurial/commands.py > --- a/mercurial/commands.py > +++ b/mercurial/commands.py > @@ -3230,6 +3230,8 @@ def locate(ui, repo, *pats, **opts): > ('k', 'keyword', [], > _('do case-insensitive search for a given text'), _('TEXT')), > ('r', 'rev', [], _('show the specified revision or revset'), _('REV')), > +('L', 'line-range', [], _('follow line range of specified file'), > + _('FILE,RANGE')), No idea if we like the short option -L. > +# Build an iterator of (rev, matcher, lineranges) tuples to be consumed > +# later in the main loop. > +if followlines: > +# Filter revisions from --line-range patterns from those not in --rev > +# option and combine any existing filematcher with the one built from > +# "line range" patterns. > +if filematcher is None: > +def buildmatcher(files): > +return scmutil.match(repo[None], files) > +else: > +def buildmatcher(files): > +return scmutil.match(repo[None], > + files + filematcher(None).files(), > + default='path') > +revsmatchandlineranges = ( > +(rev, buildmatcher(list(lrs)), lrs) > +for rev, lrs in linerangesbyrev if rev
D934: rebase: add an experimental.showhashchanges config to show hash changes
durin42 added a comment. I see what it does, but why? What's the motivation for the feature? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D934 To: pulkit, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D872: releasenotes: add test showing TypeError with no file specified
durin42 abandoned this revision. durin42 added a comment. was folded into https://phab.mercurial-scm.org/D877 and landed REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D872 To: durin42, #hg-reviewers, pulkit, yuja, rishabhmadan96 Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D955: merge: improve comments in mergestate._makerecords
mbthomas created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D955 AFFECTED FILES mercurial/merge.py CHANGE DETAILS diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -361,17 +361,28 @@ if self.mergedriver: records.append(('m', '\0'.join([ self.mergedriver, self._mdstate]))) -for d, v in self._state.iteritems(): +# Write out state items. In all cases, the value of the state map entry +# is written as the contents of the record. The record type depends on +# the type of state that is stored, and capital-letter records are used +# to prevent older versions of Mercurial that do not support the feature +# from loading them. +for filename, v in self._state.iteritems(): if v[0] == 'd': -records.append(('D', '\0'.join([d] + v))) +# Driver-resolved merge. These are stored in 'D' records. +records.append(('D', '\0'.join([filename] + v))) elif v[0] in ('pu', 'pr'): -records.append(('P', '\0'.join([d] + v))) -# v[1] == local ('cd'), v[6] == other ('dc') -- not supported by -# older versions of Mercurial +# Path conflicts. These are stored in 'P' records. The current +# resolution state ('pu' or 'pr') is stored within the record. +records.append(('P', '\0'.join([filename] + v))) elif v[1] == nullhex or v[6] == nullhex: -records.append(('C', '\0'.join([d] + v))) +# Change/Delete or Delete/Change conflicts. These are stored in +# 'C' records. v[1] is the local file, and is nullhex when the +# file is deleted locally ('dc'). v[6] is the remote file, and +# is nullhex when the file is deleted remotely ('cd'). +records.append(('C', '\0'.join([filename] + v))) else: -records.append(('F', '\0'.join([d] + v))) +# Normal files. These are stored in 'F' records. +records.append(('F', '\0'.join([filename] + v))) for filename, extras in sorted(self._stateextras.iteritems()): rawextras = '\0'.join('%s\0%s' % (k, v) for k, v in extras.iteritems()) To: mbthomas, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D942: histedit: removing the experimental config 'histeditng'
durin42 requested changes to this revision. durin42 added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > quark wrote in histedit.py:796 > You can use the decorator here: > > @action() > > just like line 819. Please do this, then I think you're good to go. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D942 To: singhsrb, #hg-reviewers, quark, durin42 Cc: durin42, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D776: merge: add merge action 'p' to record path conflicts during update
ryanmce accepted this revision. ryanmce added a comment. lgtm REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D776 To: mbthomas, #hg-reviewers, ryanmce Cc: ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D774: merge: add pathconflict merge state
ryanmce accepted this revision. ryanmce added a comment. lgtm INLINE COMMENTS > mbthomas wrote in merge.py:364-365 > This could use some improvement in general, so I'll write some comments on > how this function works as a follow-up patch. that works for me > mbthomas wrote in merge.py:434 > I named it `addpath` for symmetry with `add`. The merge state stores > conflicts, so it seems superfluous to have it in the name. makes sense > kiilerix wrote in merge.py:88 > Some of this is adding documentation for existing functionality? It could be > nice to have this changeset show exactly what it is adding. I'm not sure it makes sense to split out a one line comment addition into a separate patch -- but will let a more experienced reviewer make the call here. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D774 To: mbthomas, #hg-reviewers, ryanmce Cc: kiilerix, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D774: merge: add pathconflict merge state
mbthomas added inline comments. INLINE COMMENTS > ryanmce wrote in merge.py:364-365 > Even though there's not a lot of good comments here, now, could you add some > when you modify this? > > Something like "if the state includes a path conflict (pu or pr), include a > Path (P) record which " (I don't know what to write here -- why don't we > need to distinguish between pu and pr in the record? A reader should not have > to figure this out on their own, ideally. This could use some improvement in general, so I'll write some comments on how this function works as a follow-up patch. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D774 To: mbthomas, #hg-reviewers, ryanmce Cc: kiilerix, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@34464: 3 new changesets
3 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/8337f7772aa2 changeset: 34462:8337f7772aa2 user:Gregory Szorcdate:Sun Oct 01 23:47:16 2017 +0100 summary: fsmonitor: access copymap in new location https://www.mercurial-scm.org/repo/hg/rev/718f7acd6d5e changeset: 34463:718f7acd6d5e user:Gregory Szorc date:Sun Oct 01 22:26:24 2017 +0100 summary: fsmonitor: use configitem https://www.mercurial-scm.org/repo/hg/rev/b0910102e495 changeset: 34464:b0910102e495 tag: tip user:Saurabh Singh date:Wed Oct 04 10:42:55 2017 -0700 summary: test-devel-warnings: make the test compatible with chg -- 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
D886: ui: convert to/from Optional[bytes] to Optional[str] in password manager
This revision was automatically updated to reflect the committed changes. Closed by commit rHG75de5d456b60: ui: convert to/from Optional[bytes] to Optional[str] in password manager (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D886?vs=2421=2461 REVISION DETAIL https://phab.mercurial-scm.org/D886 AFFECTED FILES mercurial/ui.py CHANGE DETAILS diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -135,6 +135,15 @@ """, } +def _maybestrurl(maybebytes): +if maybebytes is None: +return None +return pycompat.strurl(maybebytes) + +def _maybebytesurl(maybestr): +if maybestr is None: +return None +return pycompat.bytesurl(maybestr) class httppasswordmgrdbproxy(object): """Delays loading urllib2 until it's needed.""" @@ -147,10 +156,18 @@ return self._mgr def add_password(self, realm, uris, user, passwd): -return self._get_mgr().add_password(realm, uris, user, passwd) +if isinstance(uris, tuple): +uris = tuple(_maybestrurl(u) for u in uris) +else: +uris = _maybestrurl(uris) +return self._get_mgr().add_password( +_maybestrurl(realm), uris, +_maybestrurl(user), _maybestrurl(passwd)) def find_user_password(self, realm, uri): -return self._get_mgr().find_user_password(realm, uri) +return tuple(_maybebytesurl(v) for v in + self._get_mgr().find_user_password(_maybestrurl(realm), +_maybestrurl(uri))) def _catchterm(*args): raise error.SignalInterrupt To: durin42, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D912: test-alias: make it compatible with chg
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa8a9c0d3232b: test-alias: make it compatible with chg (authored by quark, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D912?vs=2452=2462 REVISION DETAIL https://phab.mercurial-scm.org/D912 AFFECTED FILES tests/test-alias.t CHANGE DETAILS diff --git a/tests/test-alias.t b/tests/test-alias.t --- a/tests/test-alias.t +++ b/tests/test-alias.t @@ -527,21 +527,29 @@ environment variable changes in alias commands - $ cat > $TESTTMP/setcount.py < $TESTTMP/expandalias.py < import os - > def uisetup(ui): + > from mercurial import cmdutil, commands, registrar + > cmdtable = {} + > command = registrar.command(cmdtable) + > @command('expandalias') + > def expandalias(ui, repo, name): + > alias = cmdutil.findcmd(name, commands.table)[1][0] + > ui.write('%s args: %s\n' % (name, ' '.join(alias.args))) > os.environ['COUNT'] = '2' + > ui.write('%s args: %s (with COUNT=2)\n' % (name, ' '.join(alias.args))) > EOF $ cat >> $HGRCPATH <<'EOF' > [extensions] - > setcount = $TESTTMP/setcount.py + > expandalias = $TESTTMP/expandalias.py > [alias] - > showcount = log -T "$COUNT\n" -r . + > showcount = log -T "$COUNT" -r . > EOF - $ COUNT=1 hg showcount - 2 + $ COUNT=1 hg expandalias showcount + showcount args: -T 1 -r . + showcount args: -T 2 -r . (with COUNT=2) This should show id: To: quark, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D917: eol: make [eol] config section sensitive for chg confighash
This revision was automatically updated to reflect the committed changes. Closed by commit rHG37b7581e5737: eol: make [eol] config section sensitive for chg confighash (authored by quark, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D917?vs=2453=2463 REVISION DETAIL https://phab.mercurial-scm.org/D917 AFFECTED FILES mercurial/chgserver.py CHANGE DETAILS diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py --- a/mercurial/chgserver.py +++ b/mercurial/chgserver.py @@ -68,6 +68,7 @@ # sensitive config sections affecting confighash _configsections = [ 'alias', # affects global state commands.table +'eol',# uses setconfig('eol', ...) 'extdiff', # uisetup will register new commands 'extensions', ] To: quark, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D946: serve: make tests compatible with chg
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa6d95a8b7243: serve: make tests compatible with chg (authored by singhsrb, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D946?vs=2447=2460#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D946?vs=2447=2460 REVISION DETAIL https://phab.mercurial-scm.org/D946 AFFECTED FILES tests/test-bundle2-exchange.t tests/test-clone-uncompressed.t tests/test-hgweb-csp.t tests/test-http-bad-server.t tests/test-http-bundle1.t tests/test-http-protocol.t tests/test-http.t CHANGE DETAILS diff --git a/tests/test-http.t b/tests/test-http.t --- a/tests/test-http.t +++ b/tests/test-http.t @@ -345,7 +345,7 @@ check abort error reporting while pulling/cloning $ $RUNTESTDIR/killdaemons.py - $ hg -R test serve -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py + $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py $ cat hg3.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ abort-clone requesting all changes @@ -356,7 +356,7 @@ disable pull-based clones - $ hg -R test serve -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True + $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True $ cat hg4.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT1/ disable-pull-clone requesting all changes diff --git a/tests/test-http-protocol.t b/tests/test-http-protocol.t --- a/tests/test-http-protocol.t +++ b/tests/test-http-protocol.t @@ -10,7 +10,7 @@ $ hg -q commit -A -m initial $ cd .. - $ hg -R server serve -p $HGPORT -d --pid-file hg.pid + $ hg serve -R server -p $HGPORT -d --pid-file hg.pid $ cat hg.pid >> $DAEMON_PIDS compression formats are advertised in compression capability @@ -25,23 +25,23 @@ server.compressionengines can replace engines list wholesale - $ hg --config server.compressionengines=none -R server serve -p $HGPORT -d --pid-file hg.pid + $ hg serve --config server.compressionengines=none -R server -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none$' > /dev/null $ killdaemons.py Order of engines can also change - $ hg --config server.compressionengines=none,zlib -R server serve -p $HGPORT -d --pid-file hg.pid + $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=capabilities' | tr ' ' '\n' | grep '^compression=none,zlib$' > /dev/null $ killdaemons.py Start a default server again - $ hg -R server serve -p $HGPORT -d --pid-file hg.pid + $ hg serve -R server -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS Server should send application/mercurial-0.1 to clients if no Accept is used @@ -113,7 +113,7 @@ Now test protocol preference usage $ killdaemons.py - $ hg --config server.compressionengines=none,zlib -R server serve -p $HGPORT -d --pid-file hg.pid + $ hg serve --config server.compressionengines=none,zlib -R server -p $HGPORT -d --pid-file hg.pid $ cat hg.pid > $DAEMON_PIDS No Accept will send 0.1+zlib, even though "none" is preferred b/c "none" isn't supported on 0.1 diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t --- a/tests/test-http-bundle1.t +++ b/tests/test-http-bundle1.t @@ -357,7 +357,7 @@ Check error reporting while pulling/cloning $ $RUNTESTDIR/killdaemons.py - $ hg -R test serve -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py + $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py $ cat hg3.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT/ abort-clone requesting all changes @@ -368,7 +368,7 @@ disable pull-based clones - $ hg -R test serve -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True + $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True $ cat hg4.pid >> $DAEMON_PIDS $ hg clone http://localhost:$HGPORT1/ disable-pull-clone requesting all changes 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 @@ -32,7 +32,7 @@ Failure to accept() socket should result in connection related error message - $ hg --config badserver.closebeforeaccept=true serve -p $HGPORT -d --pid-file=hg.pid + $ hg serve --config badserver.closebeforeaccept=true -p $HGPORT -d --pid-file=hg.pid $ cat hg.pid > $DAEMON_PIDS $ hg
D943: chg: move only first time relevant if condition out of loop
yuja added subscribers: quark, yuja. yuja requested changes to this revision. yuja added a comment. This revision now requires changes to proceed. I prefer the original code since it looks simpler and there wouldn't be measurable performance win. @quark which do you like? INLINE COMMENTS > chg.c:388 > break; > - if (i == 0 && strcmp("serve", argv[i]) == 0) > - state |= SERVE; > - else if (strcmp("-d", argv[i]) == 0 || > - strcmp("--daemon", argv[i]) == 0) > + if (strcmp("-d", argv[i]) == 0 || strcmp("--daemon", argv[i]) > == 0) > state |= DAEMON; Nit: this line is over 80 chars. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D943 To: singhsrb, #hg-reviewers, yuja Cc: yuja, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D954: style: never use a space before a colon or comma
alex_gaynor created this revision. alex_gaynor added a reviewer: durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial BRANCH style-fixes (bookmark) on default (branch) REVISION DETAIL https://phab.mercurial-scm.org/D954 AFFECTED FILES mercurial/color.py mercurial/commandserver.py mercurial/dispatch.py mercurial/hgweb/hgwebdir_mod.py mercurial/hgweb/wsgicgi.py mercurial/httppeer.py mercurial/merge.py mercurial/progress.py CHANGE DETAILS diff --git a/mercurial/progress.py b/mercurial/progress.py --- a/mercurial/progress.py +++ b/mercurial/progress.py @@ -174,7 +174,7 @@ amt -= progwidth bar = (' ' * int(progwidth - abs(amt)) + '<=>' + ' ' * int(abs(amt))) -prog = ''.join(('[', bar , ']')) +prog = ''.join(('[', bar, ']')) out = spacejoin(head, prog, tail) else: out = spacejoin(head, tail) diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -419,7 +419,7 @@ fca.path(), hex(fca.filenode()), fco.path(), hex(fco.filenode()), fcl.flags()] -self._stateextras[fd] = { 'ancestorlinknode' : hex(fca.node()) } +self._stateextras[fd] = {'ancestorlinknode': hex(fca.node())} self._dirty = True def __contains__(self, dfile): @@ -864,7 +864,7 @@ fla = ma.flags(f) nol = 'l' not in fl1 + fl2 + fla if n2 == a and fl2 == fla: -actions[f] = ('k' , (), "remote unchanged") +actions[f] = ('k', (), "remote unchanged") elif n1 == a and fl1 == fla: # local unchanged - use remote if n1 == n2: # optimization: keep local content actions[f] = ('e', (fl2,), "update permissions") diff --git a/mercurial/httppeer.py b/mercurial/httppeer.py --- a/mercurial/httppeer.py +++ b/mercurial/httppeer.py @@ -151,7 +151,7 @@ if urlopener: for h in urlopener.handlers: h.close() -getattr(h, "close_all", lambda : None)() +getattr(h, "close_all", lambda: None)() # Begin of _basepeer interface. diff --git a/mercurial/hgweb/wsgicgi.py b/mercurial/hgweb/wsgicgi.py --- a/mercurial/hgweb/wsgicgi.py +++ b/mercurial/hgweb/wsgicgi.py @@ -87,4 +87,4 @@ if not headers_sent: write('') # send headers now if body was empty finally: -getattr(content, 'close', lambda : None)() +getattr(content, 'close', lambda: None)() diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -320,7 +320,7 @@ for typ, spec in hgweb_mod.archivespecs.iteritems(): if typ in allowed or ui.configbool("web", "allow" + typ, untrusted=True): -archives.append({"type" : typ, "extension": spec[2], +archives.append({"type": typ, "extension": spec[2], "node": nodeid, "url": url}) return archives diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -243,10 +243,10 @@ try: debugger = 'pdb' debugtrace = { -'pdb' : pdb.set_trace +'pdb': pdb.set_trace } debugmortem = { -'pdb' : pdb.post_mortem +'pdb': pdb.post_mortem } # read --config before doing anything else diff --git a/mercurial/commandserver.py b/mercurial/commandserver.py --- a/mercurial/commandserver.py +++ b/mercurial/commandserver.py @@ -272,8 +272,8 @@ return cmd != '' -capabilities = {'runcommand' : runcommand, -'getencoding' : getencoding} +capabilities = {'runcommand': runcommand, +'getencoding': getencoding} def serve(self): hellomsg = 'capabilities: ' + ' '.join(sorted(self.capabilities)) diff --git a/mercurial/color.py b/mercurial/color.py --- a/mercurial/color.py +++ b/mercurial/color.py @@ -95,9 +95,9 @@ 'diff.inserted': 'green', 'diff.tab': '', 'diff.trailingwhitespace': 'bold red_background', -'changeset.public' : '', -'changeset.draft' : '', -'changeset.secret' : '', +'changeset.public': '', +'changeset.draft': '', +'changeset.secret': '', 'diffstat.deleted': 'red', 'diffstat.inserted': 'green', 'histedit.remaining': 'red bold', To: alex_gaynor, durin42, #hg-reviewers Cc: mercurial-devel, spectral ___ Mercurial-devel mailing list
D680: scmutil: handle conflicting files and dirs in origbackuppath
ryanmce accepted this revision. ryanmce added a comment. It looks like all concerns have been addressed. This looks good to me. INLINE COMMENTS > mbthomas wrote in scmutil.py:570 > At this point the path is a vfs-path within the repo, so it should be using > `/` as a separator. > > In the case of UNC paths, `os.path.relpath` seems to do the right thing, so > `os.path.relpath(r'\\?\c:\repo\dir\file', r'\\?\c:\repo')` gives `dir\file`, > which `util.normpath` converts to `dir/file`. > > It's a bit of a shame that `scmutil.origpath` takes an absolute path rather > than a vfs path within the repo, as it means we have to jump through these > hoops. It doesn't look like we can easily change it, though. I agree that it seems out of scope to fix this in this patch series. Might be worth opening a task in bugzilla to track improving this, but I think this series is already fairly long and too important to hold up on a small thing like this. Since it works, I think we should move towards shipping it. > yuja wrote in scmutil.py:574 > It shouldn't delete files out of the origbackuppath directory > even if the configured path points to (or under) a file. > > Maybe we could use a new vfs dedicated to backup directory to > audit operations. @mbthomas and I had talked about adding a new vfs; thanks for pushing us in that direction. Getting a dedicated vfs feels like a good win here. > scmutil.py:582-585 > +origvfs = vfs.vfs(repo.wjoin(origbackuppath)) > +origbackupdir = origvfs.dirname(filepathfromroot) > +if not origvfs.isdir(origbackupdir) or origvfs.islink(origbackupdir): > +ui.note(_('creating directory: %s\n') % origvfs.join(origbackupdir)) In the future, we may want to move this to the repo class like other `vfs` instances. That will mean we don't have to re-instantiate this each time. However, these instantiations look cheap so I'm not worried and it's outside the scope of this change. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D680 To: mbthomas, ryanmce, #hg-reviewers, durham, yuja, ikostia Cc: kiilerix, quark, ikostia, yuja, durham, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D886: ui: convert to/from Optional[bytes] to Optional[str] in password manager
yuja accepted this revision. yuja added a comment. This revision is now accepted and ready to land. Queued, thanks. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D886 To: durin42, #hg-reviewers, yuja Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 7 of 7] extdata: abort if external command exits with non-zero status
On Wed, 04 Oct 2017 18:25:41 +0100, FUJIWARA Katsunori wrote: > At Tue, 3 Oct 2017 22:22:52 +0900, > Yuya Nishihara wrote: > > > > On Sun, 01 Oct 2017 17:15:06 +0100, FUJIWARA Katsunori wrote: > > > At Sun, 01 Oct 2017 13:00:18 +0100, > > > Yuya Nishihara wrote: > > > > > > > > # HG changeset patch > > > > # User Yuya Nishihara> > > > # Date 1506856910 -3600 > > > > # Sun Oct 01 12:21:50 2017 +0100 > > > > # Node ID 86c51cf6c4ff8a9a01e34e365c8fbc50415d072e > > > > # Parent b3a36705720f5ed1e7cc5129b27450ca59c7952b > > > > extdata: abort if external command exits with non-zero status > > > > > > > > It could be a warning, but a warning in template output would be > > > > unreadable. > > > > > > > diff --git a/tests/test-extdata.t b/tests/test-extdata.t > > > > --- a/tests/test-extdata.t > > > > +++ b/tests/test-extdata.t > > > > @@ -12,6 +12,7 @@ test revset support > > > >> filedata = file:extdata.txt > > > >> notes = notes.txt > > > >> shelldata = shell:cat extdata.txt | grep 2 > > > > > > Just nit: > > > > > > I sometime forget that filtering by grep might cause non-zero exit > > > code. So, hint like "use `| grep PATTERN | cat` to allow empty > > > external data" or so will prevent me from falling into a pitfall in > > > the future :-) > > > > Good catch. So it might not be ideal to check the exit code by default. > > But it is also fact that "abort at non-zero exit code" itself is > reasonable for consistency, because validity of external data isn't > ensured at "non-zero exit code". > > Therefore, let's write document with an explanation like > "unintentional failure with grep" (in the future) ! :-) > > (or does we need another "ignore exist code of shell command" scheme > other than "shell:" ?) encode/decode filters? I'm not sure if which will be better. For grep, erroring out is inconvenient, but for curl, non-zero status should be detected. However, the latter isn't possible if an error is ignored at all. So I lean towards raising Abort in such case. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 6] configitems: register the 'histedit.defaultrev' config
On Wed, 04 Oct 2017 15:54:06 +0200, Boris Feld wrote: > # HG changeset patch > # User Boris Feld> # Date 1498786957 -7200 > # Fri Jun 30 03:42:37 2017 +0200 > # Node ID a1d86c040bd28d7f96e107d55e7a0cdda2bd63ec > # Parent 2fd06499dc8e6a5a784b1334b925c289d7b54e4e > # EXP-Topic config.register.histedit > configitems: register the 'histedit.defaultrev' config Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 2] configitems: register the 'transplant.filter' config
On Wed, 04 Oct 2017 15:43:20 +0200, Boris Feld wrote: > # HG changeset patch > # User Boris Feld> # Date 1498787069 -7200 > # Fri Jun 30 03:44:29 2017 +0200 > # Node ID 3d3e64d40c3a32fc7ada6c00ee56da35bf992651 > # Parent 2fd06499dc8e6a5a784b1334b925c289d7b54e4e > # EXP-Topic config.register.transplant > configitems: register the 'transplant.filter' config Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH stable] tests: invoke run-tests.py in test-hghave using $PYTHON (issue5697)
On Wed, 04 Oct 2017 09:04:59 -0400, Augie Fackler wrote: > # HG changeset patch > # User Augie Fackler> # Date 1507122292 14400 > # Wed Oct 04 09:04:52 2017 -0400 > # Branch stable > # Node ID bb14dbab4df63306e702b9b26d0e2377bce82bb2 > # Parent c74d6d870073d8d0d773fb197a9429d33affc63a > tests: invoke run-tests.py in test-hghave using $PYTHON (issue5697) Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D937: remotenames: move function to pull remotenames from the remoterepo to core
pulkit added a comment. In https://phab.mercurial-scm.org/D937#15824, @dlax wrote: > Also, it'd be useful to indicate where the code comes from (i.e. what is the "remoterepo" mentioned in the first line of the commit message). Yeah sure I will add that in next version. > Then, a module docstring explaining the concept at stake (starting by what is a "remotename") and the purpose of the extension would be really nice as a first step. The hgremotenames (https://bitbucket.org/seanfarley/hgremotenames/src) extension has very good module docstring which I plan to import once I ported enough functionality. If will port it just now, it will be like "it does not do what it says". Or I need to split up the docstring and to port some bit of it with each functionality added. And to mention, this is not an extension. This functionality is moving directly to core to improve bookmarks. INLINE COMMENTS > dlax wrote in remotenames.py:28 > I don't get the point of the function as it is in this patch. First it does > not do what the docstring says. Then it does not return anything nor does it > change any "state". Yeah I agree with you. This series is porting things from hgremotenames extension to core. The extension has all these functionality which I tried breaking up in individual pieces and send as patches. I will try to improve the ordering of how things are introduced in the next version of this series. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D937 To: pulkit, #hg-reviewers, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D933: scmutil: add a new function to show changes after a command
dlax accepted this revision. dlax added a comment. This patch looks good to me. But I have no idea if the overall idea in the series is good or not. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D933 To: pulkit, #hg-reviewers, dlax Cc: dlax, quark, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D933: scmutil: add a new function to show changes after a command
pulkit updated this revision to Diff 2458. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D933?vs=2427=2458 REVISION DETAIL https://phab.mercurial-scm.org/D933 AFFECTED FILES mercurial/scmutil.py CHANGE DETAILS diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -685,6 +685,14 @@ if tostrip: repair.delayedstrip(repo.ui, repo, tostrip, operation) +def showchanges(replacements, fm): +""" output the hash changes using formatter instance which is passed. +""" +nodesdict = {short(pred): [short(s) for s in succs] + for pred, succs in replacements.iteritems()} +fm.write('hashchanges', '%s\n', + fm.formatdict(nodesdict, fmt='%r --> %r', sep='\n')) + def addremove(repo, matcher, prefix, opts=None, dry_run=None, similarity=None): if opts is None: opts = {} To: pulkit, #hg-reviewers, dlax Cc: dlax, quark, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D932: filemerge: introduce functions to halt merge flow
ryanmce added a comment. > I was initially confused by the description of this change, because the user can already halt (by configuration) after the first failed file merge. As far as I know, this is simply not true. I know of no way in mercurial, before this series, to halt a merge after the first failed file merge. If it's already there, I'm happy to be informed of it and drop this series. > But this introduces a way for them to be prompted whether to halt or continue, right? It introduces the first way that I'm aware of to halt a merge after a failed file merge. It also gives an option to prompt which also didn't exist before. > Also: What's the "next patch"? I'm not seeing it in Phabricator. I had my internet connection at the airport interrupted and was only now able to finish sending the series. Sorry about that. INLINE COMMENTS > pulkit wrote in config.txt:1248 > typo, s/half/halt Will fix. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D932 To: ryanmce, #hg-reviewers, krbullock Cc: krbullock, pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D930: merge: add tests to show current behavior on failed filemerges
ryanmce added inline comments. INLINE COMMENTS > krbullock wrote in test-merge-halt.t:24 > Why test this with rebase instead of merge? That's how I roll. That being said, I'm happy to change it if people feel testing merge would provide more value. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D930 To: ryanmce, #hg-reviewers Cc: krbullock, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D953: merge: use filemerge failure handler in post-filemerge checks checks
ryanmce created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Depends on https://phab.mercurial-scm.org/D952. This allows the user to halt the merge if conflict markers or no changes are found in the merged file as well. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D953 AFFECTED FILES mercurial/filemerge.py tests/test-merge-halt.t CHANGE DETAILS diff --git a/tests/test-merge-halt.t b/tests/test-merge-halt.t --- a/tests/test-merge-halt.t +++ b/tests/test-merge-halt.t @@ -85,7 +85,6 @@ merging b output file a appears unchanged was merge successful (yn)? n - merging a failed! merge halted after failed merge (see hg resolve) [1] @@ -118,20 +117,24 @@ merging a merging b was merge of 'a' successful (yn)? n - merging a failed! merge halted after failed merge (see hg resolve) [1] $ hg rebase --abort rebase aborted Check that a requested abort actually works + $ cat <> $HGRCPATH + > [merge] + > onfailure=prompt + > EOS $ cat < n > EOS rebasing 1:1f28a51c3c9b "c" merging a merging b merging a failed! + continue merge operation (yn)? n merge halted after failed merge (see hg resolve) [1] diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -753,6 +753,7 @@ if ui.promptchoice(_("was merge of '%s' successful (yn)?" "$$ $$ ") % fd, 1): r = 1 +_onfilemergefailure(ui) if not r and not checked and (_toolbool(ui, tool, "checkchanged") or 'changed' in @@ -762,6 +763,7 @@ "was merge successful (yn)?" "$$ $$ ") % fd, 1): r = 1 +_onfilemergefailure(ui) if back is not None and _toolbool(ui, tool, "fixeol"): _matcheol(_workingpath(repo, fcd), back) To: ryanmce, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D952: merge: additional test cases to show changing behavior
ryanmce created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Depends on https://phab.mercurial-scm.org/D951. In the next patch more cases of failed file merges will be able to halt the merge process. Add some test cases so that the failures are more obvious. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D952 AFFECTED FILES tests/test-merge-halt.t CHANGE DETAILS diff --git a/tests/test-merge-halt.t b/tests/test-merge-halt.t --- a/tests/test-merge-halt.t +++ b/tests/test-merge-halt.t @@ -73,3 +73,75 @@ $ hg rebase --abort rebase aborted +Check that successful tool with failed post-check halts the merge + $ echo onfailure=halt >> $HGRCPATH + $ cat <> $HGRCPATH + > [merge-tools] + > true.check=changed + > EOS + $ hg rebase -s 1 -d 2 --tool true + rebasing 1:1f28a51c3c9b "c" + merging a + merging b + output file a appears unchanged + was merge successful (yn)? n + merging a failed! + merge halted after failed merge (see hg resolve) + [1] + + $ hg resolve --list + U a + U b + + $ hg rebase --abort + rebase aborted + +Check conflicts + $ cat <> $HGRCPATH + > [merge-tools] + > true.check=conflicts + > true.premerge=keep + > EOS + $ hg rebase -s 1 -d 2 --tool true + rebasing 1:1f28a51c3c9b "c" + merging a + merging b + merging a failed! + merge halted after failed merge (see hg resolve) + [1] + +Check conflict prompts + $ hg rebase --abort + rebase aborted + $ hg rebase -s 1 -d 2 --tool true --config merge-tools.true.check=prompt + rebasing 1:1f28a51c3c9b "c" + merging a + merging b + was merge of 'a' successful (yn)? n + merging a failed! + merge halted after failed merge (see hg resolve) + [1] + $ hg rebase --abort + rebase aborted + +Check that a requested abort actually works + $ cat < n + > EOS + rebasing 1:1f28a51c3c9b "c" + merging a + merging b + merging a failed! + merge halted after failed merge (see hg resolve) + [1] + + $ hg rebase --abort + rebase aborted + +Check that successful tool otherwise allows the merge to continue + $ hg rebase -s 1 -d 2 --tool echo --keep --config merge-tools.echo.premerge=keep + rebasing 1:1f28a51c3c9b "c" + merging a + merging b + $TESTTMP/repo/a *a~base* *a~other* (glob) + $TESTTMP/repo/b *b~base* *b~other* (glob) To: ryanmce, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D951: merge: allow user to halt merge on merge-tool failures
ryanmce created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Depends on https://phab.mercurial-scm.org/D932. Call the new _onfilemergefailure function when a merge tool reports failure via a return code. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D951 AFFECTED FILES mercurial/filemerge.py tests/test-merge-halt.t CHANGE DETAILS diff --git a/tests/test-merge-halt.t b/tests/test-merge-halt.t --- a/tests/test-merge-halt.t +++ b/tests/test-merge-halt.t @@ -40,8 +40,7 @@ merging a merging b merging a failed! - merging b failed! - unresolved conflicts (see hg resolve, then hg rebase --continue) + merge halted after failed merge (see hg resolve) [1] $ hg resolve --list @@ -61,8 +60,10 @@ merging a merging b merging a failed! + continue merge operation (yn)? y merging b failed! - unresolved conflicts (see hg resolve, then hg rebase --continue) + continue merge operation (yn)? n + merge halted after failed merge (see hg resolve) [1] $ hg resolve --list diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -715,6 +715,7 @@ if r: if onfailure: ui.warn(onfailure % fd) +_onfilemergefailure(ui) return True, r, deleted finally: To: ryanmce, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D940: remotenames: add functions to read remotenames data from .hg/remotenames/
dlax requested changes to this revision. dlax added a comment. This revision now requires changes to proceed. Overall, the series only introduces helper functions. So it's hard to tell if the implementation is meaningful without any use of the code... INLINE COMMENTS > remotenames.py:31 > > +def readremotenamefile(repo, vfs, filename): > +""" reads a file from .hg/remotenames/ directory and yields it's content `repo` not used > remotenames.py:60 > +for bmentry in readremotenamefile(repo, vfs, 'bookmarks'): > +yield bmentry > + Why only "bookmarks"? (and not "branches") > remotenames.py:84 > +if bmentry[1] != remotepath: > +yield bmentry > + As in previous patch, `readremotebookmarks` and `readremotebranches` functions only differ from the file name; this could be factored out as a function parameter. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D940 To: pulkit, #hg-reviewers, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D939: remotenames: add functionality to store remotenames under .hg/hgremotenames/
dlax requested changes to this revision. dlax added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > remotenames.py:31 > > +def saveremotebookmarks(repo, vfs, remotepath, bookmarks): > +""" save remote bookmarks in .hg/remotenames/bookmarks. `repo` parameter is not used > remotenames.py:45 > +f.write('%s %s\n' % > +(node, joinremotename(remotepath, bookmark))) > +f.close() Incorrect indentation. > remotenames.py:48 > + > +def saveremotebranches(repo, vfs, remotepath, branches): > +""" save remote branches is .hg/remotenames/branches. ditto for `repo` > remotenames.py:64 > + > +f.close() > + Functions `saveremotebranches` and `saveremotebookmarks` are very similar, only differing by the vfs file name. Perhaps there could be a single function taking the filename as a parameter? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D939 To: pulkit, #hg-reviewers, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D937: remotenames: move function to pull remotenames from the remoterepo to core
dlax added a comment. Also, it'd be useful to indicate where the code comes from (i.e. what is the "remoterepo" mentioned in the first line of the commit message). Then, a module docstring explaining the concept at stake (starting by what is a "remotename") and the purpose of the extension would be really nice as a first step. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D937 To: pulkit, #hg-reviewers, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: rfc for a change in an error message (cross branch dirty update)
muxator via Mercurial-devel a écrit : # HG changeset patch # User muxator # Date 1507151594 -7200 # Wed Oct 04 23:13:14 2017 +0200 # Node ID fb134b55bce708f567cb4f32c0d96bb032c2651c # Parent c67db5dc131d0facdfdadc8c3344a8f3e689867d ux: propose "hg update --merge" in the error message of a nonlinear dirty update For the record, this has been proposed previously when the option got introduced. See https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-February/093128.html (follow replies for the rationale). When trying an "hg update" of a dirty working copy across branches, mercurial protects the user aborting with: abort: uncommitted changes (commit or update --clean to discard changes) Since mercurial 4.2, however, it is possible to perform such updates invoking "hg up --merge", but this is not signaled in the error message. Only for these type of updates, this commit modifies the hint after the error message to: abort: uncommitted changes (commit or update --merge to merge the changes. To discard the changes, update --clean) The case in which the update is aborted due to conflicting changes keeps printing the old error message: abort: conflicting changes (commit or update --clean to discard changes) diff --git a/mercurial/merge.py b/mercurial/merge.py --- a/mercurial/merge.py +++ b/mercurial/merge.py @@ -1615,7 +1615,7 @@ pass # allow updating to successors else: msg = _("uncommitted changes") - hint = _("commit or update --clean to discard changes") + hint = _("commit or update --merge to merge the changes. To discard the changes, update --clean") raise error.UpdateAbort(msg, hint=hint) else: # Allow jumping branches if clean and specific rev given diff --git a/tests/test-merge5.t b/tests/test-merge5.t --- a/tests/test-merge5.t +++ b/tests/test-merge5.t @@ -26,7 +26,7 @@ $ hg update 1 abort: uncommitted changes - (commit or update --clean to discard changes) + (commit or update --merge to merge the changes. To discard the changes, update --clean) [255] $ mv c a [...] the same for the other tests (where applies: not for the "conflicting changes" case) [...] ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D948: run-tests: extract Popen logic to a single method
dlax added inline comments. INLINE COMMENTS > run-tests.py:2116 > +pread(bisectcmd + ['--good', >self._runner.options.known_good_rev]) > # TODO: we probably need to forward more options Perhaps also update the indentation of continuation line? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D948 To: quark, #hg-reviewers Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D937: remotenames: move function to pull remotenames from the remoterepo to core
dlax requested changes to this revision. dlax added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > remotenames.py:28 > +if node in repo and not repo[node].obsolete(): > +bmap[branch].append(node) I don't get the point of the function as it is in this patch. First it does not do what the docstring says. Then it does not return anything nor does it change any "state". REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D937 To: pulkit, #hg-reviewers, dlax Cc: dlax, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel