D469: rebase: initial support for multiple destinations
martinvonz added inline comments. INLINE COMMENTS > rebase.py:822 > +for r in rebaseset: > +alias = {'ALLSRC': allsrc, > + 'SRC': revsetlang.formatspec('%d', r)} could pass ALLSRC in the fast-path version too, no? because the concern is not that that calcularing "allsrc" is costly, i assume, but that running the revset over all the revisions is > rebase.py:824 > + 'SRC': revsetlang.formatspec('%d', r)} > +destset = repo.anyrevs([destf], user=True, localalias=alias) > +size = len(destset) anyrevs() doesn't seem to make much sense here. Why not let localrepo.revs() and localrepo.set() accept "user" and "localalias" arguments too? I realize it's more code, but it seem to make more sense. Unless this is just temporary and you're planning on passing a longer list here later. > rebase.py:824 > + 'SRC': revsetlang.formatspec('%d', r)} > +destset = repo.anyrevs([destf], user=True, localalias=alias) > +size = len(destset) The destination revset is resolved earlier than I had expected. Or at least I expected it to be evaluated later, *as well*, I suppose. Let's say my revset is "successors(parents(SRC))" (i.e. a naive attempt at "hg evolve") and my graph looks like this: o A' | o C | o B | x A |/ o If I then do "hg rebase -s B -d ", it seems like only B would be rebased. Do you have plans for making it so C gets rebased too? > test-rebase-dest.t:295 > + > + $ rebasewithdag -s 'B+C+D' -d 'map(SRC, "B:C,C:D")' <<'EOS' > + > B C D Where is "map" defined? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D469 To: quark, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D464: editor: use an unambiguous path suffix for editor files
mbolin added a comment. @durin42 Note that I substantially revised the commit message and test plan to reflect the changes. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D464 To: mbolin, quark, durin42, #hg-reviewers, ryanmce Cc: smf, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 01 of 10] tests: update test-patchbomb to pass our import checker
On Mon, Aug 28, 2017 at 8:27 AM, Augie Fackler wrote: > # HG changeset patch > # User Augie Fackler > # Date 1503435546 14400 > # Tue Aug 22 16:59:06 2017 -0400 > # Node ID 9bf8bd287bbf25b615a74cb6a47cce9c33bace4a > # Parent b1f75d8e887a4c06e6b120807f3defc5c7b78d33 > tests: update test-patchbomb to pass our import checker > Queued, thanks. > > diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t > --- a/tests/test-patchbomb.t > +++ b/tests/test-patchbomb.t > @@ -9,18 +9,19 @@ Mercurial-patchbomb/.* -> Mercurial-patc > --===+[0-9]+=+$ -> --===*= (glob) > >$ cat > prune-blank-after-boundary.py < + > from __future__ import absolute_import, print_function >> import sys >> skipblank = False >> trim = lambda x: x.strip(' \r\n') >> for l in sys.stdin: >> if trim(l).endswith('=--') or trim(l).endswith('=='): >> skipblank = True > - > print l, > + > print(l, end='') >> continue >> if not trim(l) and skipblank: >> continue >> skipblank = False > - > print l, > + > print(l, end='') >> EOF >$ FILTERBOUNDARY="$PYTHON `pwd`/prune-blank-after-boundary.py" >$ echo "[format]" >> $HGRCPATH > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D557: show: use consistent node lengths
quark added inline comments. INLINE COMMENTS > show.py:428 > > +def longestshortest(repo, revs, minlen=5): > +"""Return the length of the longest shortest node to identify revisions. How about minlen=4? It could be useful in small repos. > show.py:440 > +""" > +tmpl = formatter.maketemplater(repo.ui, '{shortest(node, %d)}' % minlen) > +lens = [minlen] I'd call low level function without template and maintain a current minlen to reduce calculation. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D557 To: indygreg, #hg-reviewers Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D558: show: decrease minimum node length from 5 to 3
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Our previous shortest node length of 5 was arbitrarily chosen. shortest() already does the work of ensuring that a partial node isn't ambiguous with an integer revision, which is our primary risk of a collision for very short nodes. It should be safe to go with the shortest node possible. So, we decrease the minimum hash length from 5 to 3. We also add a test for prefix collisions increasing the hash length consistently for `hg show work`, which is a feature from the previous commit. .. feature:: show: decrease minimum displayed hash length from 5 to 3 REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D558 AFFECTED FILES hgext/show.py tests/test-show-stack.t tests/test-show-work.t tests/test-show.t CHANGE DETAILS diff --git a/tests/test-show.t b/tests/test-show.t --- a/tests/test-show.t +++ b/tests/test-show.t @@ -95,8 +95,8 @@ $ hg bookmark a-longer-bookmark $ hg show bookmarks - * a-longer-bookmark7b570 -book1b757f + * a-longer-bookmark7b5 +book1b75 A custom bookmarks template works @@ -113,14 +113,14 @@ "bookmark": "a-longer-bookmark", "longestbookmarklen": 17, "node": "7b5709ab64cbc34da9b4367b64afff47f2c4ee83", -"nodelen": 5 +"nodelen": 3 }, { "active": false, "bookmark": "book1", "longestbookmarklen": 17, "node": "b757f780b8ffd71267c6ccb32e0882d9d32a8cc0", -"nodelen": 5 +"nodelen": 3 } ] @@ -138,19 +138,19 @@ (no bookmarks set) $ hg --config commands.show.aliasprefix=sh shwork - @ 7b570 commit for book2 - o b757f commit for book1 - o ba592 initial + @ 7b5 commit for book2 + o b75 commit for book1 + o ba5 initial $ hg --config commands.show.aliasprefix='s sh' swork - @ 7b570 commit for book2 - o b757f commit for book1 - o ba592 initial + @ 7b5 commit for book2 + o b75 commit for book1 + o ba5 initial $ hg --config commands.show.aliasprefix='s sh' shwork - @ 7b570 commit for book2 - o b757f commit for book1 - o ba592 initial + @ 7b5 commit for book2 + o b75 commit for book1 + o ba5 initial The aliases don't appear in `hg config` diff --git a/tests/test-show-work.t b/tests/test-show-work.t --- a/tests/test-show-work.t +++ b/tests/test-show-work.t @@ -16,47 +16,47 @@ $ hg -q commit -A -m 'commit 0' $ hg show work - @ 9f171 commit 0 + @ 9f1 commit 0 Even when it isn't the wdir $ hg -q up null $ hg show work - o 9f171 commit 0 + o 9f1 commit 0 Single changeset is still there when public because it is a head $ hg phase --public -r 0 $ hg show work - o 9f171 commit 0 + o 9f1 commit 0 A draft child will show both it and public parent $ hg -q up 0 $ echo 1 > foo $ hg commit -m 'commit 1' $ hg show work - @ 181cc commit 1 - o 9f171 commit 0 + @ 181 commit 1 + o 9f1 commit 0 Multiple draft children will be shown $ echo 2 > foo $ hg commit -m 'commit 2' $ hg show work - @ 128c8 commit 2 - o 181cc commit 1 - o 9f171 commit 0 + @ 128 commit 2 + o 181 commit 1 + o 9f1 commit 0 Bumping first draft changeset to public will hide its parent $ hg phase --public -r 1 $ hg show work - @ 128c8 commit 2 - o 181cc commit 1 + @ 128 commit 2 + o 181 commit 1 | ~ @@ -68,22 +68,22 @@ created new head $ hg show work - @ f0abc commit 3 - | o 128c8 commit 2 + @ f0a commit 3 + | o 128 commit 2 |/ - o 181cc commit 1 + o 181 commit 1 | ~ Even when wdir is something else $ hg -q up null $ hg show work - o f0abc commit 3 - | o 128c8 commit 2 + o f0a commit 3 + | o 128 commit 2 |/ - o 181cc commit 1 + o 181 commit 1 | ~ @@ -95,13 +95,13 @@ created new head $ hg show work - @ 668ca commit 4 - | o f0abc commit 3 - | | o 128c8 commit 2 + @ 668 commit 4 + | o f0a commit 3 + | | o 128 commit 2 | |/ - | o 181cc commit 1 + | o 181 commit 1 |/ - o 9f171 commit 0 + o 9f1 commit 0 $ cd .. @@ -126,11 +126,11 @@ $ hg commit -m 'commit 4' $ hg show work - @ f8dd3 (mybranch) commit 4 - o 90cfc (mybranch) commit 3 - | o 128c8 commit 2 + @ f8d (mybranch) commit 4 + o 90c (mybranch) commit 3 + | o 128 commit 2 |/ - o 181cc commit 1 + o 181 commit 1 | ~ @@ -157,11 +157,11 @@ $ hg bookmark mybook $ hg show work - @ cac82 (mybook) commit 4 - o f0abc commit 3 - | o 128c8 (@) commit 2 + @ cac (mybook) commit 4 + o f0a commit 3 + | o 128 (@) commit 2 |/ - o 181cc commit 1 + o 181 commit 1 | ~ @@ -182,9 +182,9 @@ $ hg tag 0.2 $ hg show work - @ 37582 Added tag 0.2 for changeset 6379c25b76f1 - o 6379c (0.2) commit 3 - o a2ad9 Added tag 0.1 for changeset 6a75536
D555: cmdutil: allow extra properties to be added to each context
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The changeset displayer allows setting extra keywords to be available to the templating layer. This patch adds an argument to displaygraph() to pass a dict of extra properties to be available to every changeset. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D555 AFFECTED FILES mercurial/cmdutil.py CHANGE DETAILS diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2616,7 +2616,8 @@ return formatnode def displaygraph(ui, repo, dag, displayer, edgefn, getrenamed=None, - filematcher=None): + filematcher=None, props=None): +props = props or {} formatnode = _graphnodeformatter(ui, displayer) state = graphmod.asciistate() styles = state['styles'] @@ -2657,7 +2658,7 @@ firstedge = next(edges) width = firstedge[2] displayer.show(ctx, copies=copies, matchfn=revmatchfn, - _graphwidth=width) + _graphwidth=width, **props) lines = displayer.hunk.pop(rev).split('\n') if not lines[-1]: del lines[-1] To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D556: show: pass the minimum length for nodes as a template keyword
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This will allow us to make the displayed length configurable and/or dynamic. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D556 AFFECTED FILES hgext/show.py mercurial/templates/map-cmdline.show tests/test-show.t CHANGE DETAILS diff --git a/tests/test-show.t b/tests/test-show.t --- a/tests/test-show.t +++ b/tests/test-show.t @@ -112,13 +112,15 @@ "active": true, "bookmark": "a-longer-bookmark", "longestbookmarklen": 17, -"node": "7b5709ab64cbc34da9b4367b64afff47f2c4ee83" +"node": "7b5709ab64cbc34da9b4367b64afff47f2c4ee83", +"nodelen": 5 }, { "active": false, "bookmark": "book1", "longestbookmarklen": 17, -"node": "b757f780b8ffd71267c6ccb32e0882d9d32a8cc0" +"node": "b757f780b8ffd71267c6ccb32e0882d9d32a8cc0", +"nodelen": 5 } ] diff --git a/mercurial/templates/map-cmdline.show b/mercurial/templates/map-cmdline.show --- a/mercurial/templates/map-cmdline.show +++ b/mercurial/templates/map-cmdline.show @@ -3,12 +3,12 @@ # piggyback on existing values so color works. # * Obsolescence isn't considered for node labels. See _cset_labels in # map-cmdline.default. -showbookmarks = '{if(active, "*", " ")} {pad(bookmark, longestbookmarklen + 4)}{shortest(node, 5)}\n' +showbookmarks = '{if(active, "*", " ")} {pad(bookmark, longestbookmarklen + 4)}{shortest(node, nodelen)}\n' showwork = '{cset_shortnode}{namespaces % cset_namespace} {cset_shortdesc}' showstack = '{showwork}' -cset_shortnode = '{label("log.changeset changeset.{phase}", shortest(node, 5))}' +cset_shortnode = '{label("log.changeset changeset.{phase}", shortest(node, nodelen))}' # Treat branch and tags specially so we don't display "default" or "tip" cset_namespace = '{ifeq(namespace, "branches", names_branches, ifeq(namespace, "tags", names_tags, names_others))}' diff --git a/hgext/show.py b/hgext/show.py --- a/hgext/show.py +++ b/hgext/show.py @@ -171,7 +171,8 @@ fm.write('bookmark', '%s', bm) fm.write('node', fm.hexfunc(node), fm.hexfunc(node)) fm.data(active=bm == active, -longestbookmarklen=longestname) +longestbookmarklen=longestname, +nodelen=5) @showview('stack', csettopic='stack') def showstack(ui, repo, displayer): @@ -277,7 +278,7 @@ ui.write(' ') ui.write(('o ')) -displayer.show(ctx) +displayer.show(ctx, nodelen=5) displayer.flush(ctx) ui.write('\n') @@ -317,7 +318,7 @@ ui.write(' ') ui.write(symbol, ' ') -displayer.show(ctx) +displayer.show(ctx, nodelen=5) displayer.flush(ctx) ui.write('\n') @@ -334,7 +335,7 @@ ui.write(_('(stack base)'), '\n', label='stack.label') ui.write(('o ')) -displayer.show(basectx) +displayer.show(basectx, nodelen=5) displayer.flush(basectx) ui.write('\n') @@ -397,7 +398,8 @@ revdag = graphmod.dagwalker(repo, revs) ui.setconfig('experimental', 'graphshorten', True) -cmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges) +cmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, + props={'nodelen': 5}) def extsetup(ui): # Alias `hg ` to `hg show `. To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D557: show: use consistent node lengths
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY `hg show` makes heavy use of shortest() to limit the length of the node hash. For the "stack" and "work" views, you are often looking at multiple lines of similar output for "lines" of work. It is visually appeasing for things to vertically align. A naive use of {shortest(node, N)} could result in variable length nodes and for the first character of the description to vary by a column or two. We implement a function to determine the longest shortest prefix for a set of revisions. The new function is used to determine the printed node length for all `hg show` views. Testing this will be deferred to a subsequent commit. .. feature:: show: use consistent node length in views REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D557 AFFECTED FILES hgext/show.py CHANGE DETAILS diff --git a/hgext/show.py b/hgext/show.py --- a/hgext/show.py +++ b/hgext/show.py @@ -161,18 +161,19 @@ ui.write(_('(no bookmarks set)\n')) return +revs = [repo[node].rev() for node in marks.values()] active = repo._activebookmark longestname = max(len(b) for b in marks) -# TODO consider exposing longest shortest(node). +nodelen = longestshortest(repo, revs) for bm, node in sorted(marks.items()): fm.startitem() fm.context(ctx=repo[node]) fm.write('bookmark', '%s', bm) fm.write('node', fm.hexfunc(node), fm.hexfunc(node)) fm.data(active=bm == active, longestbookmarklen=longestname, -nodelen=5) +nodelen=nodelen) @showview('stack', csettopic='stack') def showstack(ui, repo, displayer): @@ -236,6 +237,9 @@ else: newheads = set() +allrevs = set(stackrevs) | newheads | set([baserev]) +nodelen = longestshortest(repo, allrevs) + try: cmdutil.findcmd('rebase', commands.table) haverebase = True @@ -247,7 +251,7 @@ # our simplicity and the customizations required. # TODO use proper graph symbols from graphmod -shortesttmpl = formatter.maketemplater(ui, '{shortest(node, 5)}') +shortesttmpl = formatter.maketemplater(ui, '{shortest(node, %d)}' % nodelen) def shortest(ctx): return shortesttmpl.render({'ctx': ctx, 'node': ctx.hex()}) @@ -278,7 +282,7 @@ ui.write(' ') ui.write(('o ')) -displayer.show(ctx, nodelen=5) +displayer.show(ctx, nodelen=nodelen) displayer.flush(ctx) ui.write('\n') @@ -318,7 +322,7 @@ ui.write(' ') ui.write(symbol, ' ') -displayer.show(ctx, nodelen=5) +displayer.show(ctx, nodelen=nodelen) displayer.flush(ctx) ui.write('\n') @@ -335,7 +339,7 @@ ui.write(_('(stack base)'), '\n', label='stack.label') ui.write(('o ')) -displayer.show(basectx, nodelen=5) +displayer.show(basectx, nodelen=nodelen) displayer.flush(basectx) ui.write('\n') @@ -394,12 +398,13 @@ """changesets that aren't finished""" # TODO support date-based limiting when calling revset. revs = repo.revs('sort(_underway(), topo)') +nodelen = longestshortest(repo, revs) revdag = graphmod.dagwalker(repo, revs) ui.setconfig('experimental', 'graphshorten', True) cmdutil.displaygraph(ui, repo, revdag, displayer, graphmod.asciiedges, - props={'nodelen': 5}) + props={'nodelen': nodelen}) def extsetup(ui): # Alias `hg ` to `hg show `. @@ -420,6 +425,27 @@ ui.setconfig('alias', name, 'show %s' % view, source='show') +def longestshortest(repo, revs, minlen=5): +"""Return the length of the longest shortest node to identify revisions. + +The result of this function can be used with the ``shortest()`` template +function to ensure that a value is unique and unambiguous for a given +set of nodes. + +The number of revisions in the repo is taken into account to prevent +a numeric node prefix from conflicting with an integer revision number. +If we fail to do this, a value of e.g. ``10023`` could mean either +revision 10023 or node ``10023abc...``. +""" +tmpl = formatter.maketemplater(repo.ui, '{shortest(node, %d)}' % minlen) +lens = [minlen] +for rev in revs: +ctx = repo[rev] +shortest = tmpl.render({'ctx': ctx, 'node': ctx.hex()}) +lens.append(len(shortest)) + +return max(lens) + # Adjust the docstring of the show command so it shows all registered views. # This is a bit hacky because it runs at the end of module load. When moved # into core or when another extension wants to provide a view, we'll need To: indygreg, #hg-reviewers Cc: mercurial-devel ___
D464: commit: use an unambiguous path suffix for the commit editor file
mbolin updated this revision to Diff 1381. mbolin added a comment. Changed format string to .%s.hg.txt. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D464?vs=1380&id=1381 BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D464 AFFECTED FILES hgext/histedit.py hgext/patchbomb.py mercurial/cmdutil.py mercurial/crecord.py mercurial/ui.py CHANGE DETAILS diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -1345,20 +1345,31 @@ self.write(*msg, **opts) def edit(self, text, user, extra=None, editform=None, pending=None, - repopath=None): + repopath=None, action=None): +if action is None: +self.develwarn('action is None but will soon be a required ' + 'parameter to ui.edit()') extra_defaults = { 'prefix': 'editor', 'suffix': '.txt', } if extra is not None: +if extra.get('suffix') is not None: +self.develwarn('extra.suffix is not None but will soon be ' + 'ignored by ui.edit()') extra_defaults.update(extra) extra = extra_defaults +if action: +suffix = '.%s.hg.txt' % action +else: +suffix = extra['suffix'] + rdir = None if self.configbool('experimental', 'editortmpinhg'): rdir = repopath (fd, name) = tempfile.mkstemp(prefix='hg-' + extra['prefix'] + '-', - suffix=extra['suffix'], + suffix=suffix, dir=rdir) try: f = os.fdopen(fd, r'wb') diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -1553,7 +1553,7 @@ # start the editor and wait for it to complete try: patch = self.ui.edit(patch.getvalue(), "", - extra={"suffix": ".diff"}) + action=".diff") except error.Abort as exc: self.errorstr = str(exc) return None diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -339,7 +339,7 @@ + crecordmod.patchhelptext + fp.read()) reviewedpatch = ui.edit(patchtext, "", -extra={"suffix": ".diff"}, +action="diff", repopath=repo.path) fp.truncate(0) fp.write(reviewedpatch) @@ -3215,7 +3215,7 @@ editortext = repo.ui.edit(committext, ctx.user(), ctx.extra(), editform=editform, pending=pending, - repopath=repo.path) + repopath=repo.path, action='commit') text = editortext # strip away anything below this special string (used for editors that want diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -308,7 +308,8 @@ else: ui.write(_('\nWrite the introductory message for the ' 'patch series.\n\n')) -body = ui.edit(defaultbody, sender, repopath=repo.path) +body = ui.edit(defaultbody, sender, repopath=repo.path, + action='patchbombbody') # Save series description in case sendmail fails msgfile = repo.vfs('last-email.txt', 'wb') msgfile.write(body) diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -1370,7 +1370,7 @@ rules += '\n\n' rules += editcomment rules = ui.edit(rules, ui.username(), {'prefix': 'histedit'}, -repopath=repo.path) +repopath=repo.path, action='histedit') # Save edit rules in .hg/histedit-last-edit.txt in case # the user needs to ask for help after something To: mbolin, quark, durin42, #hg-reviewers, ryanmce Cc: smf, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D464: commit: use an unambiguous path suffix for the commit editor file
mbolin updated this revision to Diff 1380. mbolin added a comment. Created optional action param as suggested by @durin42 REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D464?vs=1130&id=1380 BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D464 AFFECTED FILES hgext/histedit.py hgext/patchbomb.py mercurial/cmdutil.py mercurial/crecord.py mercurial/ui.py CHANGE DETAILS diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -1345,20 +1345,31 @@ self.write(*msg, **opts) def edit(self, text, user, extra=None, editform=None, pending=None, - repopath=None): + repopath=None, action=None): +if action is None: +self.develwarn('action is None but will soon be a required ' + 'parameter to ui.edit()') extra_defaults = { 'prefix': 'editor', 'suffix': '.txt', } if extra is not None: +if extra.get('suffix') is not None: +self.develwarn('extra.suffix is not None but will soon be ' + 'ignored by ui.edit()') extra_defaults.update(extra) extra = extra_defaults +if action: +suffix = '.hg%s.txt' % action +else: +suffix = extra['suffix'] + rdir = None if self.configbool('experimental', 'editortmpinhg'): rdir = repopath (fd, name) = tempfile.mkstemp(prefix='hg-' + extra['prefix'] + '-', - suffix=extra['suffix'], + suffix=suffix, dir=rdir) try: f = os.fdopen(fd, r'wb') diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -1553,7 +1553,7 @@ # start the editor and wait for it to complete try: patch = self.ui.edit(patch.getvalue(), "", - extra={"suffix": ".diff"}) + action=".diff") except error.Abort as exc: self.errorstr = str(exc) return None diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -339,7 +339,7 @@ + crecordmod.patchhelptext + fp.read()) reviewedpatch = ui.edit(patchtext, "", -extra={"suffix": ".diff"}, +action="diff", repopath=repo.path) fp.truncate(0) fp.write(reviewedpatch) @@ -3215,7 +3215,7 @@ editortext = repo.ui.edit(committext, ctx.user(), ctx.extra(), editform=editform, pending=pending, - repopath=repo.path) + repopath=repo.path, action='commit') text = editortext # strip away anything below this special string (used for editors that want diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -308,7 +308,8 @@ else: ui.write(_('\nWrite the introductory message for the ' 'patch series.\n\n')) -body = ui.edit(defaultbody, sender, repopath=repo.path) +body = ui.edit(defaultbody, sender, repopath=repo.path, + action='patchbombbody') # Save series description in case sendmail fails msgfile = repo.vfs('last-email.txt', 'wb') msgfile.write(body) diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -1370,7 +1370,7 @@ rules += '\n\n' rules += editcomment rules = ui.edit(rules, ui.username(), {'prefix': 'histedit'}, -repopath=repo.path) +repopath=repo.path, action='histedit') # Save edit rules in .hg/histedit-last-edit.txt in case # the user needs to ask for help after something To: mbolin, quark, durin42, #hg-reviewers, ryanmce Cc: smf, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D552: import-checker: allow relative import a module being checked
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This would make the checker more friendly for 3rd-party code. For example, In remotefilelog/x.py, it may have: from . import shallowutils That could trigger "relative import of stdlib module" if "remotefilelog" was installed in the system. If the module is being checked conflicts with the system module, it makes sense to not treat that module as system module. This patch makes it so. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D552 AFFECTED FILES contrib/import-checker.py tests/test-imports-checker.t CHANGE DETAILS diff --git a/tests/test-imports-checker.t b/tests/test-imports-checker.t --- a/tests/test-imports-checker.t +++ b/tests/test-imports-checker.t @@ -125,7 +125,19 @@ > from mercurial.node import hex > EOF - $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py +# Shallow a stdlib module to test "relative import of stdlib module" is allowed +# if the module is also being checked + + $ mkdir email + $ touch email/__init__.py + $ touch email/errors.py + $ cat > email/utils.py << EOF + > from __future__ import absolute_import + > from . import errors + > EOF + + $ $PYTHON "$import_checker" testpackage*/*.py testpackage/subpackage/*.py \ + > email/*.py testpackage/importalias.py:2: ui module must be "as" aliased to uimod testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted diff --git a/contrib/import-checker.py b/contrib/import-checker.py --- a/contrib/import-checker.py +++ b/contrib/import-checker.py @@ -411,7 +411,8 @@ assign the symbol to a module-level variable. In addition, these imports must be performed before other local imports. This rule only applies to import statements outside of any blocks. -* Relative imports from the standard library are not allowed. +* Relative imports from the standard library are not allowed, unless that + library is also a local module. * Certain modules must be aliased to alternate names to avoid aliasing and readability problems. See `requirealias`. """ @@ -493,7 +494,10 @@ # __future__ is special since it needs to come first and use # symbol import. if fullname != '__future__': -if not fullname or fullname in stdlib_modules: +if not fullname or ( +fullname in stdlib_modules +and fullname not in localmods +and fullname + '.__init__' not in localmods): yield msg('relative import of stdlib module') else: seenlocal = fullname 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
D551: import-checker: allow direct symbol import if the symbol is a module
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This would make the checker more friendly for 3rd-party code. For example, In remotefilelog/x.py, it may have: from . import shallowutils This triggers "direct symbol import shallowutils from remotefilelog" today. Since "shallowutils" itself is a module, the import should be allowed. This patch makes it so. It seems the warning is mainly to avoid the situation where other code could wrap some symbols (typically by `extensions.wrapfunction`) after import, and the existing code would still be using old symbols. But it's rare to have an entire module replaced. So I think this change is reasonable. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D551 AFFECTED FILES contrib/import-checker.py tests/test-imports-checker.t CHANGE DETAILS diff --git a/tests/test-imports-checker.t b/tests/test-imports-checker.t --- a/tests/test-imports-checker.t +++ b/tests/test-imports-checker.t @@ -129,8 +129,6 @@ testpackage/importalias.py:2: ui module must be "as" aliased to uimod testpackage/importfromalias.py:2: ui from testpackage must be "as" aliased to uimod testpackage/importfromrelative.py:2: import should be relative: testpackage.unsorted - testpackage/importfromrelative.py:2: direct symbol import foo from testpackage.unsorted - testpackage/importsymbolfromsub.py:2: direct symbol import nonmodule from testpackage.subpackage testpackage/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node testpackage/multiple.py:2: multiple imported names: os, sys testpackage/multiplegroups.py:3: multiple "from . import" statements @@ -141,7 +139,6 @@ testpackage/subpackage/levelpriority.py:3: higher-level import should come first: testpackage testpackage/subpackage/localimport.py:7: multiple "from .. import" statements testpackage/subpackage/localimport.py:8: import should be relative: testpackage.subpackage.levelpriority - testpackage/symbolimport.py:2: direct symbol import foo from testpackage.unsorted testpackage/unsorted.py:3: imports not lexically sorted: os < sys testpackage2/latesymbolimport.py:3: symbol import follows non-symbol import: mercurial.node [1] diff --git a/contrib/import-checker.py b/contrib/import-checker.py --- a/contrib/import-checker.py +++ b/contrib/import-checker.py @@ -499,7 +499,8 @@ seenlocal = fullname # Direct symbol import is only allowed from certain modules and -# must occur before non-symbol imports. +# must occur before non-symbol imports, or the symbol itself is a +# local module. found = fromlocal(node.module, node.level) if found and found[2]: # node.module is a package prefix = found[0] + '.' @@ -509,7 +510,9 @@ symbols = (n.name for n in node.names) symbols = [sym for sym in symbols if sym not in directsymbols] if node.module and node.col_offset == root_col_offset: -if symbols and fullname not in allowsymbolimports: +if (symbols and fullname not in allowsymbolimports +and fullname not in localmods +and fullname + '.__init__' not in localmods): yield msg('direct symbol import %s from %s', ', '.join(symbols), fullname) 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
D549: metadataonlyctx: don't crash when reusing the manifest with deletions
quark abandoned this revision. quark added a comment. I had some connectivity issues when sending this. Let's take the other one. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D549 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
D550: metadataonlyctx: don't crash when reusing the manifest with deletions
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This was originally fixed by Mateusz Kwapich for the `metaedit` command in fb-hgext with a test for the `metaedit` command. It didn't get upstreamed because `metaedit` was not in core. This patch fixes the crash and adds a test about `metadataonlyctx` to avoid future regressions. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D550 AFFECTED FILES mercurial/context.py tests/test-context-metadata.t CHANGE DETAILS diff --git a/tests/test-context-metadata.t b/tests/test-context-metadata.t new file mode 100644 --- /dev/null +++ b/tests/test-context-metadata.t @@ -0,0 +1,50 @@ +Tests about metadataonlyctx + + $ hg init + $ echo A > A + $ hg commit -A A -m 'Add A' + $ echo B > B + $ hg commit -A B -m 'Add B' + $ hg rm A + $ echo C > C + $ echo B2 > B + $ hg add C -q + $ hg commit -m 'Remove A' + + $ cat > metaedit.py < from __future__ import absolute_import + > from mercurial import context, registrar + > cmdtable = {} + > command = registrar.command(cmdtable) + > @command('metaedit') + > def metaedit(ui, repo, arg): + > # Modify commit message to "FOO" + > with repo.wlock(), repo.lock(), repo.transaction('metaedit'): + > old = repo['.'] + > kwargs = dict(s.split('=', 1) for s in arg.split(';')) + > if 'parents' in kwargs: + > kwargs['parents'] = kwargs['parents'].split(',') + > new = context.metadataonlyctx(repo, old, **kwargs) + > new.commit() + > EOF + $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'text=Changed' + $ hg log -r tip + changeset: 3:ad83e9e00ec9 + tag: tip + parent: 1:3afb7afe6632 + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: Changed + + $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'parents=0' 2>&1 | egrep '^\S*Error' + RuntimeError: can't reuse the manifest: its p1 doesn't match the new ctx p1 + + $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'user=foo ' + $ hg log -r tip + changeset: 4:1f86eaeca92b + tag: tip + parent: 1:3afb7afe6632 + user:foo + date:Thu Jan 01 00:00:00 1970 + + summary: Remove A + diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2378,7 +2378,7 @@ for f in self._files: if not managing(f): added.append(f) -elif self[f]: +elif f in self: modified.append(f) else: removed.append(f) 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
D549: metadataonlyctx: don't crash when reusing the manifest with deletions
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This was originally fixed by Mateusz Kwapich for the `metaedit` command in fb-hgext with a test for the `metaedit` command. It didn't get upstreamed because `metaedit` was not in core. This patch fixes the crash and adds a test about `metadataonlyctx` to avoid future regressions. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D549 AFFECTED FILES mercurial/context.py tests/test-context-metadata.t CHANGE DETAILS diff --git a/tests/test-context-metadata.t b/tests/test-context-metadata.t new file mode 100644 --- /dev/null +++ b/tests/test-context-metadata.t @@ -0,0 +1,50 @@ +Tests about metadataonlyctx + + $ hg init + $ echo A > A + $ hg commit -A A -m 'Add A' + $ echo B > B + $ hg commit -A B -m 'Add B' + $ hg rm A + $ echo C > C + $ echo B2 > B + $ hg add C -q + $ hg commit -m 'Remove A' + + $ cat > metaedit.py < from __future__ import absolute_import + > from mercurial import context, registrar + > cmdtable = {} + > command = registrar.command(cmdtable) + > @command('metaedit') + > def metaedit(ui, repo, arg): + > # Modify commit message to "FOO" + > with repo.wlock(), repo.lock(), repo.transaction('metaedit'): + > old = repo['.'] + > kwargs = dict(s.split('=', 1) for s in arg.split(';')) + > if 'parents' in kwargs: + > kwargs['parents'] = kwargs['parents'].split(',') + > new = context.metadataonlyctx(repo, old, **kwargs) + > new.commit() + > EOF + $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'text=Changed' + $ hg log -r tip + changeset: 3:ad83e9e00ec9 + tag: tip + parent: 1:3afb7afe6632 + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: Changed + + $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'parents=0' 2>&1 | egrep '^\S*Error' + RuntimeError: can't reuse the manifest: its p1 doesn't match the new ctx p1 + + $ hg --config extensions.metaedit=$TESTTMP/metaedit.py metaedit 'user=foo ' + $ hg log -r tip + changeset: 4:1f86eaeca92b + tag: tip + parent: 1:3afb7afe6632 + user:foo + date:Thu Jan 01 00:00:00 1970 + + summary: Remove A + diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2378,7 +2378,7 @@ for f in self._files: if not managing(f): added.append(f) -elif self[f]: +elif f in self: modified.append(f) else: removed.append(f) 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
D548: context: make parents and text optional in metadataonlyctx
quark created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The metadataonlyctx is to copy an existing context with some minor metadata changes. If the caller only wants to change "extra", or "user", ideally it does not have to read and pass "parents" and "text" information. This patch makes "parents" and "text" optionally to convenient callers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D548 AFFECTED FILES mercurial/context.py CHANGE DETAILS diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -2305,15 +2305,23 @@ def __new__(cls, repo, originalctx, *args, **kwargs): return super(metadataonlyctx, cls).__new__(cls, repo) -def __init__(self, repo, originalctx, parents, text, user=None, date=None, - extra=None, editor=False): +def __init__(self, repo, originalctx, parents=None, text=None, user=None, + date=None, extra=None, editor=False): +if text is None: +text = originalctx.description() super(metadataonlyctx, self).__init__(repo, text, user, date, extra) self._rev = None self._node = None self._originalctx = originalctx self._manifestnode = originalctx.manifestnode() -parents = [(p or nullid) for p in parents] -p1, p2 = self._parents = [changectx(self._repo, p) for p in parents] +if parents is None: +parents = originalctx.parents() +else: +parents = [repo[p] for p in parents if p is not None] +parents = parents[:] +while len(parents) < 2: +parents.append(repo[nullid]) +p1, p2 = self._parents = parents # sanity check to ensure that the reused manifest parents are # manifests of our commit parents 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
Re: Accessing hidden commits by hash (directaccess extension)
Durham Goode wrote: > > > On 8/25/17 11:55 AM, Danek Duvall wrote: > > This is great. I've been hitting my head against this ever since I started > > using evolve, and I'll be thrilled to have this functionality. > > > > A couple of questions: > > > > - If a revision range is given that ends (or begins, I suppose) with a > > hidden changeset, will any intervening hidden changesets also be > > temporarily unhidden? > > The unhiding mechanic unhides the commit and all ancestors. So those > ancestors will be returned as well. Descendants are not returned, so > HIDDEN:: will only return HIDDEN. Okay, that makes sense. > > - The recoverable-write commands often pop you into an editor before any > > warning can be seen and understood. Should the warning be available in > > the editor template? > > I'm open to the idea. I don't know how many people actually read the editor > template after seeing it a few times, so I'm not sure how useful it would be > in practice though. Yeah, I don't know what the right answer is here, either. Maybe the syntax highlighting in standard editors could be updated to make the message stand out a bit. Otherwise, the only things I can think of are either to have a pause before the editor fires up or to just print the message and hope for the best. There's no protocol for integrating with IDEs in this situation, is there? Something that would allow the IDE to pop a warning box? I dunno; maybe it's overengineering, at least for now. The whole point of recoverable operations is that you can undo your mistake once you've realized you made one. Hm. Maybe a message after the editor exits is another option. > > - The unrecoverable-write commands could probably stand to explain why > > they're preventing the operation from happening, but perhaps more > > importantly, if you use --hidden with them, will they actually > > push/serve/whatever? I guess I can see wanting a complete clone of a > > repo, including hidden changesets, so pushing them around would make > > sense in that context, but I thought we weren't going there. > > The messaging could be tweaked, sure. If the user wants to bypass the > block, then --hidden will let them do the push/etc. We probably won't > advertise that though. Okay. > In the longer term, we have UI's within Facebook that we hope to upstream > that allow recovering a commit (with the same hash it had before), so users > could first recover the commit (which makes it clear they are explicitly > bringing the commit back) and then push it. That's clearly the better UX for normal users. > > Along similar lines, I've also wanted the ability to push and pull secret > > changesets between (non-publishing) repositories, but only when specificied > > by name like this. Seems like there could be some shared mechanism there, > > if it's not just me. > > We don't really use secret commits here. Instead, we've overriden the push > behavior to require the user to specify what they want to push and where > they want to push to (hg push -r mybookmark --to theirbookmark). So we > haven't really needed secret as a mechanism for controlling exchange. Sure, though of course not everyone works at Facebook, and those that do, might work in other contexts, too. It's certainly a workflow I've found useful in the past. I'm certainly not asking for implementation here, just a confirmation that there's enough alignment here that implementing that at some point would be easier because of your work. Thanks, Danek ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D464: commit: use an unambiguous path suffix for the commit editor file
durin42 added inline comments. INLINE COMMENTS > smf wrote in cmdutil.py:3214 > Yeah, this is pretty much what I had in mind (sorry again for the > confusion!). I also don't have any preference for '.hg.$ACTION.txt' just for > it to be something sane / stable. A thought: should we do .$ACTION.hg.txt so we can do suffix-only detection of "something from hg" vs specific actions? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D464 To: mbolin, quark, durin42, #hg-reviewers, ryanmce Cc: smf, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D547: tests: rename test-terse-status.t to test-status-terse.t
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY When looking for status tests, most people would probably look for "test-status*", so it would be nice if they could find it there. This also let's them run (most) status tests with "run-tests.py test-status*". REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D547 AFFECTED FILES tests/test-status-terse.t tests/test-terse-status.t CHANGE DETAILS diff --git a/tests/test-terse-status.t b/tests/test-status-terse.t rename from tests/test-terse-status.t rename to tests/test-status-terse.t To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D464: commit: use an unambiguous path suffix for the commit editor file
smf added inline comments. INLINE COMMENTS > durin42 wrote in cmdutil.py:3214 > I agree with smf: this patch is accomplishing a reasonable thing, but we > should clean up this interface if we're going to use it. Let's add an action= > parameter that's optional in the 4.4 cycle, with a devel warning if it's not > specified. Then in 4.4 we can make it a mandatory parameter for ui.edit(). > > Right now the only client of this poke-something-in-extra API is histedit, so > the time is right to clean up the API before more consumers do silly things. > For your immediate goal in this patch, here's what I'd suggest as a > compromise: > > 1. Add the new action=None business to ui.edit(), which then makes > suffix='.hg$ACTION.txt' or similar > 2. Update histedit to use that instead of screwing around with 'suffix' in > extra > 3. Remove support for 'suffix' in extra > 4. Do this patch, but with action='commit' instead of poking '.hgcommit.txt' > in the extra > > How does that sound to everyone? Yeah, this is pretty much what I had in mind (sorry again for the confusion!). I also don't have any preference for '.hg.$ACTION.txt' just for it to be something sane / stable. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D464 To: mbolin, quark, durin42, #hg-reviewers, ryanmce Cc: smf, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D546: morestatus: simplify check for unresolved merge conflicts
martinvonz 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/D546 AFFECTED FILES mercurial/cmdutil.py CHANGE DETAILS diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -587,7 +587,7 @@ return m = scmutil.match(repo[None]) -unresolvedlist = [f for f in mergestate if m(f) and mergestate[f] == 'u'] +unresolvedlist = [f for f in mergestate.unresolved() if m(f)] if unresolvedlist: mergeliststr = '\n'.join( ['%s' % os.path.relpath( To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D468: util: use ~ as a suffix for a temp file in the same directory as a source file
mbolin added a comment. @durin42 I believe we've come to a resolution on this thread that this is fine as-is, so are you OK to take this now? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D468 To: mbolin, #hg-reviewers, quark, durin42 Cc: smf, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D464: commit: use an unambiguous path suffix for the commit editor file
mbolin added a comment. @durin42 Sounds good: I'll work on cleaning this up. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D464 To: mbolin, quark, durin42, #hg-reviewers, ryanmce Cc: smf, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@33972: 32 new changesets
32 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/c0bbaefc2c5a changeset: 33941:c0bbaefc2c5a user:Boris Feld date:Mon Jul 03 03:54:24 2017 +0200 summary: obsolete: move merge logic on the smaller object https://www.mercurial-scm.org/repo/hg/rev/54c21114e41d changeset: 33942:54c21114e41d user:Boris Feld date:Mon Jul 03 03:56:53 2017 +0200 summary: obsolete: fix old typo https://www.mercurial-scm.org/repo/hg/rev/fa187801f4b8 changeset: 33943:fa187801f4b8 user:Augie Fackler date:Tue Aug 22 14:58:10 2017 -0400 summary: tests: update test-annotate to pass our module import checker https://www.mercurial-scm.org/repo/hg/rev/74e53c21fd13 changeset: 33944:74e53c21fd13 user:Augie Fackler date:Tue Aug 22 14:58:21 2017 -0400 summary: tests: update test-archive to pass our module import checker https://www.mercurial-scm.org/repo/hg/rev/403040b5a5bd changeset: 33945:403040b5a5bd user:Augie Fackler date:Tue Aug 22 14:58:39 2017 -0400 summary: tests: update test-bisect to pass our module import checker https://www.mercurial-scm.org/repo/hg/rev/83313639b8a4 changeset: 33946:83313639b8a4 user:Augie Fackler date:Tue Aug 22 15:04:14 2017 -0400 summary: tests: update test-bookmarks to pass the import checker https://www.mercurial-scm.org/repo/hg/rev/0124cf4af3b7 changeset: 33947:0124cf4af3b7 user:Augie Fackler date:Tue Aug 22 15:04:36 2017 -0400 summary: tests: update test-bundle2-pushback to pass the import checker https://www.mercurial-scm.org/repo/hg/rev/4f86c9647d23 changeset: 33948:4f86c9647d23 user:Augie Fackler date:Tue Aug 22 15:05:51 2017 -0400 summary: tests: update test-bundle2-format to pass import checker https://www.mercurial-scm.org/repo/hg/rev/0d0cec9602c3 changeset: 33949:0d0cec9602c3 user:Augie Fackler date:Tue Aug 22 15:49:20 2017 -0400 summary: tests: update test-chg to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/42361715dd11 changeset: 33950:42361715dd11 user:Augie Fackler date:Tue Aug 22 15:49:54 2017 -0400 summary: tests: update test-command-template to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/335d45e74381 changeset: 33951:335d45e74381 user:Augie Fackler date:Tue Aug 22 15:50:01 2017 -0400 summary: tests: update test-commit to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/794f7bb739be changeset: 33952:794f7bb739be user:Augie Fackler date:Tue Aug 22 15:50:27 2017 -0400 summary: tests: update test-convert-clonebranches to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/90981271a904 changeset: 33953:90981271a904 user:Augie Fackler date:Tue Aug 22 15:50:35 2017 -0400 summary: tests: update test-debugcommands to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/b9765319880e changeset: 33954:b9765319880e user:Augie Fackler date:Tue Aug 22 15:50:59 2017 -0400 summary: tests: update test-dirstate to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/efa6a420ba57 changeset: 33955:efa6a420ba57 user:Augie Fackler date:Tue Aug 22 15:51:06 2017 -0400 summary: tests: update test-eol to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/1be228b96030 changeset: 33956:1be228b96030 user:Augie Fackler date:Tue Aug 22 15:51:12 2017 -0400 summary: tests: update test-fncache to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/04518bd58e8a changeset: 33957:04518bd58e8a user:Augie Fackler date:Tue Aug 22 15:51:18 2017 -0400 summary: tests: update test-glog to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/163b6b7f333c changeset: 33958:163b6b7f333c user:Augie Fackler date:Tue Aug 22 15:51:24 2017 -0400 summary: tests: update test-hardlinks to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/dc95caa1ec0d changeset: 33959:dc95caa1ec0d user:Augie Fackler date:Tue Aug 22 15:51:30 2017 -0400 summary: tests: update test-help to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/4d40fd0283d8 changeset: 33960:4d40fd0283d8 user:Augie Fackler date:Tue Aug 22 15:51:37 2017 -0400 summary: tests: update test-impexp-branch to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/237d2502ee6e changeset: 33961:237d2502ee6e user:Augie Fackler date:Tue Aug 22 15:51:47 2017 -0400 summary: tests: update test-keyword to pass our import checker https://www.mercurial-scm.org/repo/hg/rev/991134261057 changeset: 33962:991134261057 user:Augie Fackler date:Tue Aug 22 16:57:37 2017 -0400 summary: tests: upda
D530: obsolete: move merge logic on the smaller object
martinvonz added inline comments. INLINE COMMENTS > obsutil.py:568 > +for cand in candidate: > +for seensuccs in seen: > +if cand.canmerge(seensuccs): How long can "seen" get? Short enough that we don't care to make it a set? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D530 To: lothiraldan, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D544: releasenotes: update docstrings with information on additional flags
rishabhmadan96 updated this revision to Diff 1368. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D544?vs=1358&id=1368 REVISION DETAIL https://phab.mercurial-scm.org/D544 AFFECTED FILES hgext/releasenotes.py CHANGE DETAILS diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py --- a/hgext/releasenotes.py +++ b/hgext/releasenotes.py @@ -550,6 +550,32 @@ this command and changes should not be lost when running this command on that file. A particular use case for this is to tweak the wording of a release note after it has been added to the release notes file. + +With the -c/--check option, you can check the commit message for an invalid +admonition. In case of an invalid admonition, the flag returns the name of +admonition along with the changeset ID. For example:: + + .. abcd:: + + First paragraph under this admonition + +For the above commit message, using `hg releasenotes -r . --check` +returns: Invalid admonition 'abcd' present in changeset 3ea92981e103: + +Incase the invalid admonition is similar to the available admonitions upto +a certain threshold it suggests the correct admonition to you. For example:: + + .. fixes:: + + Fixes issue1234 + +For the above commit message, using `hg releasenotes -r . --check` +returns: Invalid admonition 'fixes' present in changeset 687be3ff87c6 +(did you mean fix?) + +With the -l/--list option, you will be presented with a list of the +existing available admonitions along with their title. This also includes +the custom admonitions (if any). """ sections = releasenotessections(ui, repo) if opts.get('list'): To: rishabhmadan96, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D545: releasenotes: update docstrings with information on additional flags
rishabhmadan96 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This patch adds documentation related to the two new flags --check and --list for releasenotes extension. https://phab.mercurial-scm.org/D544 REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D545 AFFECTED FILES hgext/releasenotes.py CHANGE DETAILS diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py --- a/hgext/releasenotes.py +++ b/hgext/releasenotes.py @@ -550,6 +550,32 @@ this command and changes should not be lost when running this command on that file. A particular use case for this is to tweak the wording of a release note after it has been added to the release notes file. + +With the -c/--check option, you can check the commit message for an invalid +admonition. In case of an invalid admonition, the flag returns the name of +admonition along with the changeset ID. For example:: + + .. abcd:: + + First paragraph under this admonition + +For the above commit message, using `hg releasenotes -r . --check` +returns: Invalid admonition 'abcd' present in changeset 3ea92981e103: + +Incase the invalid admonition is similar to the available admonitions upto +a certain threshold it suggests the correct admonition to you. For example:: + + .. fixes:: + + Fixes issue1234 + +For the above commit message, using `hg releasenotes -r . --check` +returns: Invalid admonition 'fixes' present in changeset 687be3ff87c6 +(did you mean fix?) + +With the -l/--list option, you will be presented with a list of the +existing available admonitions along with their title. This also includes +the custom admonitions (if any). """ sections = releasenotessections(ui, repo) if opts.get('list'): To: rishabhmadan96, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 7 of 9 V4] template: compute dates in obsfatedate
On Fri, 2017-08-25 at 23:08 +0900, Yuya Nishihara wrote: > On Wed, 23 Aug 2017 17:18:41 +0200, Boris Feld wrote: > > # HG changeset patch > > # User Boris Feld > > # Date 1499088850 -7200 > > # Mon Jul 03 15:34:10 2017 +0200 > > # Node ID b8b8b5bd728a5fb9fa847d56dd489c77a054b5ee > > # Parent fc257b24c35c492591f348b039d9e3f9488118a8 > > # EXP-Topic obsfatetemplate > > template: compute dates in obsfatedate > > > > Extract the dates from obsmarkers. Compute the min and max date > > from the > > obsmarker range list. > > > > diff -r fc257b24c35c -r b8b8b5bd728a mercurial/obsutil.py > > --- a/mercurial/obsutil.py Mon Jul 03 15:34:00 2017 +0200 > > +++ b/mercurial/obsutil.py Mon Jul 03 15:34:10 2017 +0200 > > @@ -587,6 +587,11 @@ > > > > return sorted(users) > > > > +def _markersdates(markers): > > +"""returns the list of dates for a list of markers > > +""" > > +return [m[4] for m in markers] > > + > > def successorsandmarkers(repo, ctx): > > """compute the raw data needed for computing obsfate > > Returns a list of dict, one dict per successors set > > diff -r fc257b24c35c -r b8b8b5bd728a mercurial/templater.py > > --- a/mercurial/templater.pyMon Jul 03 15:34:00 2017 +0200 > > +++ b/mercurial/templater.pyMon Jul 03 15:34:10 2017 +0200 > > @@ -888,6 +888,55 @@ > > data = obsutil._markersusers(markers) > > return templatekw._hybrid(None, data, lambda x: x, lambda d: > > d) > > > > +@templatefunc('obsfatedate(markers)') > > +def obsfatedate(context, mapping, args): > > +""" Compute obsfate related information based on markers > > + > > +(EXPERIMENTAL) > > +""" > > +if not len(args) == 1: > > +# i18n: "obsfatedate" is a keyword > > +raise error.ParseError(_("obsfatedate expects one > > arguments")) > > + > > +markers = evalfuncarg(context, mapping, args[0]) > > +if not isinstance(markers, collections.Iterable): > > +# i18n: "obsfatedate" is a keyword > > +errmsg = "obsfatedate first argument should be an > > iterable" > > +raise error.ParseError(errmsg) > > + > > +data = obsutil._markersdates(markers) > > +return templatekw._hybrid(None, data, lambda x: x, lambda d: > > d) > > Perhaps, hybridlist() can be used. I have send a V5 series with modifications according to your recommendations. Thank you very much for your reviews! I tried using hybrid list in obsfatedate but it seems to crash because obsmarker date are tuple. The end of the traceback is: +File ".../mercurial/mercurial/templatefilters.py", line 360, in stringify + return "".join([stringify(t) for t in thing if t is not None]) +File ".../mercurial/mercurial/templatekw.py", line 55, in _defaultgen + yield self.joinfmt(d) +File ".../mercurial/mercurial/templatekw.py", line 81, in + return _hybrid(gen, data, lambda x: {name: x}, lambda d: fmt % d[name]) + TypeError: not all arguments converted during string formatting + [1] It seems to be because of joinfmt and I'm not sure what would be the best way to workaround. > > > +@templatefunc('min(iterable)') > > +def tmplmin(context, mapping, args, **kwargs): > > Nit: the other functions are named as if_, dict_, etc., and roughly > sorted > alphabetically. > > > +""" Return the min of an iterable > > +""" > > +if not len(args) == 1: > > +# i18n: "min" is a keyword > > +raise error.ParseError(_("min expects one arguments")) > > + > > +iterable = evalfuncarg(context, mapping, args[0]) > > +if not isinstance(iterable, collections.Iterable): > > +# i18n: "obsfatedate" is a keyword > > ^ > Outdated comment. > > > +raise error.ParseError(_("min first argument should be an > > iterable")) > > + > > +return min(iterable) > > An empty list is also invalid. Perhaps we can catch TypeError and > ValueError instead of testing if the argument is an iterable. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D544: releasenotes: update docstrings with information on additional flags
rishabhmadan96 added inline comments. INLINE COMMENTS > durin42 wrote in releasenotes.py:555 > I'm not sure what the difference is between incorrect and invalid? It's just the same thing. I'll replace incorrect with invalid. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D544 To: rishabhmadan96, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 5 V5] template: compute verb in obsfateverb
# HG changeset patch # User Boris Feld # Date 1499088807 -7200 # Mon Jul 03 15:33:27 2017 +0200 # Node ID 3aa34cf79eafaf1f3831dbfcc0891e4432df780e # Parent e43264525ce513dab1ea23e39d2cf1051975c8ca # EXP-Topic obsfatetemplate template: compute verb in obsfateverb Add a template function obsfateverb which use the markers information to compute a better obsfate verb. The current logic behind the obsfate verb is simple for the moment: - If the successorsets is empty, the changeset has been pruned, for example: Obsfate: pruned - If the successorsets length is 1, the changeset has been rewritten without divergence, for example: Obsfate: rewritten as 2:337fec4d2edc, 3:f257fde29c7a - If the successorsets length is more than 1, the changeset has diverged, for example: Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a As the divergence might occurs on a subset of successors, we might see some successors twice: Obsfate: split as 9:0b997eb7ceee, 5:dd800401bd8c, 10:eceed8f98ffc; split as 8:b18bc8331526, 5:dd800401bd8c, 10:eceed8f98ffc diff -r e43264525ce5 -r 3aa34cf79eaf mercurial/obsutil.py --- a/mercurial/obsutil.py Tue Aug 22 23:39:05 2017 -0700 +++ b/mercurial/obsutil.py Mon Jul 03 15:33:27 2017 +0200 @@ -582,3 +582,14 @@ values.append({'successors': sset, 'markers': sset.markers}) return values + +def successorsetverb(successorset): +""" Return the verb summarizing the successorset +""" +if not successorset: +verb = 'pruned' +elif len(successorset) == 1: +verb = 'rewritten' +else: +verb = 'split' +return verb diff -r e43264525ce5 -r 3aa34cf79eaf mercurial/templater.py --- a/mercurial/templater.pyTue Aug 22 23:39:05 2017 -0700 +++ b/mercurial/templater.pyMon Jul 03 15:33:27 2017 +0200 @@ -18,6 +18,7 @@ encoding, error, minirst, +obsutil, parser, pycompat, registrar, @@ -849,6 +850,25 @@ func = lambda a, b: a % b return runarithmetic(context, mapping, (func, args[0], args[1])) +@templatefunc('obsfateverb(successors)') +def obsfateverb(context, mapping, args): +""" Compute obsfate related information based on successors + +(EXPERIMENTAL) +""" +if len(args) != 1: +# i18n: "obsfateverb" is a keyword +raise error.ParseError(_("obsfateverb expects one arguments")) + +successors = evalfuncarg(context, mapping, args[0]) + +try: +return obsutil.successorsetverb(successors) +except TypeError: +# i18n: "obsfateverb" is a keyword +errmsg = _("obsfateverb first argument should be countable") +raise error.ParseError(errmsg) + @templatefunc('relpath(path)') def relpath(context, mapping, args): """Convert a repository-absolute path into a filesystem path relative to diff -r e43264525ce5 -r 3aa34cf79eaf tests/test-obsmarker-template.t --- a/tests/test-obsmarker-template.t Tue Aug 22 23:39:05 2017 -0700 +++ b/tests/test-obsmarker-template.t Mon Jul 03 15:33:27 2017 +0200 @@ -13,7 +13,8 @@ > stabilization=all > [templates] > obsfatesuccessors = " as {join(successors, ", ")}" - > obsfate = "rewritten{obsfatesuccessors}; " + > obsfateverb = "{obsfateverb(successors)}" + > obsfate = "{obsfateverb}{obsfatesuccessors}; " > [alias] > tlog = log -G -T '{node|short}\ > {if(predecessors, "\n Predecessors: {predecessors}")}\ @@ -318,7 +319,7 @@ o 337fec4d2edc | | @ 471597cad322 - |/ Obsfate: rewritten as 2:337fec4d2edc, 3:f257fde29c7a; + |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a; o ea207398892e $ hg up f257fde29c7a @@ -359,7 +360,7 @@ o 337fec4d2edc | | x 471597cad322 - |/ Obsfate: rewritten as 2:337fec4d2edc, 3:f257fde29c7a; + |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a; o ea207398892e $ hg fatelogjson --hidden @@ -1528,7 +1529,7 @@ o dd800401bd8c | | x 9bd10a0775e4 - |/ Obsfate: rewritten as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a; + |/ Obsfate: split as 5:dd800401bd8c, 6:4a004186e638, 7:ba2ed02b0c9a; o f897c6137566 | | x 0dec01379d3b @@ -1603,7 +1604,7 @@ o dd800401bd8c | | @ 9bd10a0775e4 - |/ Obsfate: rewritten as 5:dd800401bd8c, 9:0b997eb7ceee, 10:eceed8f98ffc; rewritten as 5:dd800401bd8c, 8:b18bc8331526, 10:eceed8f98ffc; + |/ Obsfate: split as 5:dd800401bd8c, 9:0b997eb7ceee, 10:eceed8f98ffc; split as 5:dd800401bd8c, 8:b18bc8331526, 10:eceed8f98ffc; o f897c6137566 | o ea207398892e ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 4 of 5 V5] template: better prune support in obsfate
# HG changeset patch # User Boris Feld # Date 1499096336 -7200 # Mon Jul 03 17:38:56 2017 +0200 # Node ID c15be7a160739d986b1954364c7a231ce6b5cac2 # Parent 678a8ca41a5a83ea9a32e12a7aa2855271468c70 # EXP-Topic obsfatetemplate template: better prune support in obsfate successorssets don't returns good results for pruned commit, add a workaround for simple cases. A proper fix would require a large rework of successorssets algorithm, I will send a separate series for this refactoring. diff -r 678a8ca41a5a -r c15be7a16073 mercurial/obsutil.py --- a/mercurial/obsutil.py Mon Jul 03 15:34:10 2017 +0200 +++ b/mercurial/obsutil.py Mon Jul 03 17:38:56 2017 +0200 @@ -577,8 +577,40 @@ ssets = successorssets(repo, ctx.node(), closest=True) +# closestsuccessors returns an empty list for pruned revisions, remap it +# into a list containing an empty list for future processing +if ssets == []: +ssets = [[]] + +# Try to recover pruned markers +succsmap = repo.obsstore.successors +fullsuccessorsets = [] # successor set + markers +for sset in ssets: +if sset: +fullsuccessorsets.append(sset) +else: +# successorsset return an empty set() when ctx or one of its +# successors is pruned. +# In this case, walk the obs-markers tree again starting with ctx +# and find the relevant pruning obs-makers, the ones without +# successors. +# Having these markers allow us to compute some information about +# its fate, like who pruned this changeset and when. + +# XXX we do not catch all prune markers (eg rewritten then pruned) +# (fix me later) +foundany = False +for mark in succsmap.get(ctx.node(), ()): +if not mark[1]: +foundany = True +sset = _succs() +sset.markers.add(mark) +fullsuccessorsets.append(sset) +if not foundany: +fullsuccessorsets.append(_succs()) + values = [] -for sset in ssets: +for sset in fullsuccessorsets: values.append({'successors': sset, 'markers': sset.markers}) return values diff -r 678a8ca41a5a -r c15be7a16073 tests/test-obsmarker-template.t --- a/tests/test-obsmarker-template.t Mon Jul 03 15:34:10 2017 +0200 +++ b/tests/test-obsmarker-template.t Mon Jul 03 17:38:56 2017 +0200 @@ -12,7 +12,7 @@ > [experimental] > stabilization=all > [templates] - > obsfatesuccessors = " as {join(successors, ", ")}" + > obsfatesuccessors = "{if(successors, " as ")}{join(successors, ", ")}" > obsfateverb = "{obsfateverb(successors)}" > obsfateusers = "{if(obsfateusers(markers), " by {join(obsfateusers(markers), ", ")}")}" > obsfatedate = "{if(obsfatedate(markers), "{ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), " (at {min(obsfatedate(markers))|isodate})", " (between {min(obsfatedate(markers))|isodate} and {max(obsfatedate(markers))|isodate})")}")}" @@ -165,7 +165,7 @@ | @ a468dc9b3633 |/ Obsfate: rewritten as 4:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); | x f137d23bb3e1 - | | + | |Obsfate: pruned by test1 (at 2009-02-13 23:31 +); | x 471f378eab4c |/ Obsfate: rewritten as 3:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); o ea207398892e @@ -214,7 +214,7 @@ | x a468dc9b3633 |/ Obsfate: rewritten as 4:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); | x f137d23bb3e1 - | | + | |Obsfate: pruned by test1 (at 2009-02-13 23:31 +); | x 471f378eab4c |/ Obsfate: rewritten as 3:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); o ea207398892e @@ -225,7 +225,7 @@ | x a468dc9b3633 |/ Obsfate: [{"markers": [["a468dc9b36338b14fdb7825f55ce3df4e71517ad", ["d004c8f274b9ec480a47a93c10dac5eee63adb78"], 0, [["user", "test2"]], [987654321.0, 0], null]], "successors": ["d004c8f274b9ec480a47a93c10dac5eee63adb78"]}] | x f137d23bb3e1 - | | + | |Obsfate: [{"markers": [["f137d23bb3e11dc1daeb6264fac9cb2433782e15", [], 0, [["user", "test1"]], [1234567890.0, 0], ["471f378eab4c5e25f6c77f785b27c936efb22874"]]], "successors": []}] | x 471f378eab4c |/ Obsfate: [{"markers": [["471f378eab4c5e25f6c77f785b27c936efb22874", ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"], 0, [["user", "test1"]], [1234567890.0, 0], null]], "successors": ["a468dc9b36338b14fdb7825f55ce3df4e71517ad"]}] o ea207398892e @@ -1218,7 +1218,7 @@ o f897c6137566 | | @ 471f378eab4c - |/ + |/ Obsfate: pruned; o ea207398892e @@ -1635,11 +1635,11 @@ $ hg fatelog @ 471f378eab4c - | + |Obsfate: pruned by test (at 1970-01-01 00:00 +); o ea207398892e $ hg fatelog -v @ 471f378eab4c - | + |Obsfate: pruned by test (at 1970-01-01 00:00 +); o ea207398892e __
[PATCH 5 of 5 V5] test: add more obsmarker tests for pruning scenarios
# HG changeset patch # User Boris Feld # Date 1502986172 -7200 # Thu Aug 17 18:09:32 2017 +0200 # Node ID 6aebd9d54c492181bbf2f0e44fa8929662f9af06 # Parent c15be7a160739d986b1954364c7a231ce6b5cac2 # EXP-Topic obsfatetemplate test: add more obsmarker tests for pruning scenarios The obsfate output in cases of pruning is not ideal right now, add some tests so have these scenarios around. diff -r c15be7a16073 -r 6aebd9d54c49 tests/test-obsmarker-template.t --- a/tests/test-obsmarker-template.t Mon Jul 03 17:38:56 2017 +0200 +++ b/tests/test-obsmarker-template.t Thu Aug 17 18:09:32 2017 +0200 @@ -1643,3 +1643,138 @@ |Obsfate: pruned by test (at 1970-01-01 00:00 +); o ea207398892e +Test templates with multiple pruned commits +=== + +Test setup +-- + + $ hg init $TESTTMP/multiple-local-prune + $ cd $TESTTMP/multiple-local-prune + $ mkcommit ROOT + $ mkcommit A0 + $ hg commit --amend -m "A1" + $ hg debugobsolete --record-parent `getid "."` + obsoleted 1 changesets + + $ hg up -r "desc(A0)" --hidden + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg commit --amend -m "A2" + $ hg debugobsolete --record-parent `getid "."` + obsoleted 1 changesets + +Check output + + + $ hg up "desc(A0)" --hidden + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg tlog + @ 471f378eab4c + | + o ea207398892e + +# todo: the obsfate output is not ideal + $ hg fatelog + @ 471f378eab4c + |Obsfate: pruned; + o ea207398892e + + $ hg fatelog -v --hidden + x 65b757b745b9 + |Obsfate: pruned by test (at 1970-01-01 00:00 +); + | x fdf9bde5129a + |/ Obsfate: pruned by test (at 1970-01-01 00:00 +); + | @ 471f378eab4c + |/ Obsfate: rewritten as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +); rewritten as 3:65b757b745b9 by test (at 1970-01-01 00:00 +); + o ea207398892e + + +Test templates with splitted and pruned commit +== + + $ hg init $TESTTMP/templates-local-split-prune + $ cd $TESTTMP/templates-local-split-prune + $ mkcommit ROOT + $ echo 42 >> a + $ echo 43 >> b + $ hg commit -A -m "A0" + adding a + adding b + $ hg log --hidden -G + @ changeset: 1:471597cad322 + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +# Simulate split + $ hg up -r "desc(ROOT)" + 0 files updated, 0 files merged, 2 files removed, 0 files unresolved + $ echo 42 >> a + $ hg commit -A -m "A1" + adding a + created new head + $ echo 43 >> b + $ hg commit -A -m "A2" + adding b + $ hg debugobsolete `getid "1"` `getid "2"` `getid "3"` + obsoleted 1 changesets + +# Simulate prune + $ hg debugobsolete --record-parent `getid "."` + obsoleted 1 changesets + + $ hg log --hidden -G + @ changeset: 3:0d0ef4bdf70e + | tag: tip + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A2 + | + o changeset: 2:617adc3a144c + | parent: 0:ea207398892e + | user:test + | date:Thu Jan 01 00:00:00 1970 + + | summary: A1 + | + | x changeset: 1:471597cad322 + |/ user:test + |date:Thu Jan 01 00:00:00 1970 + + |summary: A0 + | + o changeset: 0:ea207398892e + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: ROOT + +Check templates +--- + + $ hg up 'desc("A0")' --hidden + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + +# todo: the obsfate output is not ideal + $ hg fatelog + o 617adc3a144c + | + | @ 471597cad322 + |/ Obsfate: pruned; + o ea207398892e + + $ hg up -r 'desc("A2")' --hidden + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + + $ hg fatelog --hidden + @ 0d0ef4bdf70e + |Obsfate: pruned by test (at 1970-01-01 00:00 +); + o 617adc3a144c + | + | x 471597cad322 + |/ Obsfate: split as 2:617adc3a144c, 3:0d0ef4bdf70e by test (at 1970-01-01 00:00 +); + o ea207398892e + ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 5 V5] template: compute dates in obsfatedate
# HG changeset patch # User Boris Feld # Date 1499088850 -7200 # Mon Jul 03 15:34:10 2017 +0200 # Node ID 678a8ca41a5a83ea9a32e12a7aa2855271468c70 # Parent 97f45f277a5877a1b1b0867cda800029c5a61493 # EXP-Topic obsfatetemplate template: compute dates in obsfatedate Extract the dates from obsmarkers. Compute the min and max date from the obsmarker range list. diff -r 97f45f277a58 -r 678a8ca41a5a mercurial/obsutil.py --- a/mercurial/obsutil.py Mon Jul 03 15:34:00 2017 +0200 +++ b/mercurial/obsutil.py Mon Jul 03 15:34:10 2017 +0200 @@ -594,6 +594,11 @@ verb = 'split' return verb +def markersdates(markers): +"""returns the list of dates for a list of markers +""" +return [m[4] for m in markers] + def markersusers(markers): """ Returns a sorted list of markers users without duplicates """ diff -r 97f45f277a58 -r 678a8ca41a5a mercurial/templater.py --- a/mercurial/templater.pyMon Jul 03 15:34:00 2017 +0200 +++ b/mercurial/templater.pyMon Jul 03 15:34:10 2017 +0200 @@ -840,6 +840,36 @@ tzoffset = util.makedate()[1] return (date[0], tzoffset) +@templatefunc('max(iterable)') +def max_(context, mapping, args, **kwargs): +""" Return the max of an iterable +""" +if len(args) != 1: +# i18n: "max" is a keyword +raise error.ParseError(_("max expects one arguments")) + +iterable = evalfuncarg(context, mapping, args[0]) +try: +return max(iterable) +except (TypeError, ValueError): +# i18n: "max" is a keyword +raise error.ParseError(_("max first argument should be an iterable")) + +@templatefunc('min(iterable)') +def min_(context, mapping, args, **kwargs): +""" Return the min of an iterable +""" +if len(args) != 1: +# i18n: "min" is a keyword +raise error.ParseError(_("min expects one arguments")) + +iterable = evalfuncarg(context, mapping, args[0]) +try: +return min(iterable) +except (TypeError, ValueError): +# i18n: "min" is a keyword +raise error.ParseError(_("min first argument should be an iterable")) + @templatefunc('mod(a, b)') def mod(context, mapping, args): """Calculate a mod b such that a / b + a mod b == a""" @@ -850,6 +880,26 @@ func = lambda a, b: a % b return runarithmetic(context, mapping, (func, args[0], args[1])) +@templatefunc('obsfatedate(markers)') +def obsfatedate(context, mapping, args): +""" Compute obsfate related information based on markers + +(EXPERIMENTAL) +""" +if len(args) != 1: +# i18n: "obsfatedate" is a keyword +raise error.ParseError(_("obsfatedate expects one arguments")) + +markers = evalfuncarg(context, mapping, args[0]) + +try: +data = obsutil.markersdates(markers) +return templatekw._hybrid(None, data, lambda x: x, lambda d: d) +except (TypeError, KeyError): +# i18n: "obsfatedate" is a keyword +errmsg = "obsfatedate first argument should be an iterable" +raise error.ParseError(errmsg) + @templatefunc('obsfateusers(markers)') def obsfateusers(context, mapping, args): """ Compute obsfate related information based on markers diff -r 97f45f277a58 -r 678a8ca41a5a tests/test-obsmarker-template.t --- a/tests/test-obsmarker-template.t Mon Jul 03 15:34:00 2017 +0200 +++ b/tests/test-obsmarker-template.t Mon Jul 03 15:34:10 2017 +0200 @@ -15,7 +15,8 @@ > obsfatesuccessors = " as {join(successors, ", ")}" > obsfateverb = "{obsfateverb(successors)}" > obsfateusers = "{if(obsfateusers(markers), " by {join(obsfateusers(markers), ", ")}")}" - > obsfate = "{obsfateverb}{obsfatesuccessors}{obsfateusers}; " + > obsfatedate = "{if(obsfatedate(markers), "{ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), " (at {min(obsfatedate(markers))|isodate})", " (between {min(obsfatedate(markers))|isodate} and {max(obsfatedate(markers))|isodate})")}")}" + > obsfate = "{obsfateverb}{obsfatesuccessors}{obsfateusers}{obsfatedate}; " > [alias] > tlog = log -G -T '{node|short}\ > {if(predecessors, "\n Predecessors: {predecessors}")}\ @@ -94,21 +95,21 @@ o d004c8f274b9 | | @ 471f378eab4c - |/ Obsfate: rewritten as 4:d004c8f274b9 by test1, test2; + |/ Obsfate: rewritten as 4:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); o ea207398892e $ hg fatelog o d004c8f274b9 | | @ 471f378eab4c - |/ Obsfate: rewritten as 4:d004c8f274b9 by test1, test2; + |/ Obsfate: rewritten as 4:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); o ea207398892e $ hg fatelog -v o d004c8f274b9 | | @ 471f378eab4c - |/ Obsfate: rewritten as 4:d004c8f274b9 by test1, test2; + |/ Obsfate: rewritten as 4:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); o ea207398892e $ hg up 'desc(A1)' --
[PATCH 2 of 5 V5] template: compute user in obsfateusers
# HG changeset patch # User Boris Feld # Date 1499088840 -7200 # Mon Jul 03 15:34:00 2017 +0200 # Node ID 97f45f277a5877a1b1b0867cda800029c5a61493 # Parent 3aa34cf79eafaf1f3831dbfcc0891e4432df780e # EXP-Topic obsfatetemplate template: compute user in obsfateusers Extract, deduplicate users informations from obs markers in order to display them. Print all users for the moment, we might want to display users only in verbose mode later. diff -r 3aa34cf79eaf -r 97f45f277a58 mercurial/obsutil.py --- a/mercurial/obsutil.py Mon Jul 03 15:33:27 2017 +0200 +++ b/mercurial/obsutil.py Mon Jul 03 15:34:00 2017 +0200 @@ -593,3 +593,11 @@ else: verb = 'split' return verb + +def markersusers(markers): +""" Returns a sorted list of markers users without duplicates +""" +markersmeta = [dict(m[3]) for m in markers] +users = set(meta.get('user') for meta in markersmeta if meta.get('user')) + +return sorted(users) diff -r 3aa34cf79eaf -r 97f45f277a58 mercurial/templater.py --- a/mercurial/templater.pyMon Jul 03 15:33:27 2017 +0200 +++ b/mercurial/templater.pyMon Jul 03 15:34:00 2017 +0200 @@ -850,6 +850,26 @@ func = lambda a, b: a % b return runarithmetic(context, mapping, (func, args[0], args[1])) +@templatefunc('obsfateusers(markers)') +def obsfateusers(context, mapping, args): +""" Compute obsfate related information based on markers + +(EXPERIMENTAL) +""" +if len(args) != 1: +# i18n: "obsfateusers" is a keyword +raise error.ParseError(_("obsfateusers expects one arguments")) + +markers = evalfuncarg(context, mapping, args[0]) + +try: +data = obsutil.markersusers(markers) +return templatekw.hybridlist(data, "users") +except (TypeError, KeyError, ValueError): +# i18n: "obsfateusers" is a keyword +msg = "obsfateusers first argument should be an iterable of obsmakers" +raise error.ParseError(msg) + @templatefunc('obsfateverb(successors)') def obsfateverb(context, mapping, args): """ Compute obsfate related information based on successors diff -r 3aa34cf79eaf -r 97f45f277a58 tests/test-obsmarker-template.t --- a/tests/test-obsmarker-template.t Mon Jul 03 15:33:27 2017 +0200 +++ b/tests/test-obsmarker-template.t Mon Jul 03 15:34:00 2017 +0200 @@ -14,7 +14,8 @@ > [templates] > obsfatesuccessors = " as {join(successors, ", ")}" > obsfateverb = "{obsfateverb(successors)}" - > obsfate = "{obsfateverb}{obsfatesuccessors}; " + > obsfateusers = "{if(obsfateusers(markers), " by {join(obsfateusers(markers), ", ")}")}" + > obsfate = "{obsfateverb}{obsfatesuccessors}{obsfateusers}; " > [alias] > tlog = log -G -T '{node|short}\ > {if(predecessors, "\n Predecessors: {predecessors}")}\ @@ -93,21 +94,21 @@ o d004c8f274b9 | | @ 471f378eab4c - |/ Obsfate: rewritten as 4:d004c8f274b9; + |/ Obsfate: rewritten as 4:d004c8f274b9 by test1, test2; o ea207398892e $ hg fatelog o d004c8f274b9 | | @ 471f378eab4c - |/ Obsfate: rewritten as 4:d004c8f274b9; + |/ Obsfate: rewritten as 4:d004c8f274b9 by test1, test2; o ea207398892e $ hg fatelog -v o d004c8f274b9 | | @ 471f378eab4c - |/ Obsfate: rewritten as 4:d004c8f274b9; + |/ Obsfate: rewritten as 4:d004c8f274b9 by test1, test2; o ea207398892e $ hg up 'desc(A1)' --hidden @@ -130,7 +131,7 @@ o d004c8f274b9 | | @ a468dc9b3633 - |/ Obsfate: rewritten as 4:d004c8f274b9; + |/ Obsfate: rewritten as 4:d004c8f274b9 by test2; o ea207398892e Predecessors template should show all the predecessors as we force their display @@ -161,11 +162,11 @@ o d004c8f274b9 | | @ a468dc9b3633 - |/ Obsfate: rewritten as 4:d004c8f274b9; + |/ Obsfate: rewritten as 4:d004c8f274b9 by test2; | x f137d23bb3e1 | | | x 471f378eab4c - |/ Obsfate: rewritten as 3:a468dc9b3633; + |/ Obsfate: rewritten as 3:a468dc9b3633 by test1; o ea207398892e @@ -210,14 +211,13 @@ @ d004c8f274b9 | | x a468dc9b3633 - |/ Obsfate: rewritten as 4:d004c8f274b9; + |/ Obsfate: rewritten as 4:d004c8f274b9 by test2; | x f137d23bb3e1 | | | x 471f378eab4c - |/ Obsfate: rewritten as 3:a468dc9b3633; + |/ Obsfate: rewritten as 3:a468dc9b3633 by test1; o ea207398892e - $ hg fatelogjson --hidden @ d004c8f274b9 | @@ -319,7 +319,7 @@ o 337fec4d2edc | | @ 471597cad322 - |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a; + |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a by test; o ea207398892e $ hg up f257fde29c7a @@ -360,7 +360,7 @@ o 337fec4d2edc | | x 471597cad322 - |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a; + |/ Obsfate: split as 2:337fec4d2edc, 3:f257fde29c7a by test; o ea207398892e $ hg fatelogjson --hidden @@ -461,7 +461,7 @@ o eb5a0daa2192 | | @ 471f378
D544: releasenotes: update docstrings with information on additional flags
durin42 added inline comments. INLINE COMMENTS > releasenotes.py:554 > + > +With -c/--check option, you can check the commit message for any invalid > +admonition. In case of an invalid admonition, the flag returns the name nit: "With the" instead of "With", "an" instead of "any" > releasenotes.py:555 > +With -c/--check option, you can check the commit message for any invalid > +admonition. In case of an invalid admonition, the flag returns the name > +of admonition along with the changeset ID. Incase the incorrect > admonition I'm not sure what the difference is between incorrect and invalid? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D544 To: rishabhmadan96, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D525: rebase: add a changes flag which will tell about the hash changes
durin42 requested changes to this revision. durin42 added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > pulkit wrote in rebase.py:487-488 > That looks like a nice idea, but since other outputs are repo.ui.* things and > as far as I know, they can be templated, so we are only left with hash change > output which we are adding. Definitely make these full hashes, and then have the default template for this output them as short hashes. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D525 To: pulkit, #hg-reviewers, durin42 Cc: durin42, quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D516: pull: do not prompt "hg update" if update.requiredest is set
This revision was automatically updated to reflect the committed changes. Closed by commit rHG8abbae93045a: pull: do not prompt "hg update" if update.requiredest is set (authored by quark). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D516?vs=1273&id=1365 REVISION DETAIL https://phab.mercurial-scm.org/D516 AFFECTED FILES mercurial/commands.py tests/test-update-dest.t CHANGE DETAILS diff --git a/tests/test-update-dest.t b/tests/test-update-dest.t --- a/tests/test-update-dest.t +++ b/tests/test-update-dest.t @@ -33,3 +33,16 @@ abort: update destination required by configuration (use hg pull followed by hg update DEST) [255] + + $ cd .. + +update.requiredest should silent the "hg update" text after pull + $ hg init repo1 + $ cd repo1 + $ hg pull ../repo + pulling from ../repo + requesting all changes + adding changesets + adding manifests + adding file changes + added 2 changesets with 2 changes to 1 files diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3849,7 +3849,7 @@ "merge)\n")) else: ui.status(_("(run 'hg heads' to see heads)\n")) -else: +elif not ui.configbool('commands', 'update.requiredest'): ui.status(_("(run 'hg update' to get a working copy)\n")) @command('^pull', To: quark, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D493: dirstate: perform transactions with _copymap using single call, where possible
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5cb0a8fe096e: dirstate: perform transactions with _copymap using single call, where possible (authored by mbolin). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D493?vs=1209&id=1366 REVISION DETAIL https://phab.mercurial-scm.org/D493 AFFECTED FILES mercurial/dirstate.py CHANGE DETAILS diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -406,13 +406,15 @@ # Discard 'm' markers when moving away from a merge state if s[0] == 'm': -if f in self._copymap: -copies[f] = self._copymap[f] +source = self._copymap.get(f) +if source: +copies[f] = source self.normallookup(f) # Also fix up otherparent markers elif s[0] == 'n' and s[2] == -2: -if f in self._copymap: -copies[f] = self._copymap[f] +source = self._copymap.get(f) +if source: +copies[f] = source self.add(f) return copies @@ -518,8 +520,7 @@ self._copymap[dest] = source self._updatedfiles.add(source) self._updatedfiles.add(dest) -elif dest in self._copymap: -del self._copymap[dest] +elif self._copymap.pop(dest, None): self._updatedfiles.add(dest) def copied(self, file): @@ -568,8 +569,7 @@ mtime = s.st_mtime self._addpath(f, 'n', s.st_mode, s.st_size & _rangemask, mtime & _rangemask) -if f in self._copymap: -del self._copymap[f] +self._copymap.pop(f, None) if f in self._nonnormalset: self._nonnormalset.remove(f) if mtime > self._lastnormaltime: @@ -597,8 +597,7 @@ if entry[0] == 'm' or entry[0] == 'n' and entry[2] == -2: return self._addpath(f, 'n', 0, -1, -1) -if f in self._copymap: -del self._copymap[f] +self._copymap.pop(f, None) if f in self._nonnormalset: self._nonnormalset.remove(f) @@ -613,15 +612,12 @@ else: # add-like self._addpath(f, 'n', 0, -2, -1) - -if f in self._copymap: -del self._copymap[f] +self._copymap.pop(f, None) def add(self, f): '''Mark a file added.''' self._addpath(f, 'a', 0, -1, -1) -if f in self._copymap: -del self._copymap[f] +self._copymap.pop(f, None) def remove(self, f): '''Mark a file removed.''' @@ -638,8 +634,8 @@ self._otherparentset.add(f) self._map[f] = dirstatetuple('r', 0, size, 0) self._nonnormalset.add(f) -if size == 0 and f in self._copymap: -del self._copymap[f] +if size == 0: +self._copymap.pop(f, None) def merge(self, f): '''Mark a file merged.''' @@ -655,8 +651,7 @@ del self._map[f] if f in self._nonnormalset: self._nonnormalset.remove(f) -if f in self._copymap: -del self._copymap[f] +self._copymap.pop(f, None) def _discoverpath(self, path, normed, ignoremissing, exists, storemap): if exists is None: To: mbolin, rdamazio, durin42, quark, #hg-reviewers, dsp Cc: dsp, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D514: phabsend: show associated Differential Revisions with --confirm
This revision was automatically updated to reflect the committed changes. Closed by commit rHG088598153aa2: phabsend: show associated Differential Revisions with --confirm (authored by quark). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D514?vs=1279&id=1363 REVISION DETAIL https://phab.mercurial-scm.org/D514 AFFECTED FILES contrib/phabricator.py CHANGE DETAILS diff --git a/contrib/phabricator.py b/contrib/phabricator.py --- a/contrib/phabricator.py +++ b/contrib/phabricator.py @@ -378,10 +378,13 @@ if opts.get('amend'): cmdutil.checkunfinished(repo) +# {newnode: (oldnode, olddiff, olddrev} +oldmap = getoldnodedrevmap(repo, [repo[r].node() for r in revs]) + confirm = ui.configbool('phabsend', 'confirm') confirm |= bool(opts.get('confirm')) if confirm: -confirmed = _confirmbeforesend(repo, revs) +confirmed = _confirmbeforesend(repo, revs, oldmap) if not confirmed: raise error.Abort(_('phabsend cancelled')) @@ -391,9 +394,6 @@ phids = userphids(repo, reviewers) actions.append({'type': 'reviewers.add', 'value': phids}) -# {newnode: (oldnode, olddiff, olddrev} -oldmap = getoldnodedrevmap(repo, [repo[r].node() for r in revs]) - drevids = [] # [int] diffmap = {} # {newnode: diff} @@ -474,14 +474,21 @@ _metanamemap = util.sortdict([(r'user', 'User'), (r'date', 'Date'), (r'node', 'Node ID'), (r'parent', 'Parent ')]) -def _confirmbeforesend(repo, revs): +def _confirmbeforesend(repo, revs, oldmap): url, token = readurltoken(repo) ui = repo.ui for rev in revs: ctx = repo[rev] desc = ctx.description().splitlines()[0] -ui.write(('%d: ' % rev), label='phabsend.revnumber') -ui.write(('%s\n' % desc), label='phabsend.desc') +oldnode, olddiff, drevid = oldmap.get(ctx.node(), (None, None, None)) +if drevid: +drevdesc = ui.label('D%s' % drevid, 'phabricator.drev') +else: +drevdesc = ui.label(_('NEW'), 'phabricator.drev') + +ui.write(_('%s - %s: %s\n') % (drevdesc, + ui.label(bytes(ctx), 'phabricator.node'), + ui.label(desc, 'phabricator.desc'))) if ui.promptchoice(_('Send the above changes to %s (yn)?' '$$ &Yes $$ &No') % url): To: quark, #hg-reviewers, indygreg, durin42 Cc: pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D513: phabsend: print the actual URL with --confirm
This revision was automatically updated to reflect the committed changes. Closed by commit rHGedeb8f28c031: phabsend: print the actual URL with --confirm (authored by quark). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D513?vs=1274&id=1362 REVISION DETAIL https://phab.mercurial-scm.org/D513 AFFECTED FILES contrib/phabricator.py CHANGE DETAILS diff --git a/contrib/phabricator.py b/contrib/phabricator.py --- a/contrib/phabricator.py +++ b/contrib/phabricator.py @@ -475,15 +475,16 @@ (r'node', 'Node ID'), (r'parent', 'Parent ')]) def _confirmbeforesend(repo, revs): +url, token = readurltoken(repo) ui = repo.ui for rev in revs: ctx = repo[rev] desc = ctx.description().splitlines()[0] ui.write(('%d: ' % rev), label='phabsend.revnumber') ui.write(('%s\n' % desc), label='phabsend.desc') -if ui.promptchoice(_('Phabsend the above changes (yn)?' -'$$ &Yes $$ &No')): +if ui.promptchoice(_('Send the above changes to %s (yn)?' + '$$ &Yes $$ &No') % url): return False return True To: quark, #hg-reviewers, indygreg, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D524: changelog: abort on attempt to write wdir revision
This revision was automatically updated to reflect the committed changes. Closed by commit rHG3939b30d0cb7: changelog: abort on attempt to write wdir revision (authored by martinvonz). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D524?vs=1320&id=1364 REVISION DETAIL https://phab.mercurial-scm.org/D524 AFFECTED FILES mercurial/changelog.py CHANGE DETAILS diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -14,6 +14,7 @@ bin, hex, nullid, +wdirid, ) from . import ( @@ -535,6 +536,9 @@ # overlay over the standard revlog._addrevision to track the new # revision on the transaction. rev = len(self) +if node == wdirid: # nullid is checked in super method +raise error.RevlogError(_("%s: attempt to add wdir revision") % +(self.indexfile)) node = super(changelog, self)._addrevision(node, rawtext, transaction, *args, **kwargs) revs = transaction.changes.get('revs') To: martinvonz, #hg-reviewers, quark, durin42 Cc: durin42, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D510: phabsend: polish the docstring a bit
This revision was automatically updated to reflect the committed changes. Closed by commit rHG45a8cd74de4e: phabsend: polish the docstring a bit (authored by quark). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D510?vs=1267&id=1359 REVISION DETAIL https://phab.mercurial-scm.org/D510 AFFECTED FILES contrib/phabricator.py CHANGE DETAILS diff --git a/contrib/phabricator.py b/contrib/phabricator.py --- a/contrib/phabricator.py +++ b/contrib/phabricator.py @@ -362,10 +362,10 @@ The --confirm option lets you confirm changesets before sending them. You can also add following to your configuration file to make it default -behaviour. +behaviour:: -[phabsend] -confirm = true +[phabsend] +confirm = true phabsend will check obsstore and the above association to decide whether to update an existing Differential Revision, or create a new one. To: quark, #hg-reviewers, indygreg, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D511: phabsend: make --amend the default
This revision was automatically updated to reflect the committed changes. Closed by commit rHG07841863: phabsend: make --amend the default (authored by quark). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D511?vs=1268&id=1360 REVISION DETAIL https://phab.mercurial-scm.org/D511 AFFECTED FILES contrib/phabricator.py CHANGE DETAILS diff --git a/contrib/phabricator.py b/contrib/phabricator.py --- a/contrib/phabricator.py +++ b/contrib/phabricator.py @@ -7,9 +7,9 @@ """simple Phabricator integration This extension provides a ``phabsend`` command which sends a stack of -changesets to Phabricator without amending commit messages, and a ``phabread`` -command which prints a stack of revisions in a format suitable -for :hg:`import`, and a ``phabupdate`` command to update statuses in batch. +changesets to Phabricator, and a ``phabread`` command which prints a stack of +revisions in a format suitable for :hg:`import`, and a ``phabupdate`` command +to update statuses in batch. By default, Phabricator requires ``Test Plan`` which might prevent some changeset from being sent. The requirement could be disabled by changing @@ -339,7 +339,7 @@ @command('phabsend', [('r', 'rev', [], _('revisions to send'), _('REV')), - ('', 'amend', False, _('update commit messages')), + ('', 'amend', True, _('update commit messages')), ('', 'reviewer', [], _('specify reviewers')), ('', 'confirm', None, _('ask for confirmation before sending'))], _('REV [OPTIONS]')) To: quark, #hg-reviewers, indygreg, durin42 Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D512: phabsend: detect patch change with larger context
This revision was automatically updated to reflect the committed changes. Closed by commit rHG27ff2a87d8c0: phabsend: detect patch change with larger context (authored by quark). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D512?vs=1269&id=1361 REVISION DETAIL https://phab.mercurial-scm.org/D512 AFFECTED FILES contrib/phabricator.py CHANGE DETAILS diff --git a/contrib/phabricator.py b/contrib/phabricator.py --- a/contrib/phabricator.py +++ b/contrib/phabricator.py @@ -274,7 +274,7 @@ """ repo = ctx.repo() if oldnode: -diffopts = mdiff.diffopts(git=True, context=1) +diffopts = mdiff.diffopts(git=True, context=32767) oldctx = repo.unfiltered()[oldnode] neednewdiff = (getdiff(ctx, diffopts) != getdiff(oldctx, diffopts)) else: To: quark, #hg-reviewers, indygreg, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D464: commit: use an unambiguous path suffix for the commit editor file
durin42 requested changes to this revision. durin42 added inline comments. INLINE COMMENTS > cmdutil.py:3214 > +extra = ctx.extra() > +extra['suffix'] = '.hgcommit.txt' > + I agree with smf: this patch is accomplishing a reasonable thing, but we should clean up this interface if we're going to use it. Let's add an action= parameter that's optional in the 4.4 cycle, with a devel warning if it's not specified. Then in 4.4 we can make it a mandatory parameter for ui.edit(). Right now the only client of this poke-something-in-extra API is histedit, so the time is right to clean up the API before more consumers do silly things. For your immediate goal in this patch, here's what I'd suggest as a compromise: 1. Add the new action=None business to ui.edit(), which then makes suffix='.hg$ACTION.txt' or similar 2. Update histedit to use that instead of screwing around with 'suffix' in extra 3. Remove support for 'suffix' in extra 4. Do this patch, but with action='commit' instead of poking '.hgcommit.txt' in the extra How does that sound to everyone? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D464 To: mbolin, quark, durin42, #hg-reviewers, ryanmce Cc: smf, ryanmce, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D544: releasenotes: update docstrings with information on additional flags
rishabhmadan96 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This patch adds documentation related to the two new flags --check and --list for releasenotes extension. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D544 AFFECTED FILES hgext/releasenotes.py CHANGE DETAILS diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py --- a/hgext/releasenotes.py +++ b/hgext/releasenotes.py @@ -550,6 +550,31 @@ this command and changes should not be lost when running this command on that file. A particular use case for this is to tweak the wording of a release note after it has been added to the release notes file. + +With -c/--check option, you can check the commit message for any invalid +admonition. In case of an invalid admonition, the flag returns the name +of admonition along with the changeset ID. Incase the incorrect admonition +is similar to the available admonitions upto a certain threshold, it +suggests the correct admonition to you. + +.. abcd:: + + First paragraph under this admonition + +For the above commit message, using `hg releasenotes -r . --check` +returns: Invalid admonition 'abcd' present in changeset 3ea92981e103 + +.. fixes:: + + Fixes issue1234 + +For the above commit message, using `hg releasenotes -r . --check` +returns: Invalid admonition 'fixes' present in changeset 687be3ff87c6 +(did you mean fix?) + +With -l/--list option, you will be presented with a list of the existing +available admonitions along with their title. This also includes the +custom admonitions (if any). """ sections = releasenotessections(ui, repo) if opts.get('list'): To: rishabhmadan96, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] record: make m key open an editor for the commit message (issue5667)
On 08/28/2017 08:15 PM, Augie Fackler wrote: > >> On Aug 28, 2017, at 14:13, Augie Fackler wrote: >> >> Your patch looks good, but I'm unable to apply it. Did you mail this by >> pasting into your mail client instead of using `hg email`? > > While writing this reply I spotted the damage to the patch from your mailer > and was able to un-do it, so your patch is queued, thanks! > > In the future please be aware that mail clients do terrible things to > patches. :/ Sorry for that. I already recognized that after sending the mail. I'll do better next time :) >> >>> On Aug 28, 2017, at 08:21, Peter Vitt wrote: >>> >>> # HG changeset patch >>> # User Peter Vitt >>> # Date 1503920611 -7200 >>> # Mon Aug 28 13:43:31 2017 +0200 >>> # Node ID 22ab2b29950a783a5ee52b20693a0b4f9c174fae >>> # Parent 4e8a46c25facaebca476634d52dd78431d3143e8 >>> record: make the m key open an editor for the commit message (issue5667) >>> >>> With the former crecord extension, the user could edit the commit >>> message while he was de-/selecting hunks. By pressing 'm', an editor >>> showed up to edit the commit message. >>> >>> With record being part of mercurial, this feature is not available >>> anymore. However, the help text still mentions it. >>> >>> As the infrastructure needed is still present, this feature is quite >>> easily ported from the crecord extension to mercurial. >>> >>> It seems there is no test coverage for record ui, so I tested this patch >>> manually on my local machine. >>> >>> diff -r 4e8a46c25fac -r 22ab2b29950a mercurial/crecord.py >>> --- a/mercurial/crecord.py Tue Aug 22 11:00:00 2017 +0200 >>> +++ b/mercurial/crecord.py Mon Aug 28 13:43:31 2017 +0200 >>> @@ -1440,6 +1440,17 @@ >>>except curses.error: >>>pass >>> >>> +def commitMessageWindow(self): >>> +"Create a temporary commit message editing window on the screen." >>> + >>> +curses.raw() >>> +curses.def_prog_mode() >>> +curses.endwin() >>> +self.commenttext = self.ui.edit(self.commenttext, >>> self.ui.username()) >>> +curses.cbreak() >>> +self.stdscr.refresh() >>> +self.stdscr.keypad(1) # allow arrow-keys to continue to function >>> + >>>def confirmationwindow(self, windowtext): >>>"display an informational window, then wait for and return a >>> keypress." >>> >>> @@ -1661,6 +1672,8 @@ >>>self.togglefolded() >>>elif keypressed in ["F"]: >>>self.togglefolded(foldparent=True) >>> +elif keypressed in ["m"]: >>> +self.commitMessageWindow() >>>elif keypressed in ["?"]: >>>self.helpwindow() >>>self.stdscr.clear() >>> @@ -1736,3 +1749,8 @@ >>>keypressed = "foobar" >>>if self.handlekeypressed(keypressed): >>>break >>> + >>> +if self.commenttext != "": >>> +whitespaceremoved = re.sub("(?m)^\s.*(\n|$)", "", >>> self.commenttext) >>> +if whitespaceremoved != "": >>> +self.opts['message'] = self.commenttext >>> ___ >>> Mercurial-devel mailing list >>> Mercurial-devel@mercurial-scm.org >>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel >> > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D369: util: add `hgdatetopython` to convert hg-style dates to datetimes
durin42 requested changes to this revision. durin42 added inline comments. This revision now requires changes to proceed. INLINE COMMENTS > phillco wrote in util.py:1862 > https://phab.mercurial-scm.org/rHG87c6ad2251d8703d7f16d51e99e3d1c040f0be49 -- > it linkifies if you don't use backtics, apparently So, having reflected on this a bit: I'm too wary of the naive datetime. I think the easiest fix for this would be for us to have our own datetime.tzinfo implementation and then include that when we construct the datetime so we don't lose the zone offset information. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D369 To: phillco, #hg-reviewers, durin42 Cc: durin42, lothiraldan, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D524: changelog: abort on attempt to write wdir revision
durin42 accepted this revision. durin42 added a comment. This revision is now accepted and ready to land. I like yuya's suggestion, but this seems like it stands to prevent bugs now, so I'll land it and we can continue with a followup in the revlog layer. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D524 To: martinvonz, #hg-reviewers, quark, durin42 Cc: durin42, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 4 of 4] client: raise ResponseError in _readchannel()
On Mon, Aug 21, 2017 at 06:06:23PM +0200, Gábor Stefanik wrote: > # HG changeset patch > # User Gábor Stefanik > # Date 1503328417 -7200 > # Mon Aug 21 17:13:37 2017 +0200 > # Node ID 6f59b1f3360d599dfe66cf509bbde926d87ebe5e > # Parent 8b4d606b49655d44091c2689a3f35a3fff17a28d > client: raise ResponseError in _readchannel() Hmmm, I'm trying to apply these and I'm getting failed hunks in this first patch. Can you resend? (Sorry about the delay and the trouble.) > > Make it clearer that this is an unrecoverable communication error. > ServerError alone is not always unrecoverable, as CapabilityError is > considered > a subtype of it. > > This way, a caller can check for ResponseError to identify errors that require > reopening the client to recover. > > diff -r 8b4d606b4965 -r 6f59b1f3360d hglib/client.py > --- a/hglib/client.py Mon Aug 21 17:06:13 2017 +0200 > +++ b/hglib/client.py Mon Aug 21 17:13:37 2017 +0200 > @@ -140,7 +140,7 @@ > data = self.server.stdout.read(hgclient.outputfmtsize) > if not data: > self.close() > -raise error.ServerError() > +raise error.ResponseError('no response received from server') > channel, length = struct.unpack(hgclient.outputfmt, data) > if channel in b('IL'): > return channel, length > > This message, including its attachments, is confidential and the property of > NNG Llc. For more information please read NNG's email policy here: > http://www.nng.com/emailpolicy/ > By responding to this email you accept the email policy. > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 4 of 4] client: raise ResponseError in _readchannel()
On Mon, Aug 21, 2017 at 06:06:23PM +0200, Gábor Stefanik wrote: > # HG changeset patch > # User Gábor Stefanik > # Date 1503328417 -7200 > # Mon Aug 21 17:13:37 2017 +0200 > # Node ID 6f59b1f3360d599dfe66cf509bbde926d87ebe5e > # Parent 8b4d606b49655d44091c2689a3f35a3fff17a28d > client: raise ResponseError in _readchannel() queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH hglib] summary: parse commit line less strictly (issue5637)
On Wed, Aug 02, 2017 at 11:52:39PM +0900, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara > # Date 1501684996 -32400 > # Wed Aug 02 23:43:16 2017 +0900 > # Node ID 5f3e6f1a7e68298e21f893683c5b5d3f634c2c30 > # Parent 8e959ad6a25c9fe6ab490e1a4cbd5f7445d9bcb1 > summary: parse commit line less strictly (issue5637) queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH hglib] package: update package url
On Wed, Jul 19, 2017 at 03:25:42PM +0200, Boris Feld wrote: > # HG changeset patch > # User Boris Feld > # Date 1500468520 -7200 > # Wed Jul 19 14:48:40 2017 +0200 > # Node ID d06b480016620be412ee3eee45822fdd3062fc0f > # Parent 8e959ad6a25c9fe6ab490e1a4cbd5f7445d9bcb1 > package: update package url queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@33940: 51 new changesets
51 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/3de9a2df6411 changeset: 33890:3de9a2df6411 user:Augie Fackler date:Tue Aug 22 12:59:21 2017 -0400 summary: contrib: have import-checker work mostly with native strings for mod names https://www.mercurial-scm.org/repo/hg/rev/42bc7f39376b changeset: 33891:42bc7f39376b user:Augie Fackler date:Tue Aug 22 14:11:48 2017 -0400 summary: contrib: update hg-ssh to conform with import style checks https://www.mercurial-scm.org/repo/hg/rev/78f644fdaa2a changeset: 33892:78f644fdaa2a user:Augie Fackler date:Tue Aug 22 14:12:03 2017 -0400 summary: hgperf: update to conform with import style checks https://www.mercurial-scm.org/repo/hg/rev/c9cf69d0c3b9 changeset: 33893:c9cf69d0c3b9 user:Augie Fackler date:Tue Aug 22 14:12:21 2017 -0400 summary: contrib: allow importing "symbols" from mercurial https://www.mercurial-scm.org/repo/hg/rev/c856cb1c29be changeset: 33894:c856cb1c29be user:Augie Fackler date:Tue Aug 22 14:12:37 2017 -0400 summary: contrib: inform import checker that __builtin__ is a thing https://www.mercurial-scm.org/repo/hg/rev/aed91971d88c changeset: 33895:aed91971d88c user:Augie Fackler date:Tue Aug 22 14:13:13 2017 -0400 summary: simplemerge: update to conform with modern import conventions https://www.mercurial-scm.org/repo/hg/rev/1900381b6a6e changeset: 33896:1900381b6a6e user:Augie Fackler date:Tue Aug 22 14:14:19 2017 -0400 summary: hg: update top-level script to use modern import conventions https://www.mercurial-scm.org/repo/hg/rev/b4294ff13392 changeset: 33897:b4294ff13392 user:Augie Fackler date:Tue Aug 22 16:02:57 2017 -0400 summary: contrib: always treat importlib.* as stdlib https://www.mercurial-scm.org/repo/hg/rev/3595e4e0ae57 changeset: 33898:3595e4e0ae57 user:Augie Fackler date:Tue Aug 22 14:14:34 2017 -0400 summary: demandimportpy3: update to pass import checker https://www.mercurial-scm.org/repo/hg/rev/078099304772 changeset: 33899:078099304772 user:Augie Fackler date:Tue Aug 22 14:14:52 2017 -0400 summary: i18n: update check-translation script to pass import checker https://www.mercurial-scm.org/repo/hg/rev/10f1809ab98f changeset: 33900:10f1809ab98f user:David Demelier date:Mon Aug 21 08:52:46 2017 +0200 summary: bookmarks: allow renaming active bookmark using '.' https://www.mercurial-scm.org/repo/hg/rev/f488223a87ab changeset: 33901:f488223a87ab user:Phil Cohen date:Thu Aug 24 21:26:40 2017 -0700 summary: context: add `decodeddata()` to basefilectx https://www.mercurial-scm.org/repo/hg/rev/f39ba8237ed6 changeset: 33902:f39ba8237ed6 user:Phil Cohen date:Thu Aug 24 21:26:40 2017 -0700 summary: simplemerge: use `ctx.decoddeddata()` instead of `repo.wreaddata` https://www.mercurial-scm.org/repo/hg/rev/ed6f64173121 changeset: 33903:ed6f64173121 user:Phil Cohen date:Thu Aug 24 21:30:37 2017 -0700 summary: contrib: make simplemerge script pass context-like objects https://www.mercurial-scm.org/repo/hg/rev/1915a5e809ca changeset: 33904:1915a5e809ca user:Phil Cohen date:Thu Aug 24 21:30:37 2017 -0700 summary: simplemerge: use context paths for default labels instead of file paths https://www.mercurial-scm.org/repo/hg/rev/61b267a99fea changeset: 33905:61b267a99fea user:Phil Cohen date:Thu Aug 24 21:30:37 2017 -0700 summary: simplemerge: stop reading from, and writing to, files https://www.mercurial-scm.org/repo/hg/rev/fa6309c5761d changeset: 33906:fa6309c5761d user:Phil Cohen date:Thu Aug 24 21:30:51 2017 -0700 summary: simplemerge: stop accepting, and passing, file parameters https://www.mercurial-scm.org/repo/hg/rev/1ad3085239ad changeset: 33907:1ad3085239ad user:Phil Cohen date:Thu Aug 24 21:30:51 2017 -0700 summary: simplemerge: make context parameters non-optional https://www.mercurial-scm.org/repo/hg/rev/4074de97b512 changeset: 33908:4074de97b512 user:Phil Cohen date:Thu Aug 24 21:30:51 2017 -0700 summary: simplemerge: simplify code now that we always write to a context https://www.mercurial-scm.org/repo/hg/rev/84f72072bde6 changeset: 33909:84f72072bde6 user:Boris Feld date:Mon Jul 03 00:53:55 2017 +0200 summary: obsolete: introduce a _succs class https://www.mercurial-scm.org/repo/hg/rev/dba493981284 changeset: 33910:dba493981284 user:Boris Feld date:Mon Jul 03 03:13:17 2017 +0200 summary: obsolete: add an explicit '_succs.copy()' method https://www.mercurial-scm.org/repo/hg/rev/34e10e09afa5 changeset: 33911:34e10e09afa5 user:Boris Feld date:Mon Jul 03 03:27:58 2017 +0200 summary: obsolete: track ma
Re: [PATCH] record: make m key open an editor for the commit message (issue5667)
> On Aug 28, 2017, at 14:13, Augie Fackler wrote: > > Your patch looks good, but I'm unable to apply it. Did you mail this by > pasting into your mail client instead of using `hg email`? While writing this reply I spotted the damage to the patch from your mailer and was able to un-do it, so your patch is queued, thanks! In the future please be aware that mail clients do terrible things to patches. :/ > >> On Aug 28, 2017, at 08:21, Peter Vitt wrote: >> >> # HG changeset patch >> # User Peter Vitt >> # Date 1503920611 -7200 >> # Mon Aug 28 13:43:31 2017 +0200 >> # Node ID 22ab2b29950a783a5ee52b20693a0b4f9c174fae >> # Parent 4e8a46c25facaebca476634d52dd78431d3143e8 >> record: make the m key open an editor for the commit message (issue5667) >> >> With the former crecord extension, the user could edit the commit >> message while he was de-/selecting hunks. By pressing 'm', an editor >> showed up to edit the commit message. >> >> With record being part of mercurial, this feature is not available >> anymore. However, the help text still mentions it. >> >> As the infrastructure needed is still present, this feature is quite >> easily ported from the crecord extension to mercurial. >> >> It seems there is no test coverage for record ui, so I tested this patch >> manually on my local machine. >> >> diff -r 4e8a46c25fac -r 22ab2b29950a mercurial/crecord.py >> --- a/mercurial/crecord.py Tue Aug 22 11:00:00 2017 +0200 >> +++ b/mercurial/crecord.py Mon Aug 28 13:43:31 2017 +0200 >> @@ -1440,6 +1440,17 @@ >>except curses.error: >>pass >> >> +def commitMessageWindow(self): >> +"Create a temporary commit message editing window on the screen." >> + >> +curses.raw() >> +curses.def_prog_mode() >> +curses.endwin() >> +self.commenttext = self.ui.edit(self.commenttext, >> self.ui.username()) >> +curses.cbreak() >> +self.stdscr.refresh() >> +self.stdscr.keypad(1) # allow arrow-keys to continue to function >> + >>def confirmationwindow(self, windowtext): >>"display an informational window, then wait for and return a >> keypress." >> >> @@ -1661,6 +1672,8 @@ >>self.togglefolded() >>elif keypressed in ["F"]: >>self.togglefolded(foldparent=True) >> +elif keypressed in ["m"]: >> +self.commitMessageWindow() >>elif keypressed in ["?"]: >>self.helpwindow() >>self.stdscr.clear() >> @@ -1736,3 +1749,8 @@ >>keypressed = "foobar" >>if self.handlekeypressed(keypressed): >>break >> + >> +if self.commenttext != "": >> +whitespaceremoved = re.sub("(?m)^\s.*(\n|$)", "", >> self.commenttext) >> +if whitespaceremoved != "": >> +self.opts['message'] = self.commenttext >> ___ >> Mercurial-devel mailing list >> Mercurial-devel@mercurial-scm.org >> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] record: make m key open an editor for the commit message (issue5667)
Your patch looks good, but I'm unable to apply it. Did you mail this by pasting into your mail client instead of using `hg email`? > On Aug 28, 2017, at 08:21, Peter Vitt wrote: > > # HG changeset patch > # User Peter Vitt > # Date 1503920611 -7200 > # Mon Aug 28 13:43:31 2017 +0200 > # Node ID 22ab2b29950a783a5ee52b20693a0b4f9c174fae > # Parent 4e8a46c25facaebca476634d52dd78431d3143e8 > record: make the m key open an editor for the commit message (issue5667) > > With the former crecord extension, the user could edit the commit > message while he was de-/selecting hunks. By pressing 'm', an editor > showed up to edit the commit message. > > With record being part of mercurial, this feature is not available > anymore. However, the help text still mentions it. > > As the infrastructure needed is still present, this feature is quite > easily ported from the crecord extension to mercurial. > > It seems there is no test coverage for record ui, so I tested this patch > manually on my local machine. > > diff -r 4e8a46c25fac -r 22ab2b29950a mercurial/crecord.py > --- a/mercurial/crecord.py Tue Aug 22 11:00:00 2017 +0200 > +++ b/mercurial/crecord.py Mon Aug 28 13:43:31 2017 +0200 > @@ -1440,6 +1440,17 @@ > except curses.error: > pass > > +def commitMessageWindow(self): > +"Create a temporary commit message editing window on the screen." > + > +curses.raw() > +curses.def_prog_mode() > +curses.endwin() > +self.commenttext = self.ui.edit(self.commenttext, > self.ui.username()) > +curses.cbreak() > +self.stdscr.refresh() > +self.stdscr.keypad(1) # allow arrow-keys to continue to function > + > def confirmationwindow(self, windowtext): > "display an informational window, then wait for and return a > keypress." > > @@ -1661,6 +1672,8 @@ > self.togglefolded() > elif keypressed in ["F"]: > self.togglefolded(foldparent=True) > +elif keypressed in ["m"]: > +self.commitMessageWindow() > elif keypressed in ["?"]: > self.helpwindow() > self.stdscr.clear() > @@ -1736,3 +1749,8 @@ > keypressed = "foobar" > if self.handlekeypressed(keypressed): > break > + > +if self.commenttext != "": > +whitespaceremoved = re.sub("(?m)^\s.*(\n|$)", "", > self.commenttext) > +if whitespaceremoved != "": > +self.opts['message'] = self.commenttext > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: Accessing hidden commits by hash (directaccess extension)
> On Aug 28, 2017, at 13:13, Durham Goode wrote: > > > > On 8/27/17 6:51 PM, Augie Fackler wrote: >> On Fri, Aug 25, 2017 at 11:26:05AM -0700, Durham Goode wrote: >> [...] >>> Preventing Mistakes >>> === >>> >>> One of the reasons for preventing users from accessing hidden commits is to >>> prevent them from doing bad things with them (like pushing them, or amending >>> them and causing divergence). To address this, directaccess treats read >>> commands, recoverable-write commands, and unrecoverable-write commands >>> separately. >>> >>> For read commands (a whitelist of commands in the code), it allows the user >>> to access the commit like normal. >>> >>> For recoverable-write commands, like commit/amend/rebase, it prints >>> "Warning: accessing hidden changesets %s for write operation". >>> >>> For unrecoverable-write commands (a whitelist), like push and serve, it >>> blocks the command like normal, with the 'abort: hidden revision' error. >> >> It sounds like you whitelist read and unrecoverable-write >> commands. Does that mean "ercoverable-write" commands are inferred >> from not being in those two whitelists? How has that interacted with >> users finding random extensions or defining custom aliases? > > Yea, the default behavior is warn-the-user. Very, very few of our users have > ever enabled random extensions so that has not been an issue. Hm, okay. Then one thing we should probably do is hoist these lists into core, and make it so they're trivial to amend so that out-of-tree extensions can correctly categorize their behavior. I'd imagine this could have other value, so maybe it should be in the @command decorator? > > As for custom aliases, I believe directaccess hooks in at the command > function level, so it doesn't matter what you type at the command line, as > long as it invokes the command function. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 5670] New: Shortcut cmd to histedit tip
https://bz.mercurial-scm.org/show_bug.cgi?id=5670 Bug ID: 5670 Summary: Shortcut cmd to histedit tip Product: Mercurial Version: 4.3 Hardware: All OS: All Status: UNCONFIRMED Severity: feature Priority: wish Component: histedit Assignee: bugzi...@mercurial-scm.org Reporter: dinumar...@gmail.com CC: mercurial-devel@mercurial-scm.org We use very often the histedit to just edit the tip revision. There is no un-cumbersome way to do this: hg histedit -r tip type "edit", save We tried using --commands with a file containing "edit tip", but it seems it doesn't parse revision names, so we need to make a special tool just to run histedit for tip. It would be nice if the cmdline for histedit would allow for a shorthand to edit a single revision -- 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
Re: Accessing hidden commits by hash (directaccess extension)
On 8/27/17 6:51 PM, Augie Fackler wrote: On Fri, Aug 25, 2017 at 11:26:05AM -0700, Durham Goode wrote: [...] Preventing Mistakes === One of the reasons for preventing users from accessing hidden commits is to prevent them from doing bad things with them (like pushing them, or amending them and causing divergence). To address this, directaccess treats read commands, recoverable-write commands, and unrecoverable-write commands separately. For read commands (a whitelist of commands in the code), it allows the user to access the commit like normal. For recoverable-write commands, like commit/amend/rebase, it prints "Warning: accessing hidden changesets %s for write operation". For unrecoverable-write commands (a whitelist), like push and serve, it blocks the command like normal, with the 'abort: hidden revision' error. It sounds like you whitelist read and unrecoverable-write commands. Does that mean "ercoverable-write" commands are inferred from not being in those two whitelists? How has that interacted with users finding random extensions or defining custom aliases? Yea, the default behavior is warn-the-user. Very, very few of our users have ever enabled random extensions so that has not been an issue. As for custom aliases, I believe directaccess hooks in at the command function level, so it doesn't matter what you type at the command line, as long as it invokes the command function. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D472: extensions: make wrapfunction() return a context manager
quark added inline comments. INLINE COMMENTS > yuja wrote in extensions.py:424 > I see, but I don't think it's more common than wrapping a plain > function. > > If the compatibility matters, we probably shouldn't replace > `wrapfunction` with a context manager. I think using the return value of wrapfunction could lead to hidden bugs: oldfunc = wrapfunction(x, 'y', newfunc) ... # what if somebody else wraps x.y here? ... x.y = oldfunc So it seems reasonable to me to deprecate that and migrate users to `unwrapfunction`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D472 To: martinvonz, #hg-reviewers, quark, mjpieters Cc: yuja, lothiraldan, quark, mjpieters, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 5669] New: hg qrefresh loses graft metadata
https://bz.mercurial-scm.org/show_bug.cgi?id=5669 Bug ID: 5669 Summary: hg qrefresh loses graft metadata Product: Mercurial Version: 4.3 Hardware: All OS: All Status: UNCONFIRMED Severity: bug Priority: wish Component: mq Assignee: bugzi...@mercurial-scm.org Reporter: dinumar...@gmail.com CC: mercurial-devel@mercurial-scm.org Use case: We have "feature" branches in our repo, merged into "master" and "dev" branches. Developers commit to "dev" branch and commits are cherrypicked back to master and feature branches. Developers are undisciplined in committing separate changesets for the feature branches. So code review has to split a "dev" commit and graft the parts to the various feature branches. Workflow: - graft changeset from remote branch - need to prune some changes from grafted changeset: - ~ hg qimport -r tip - do some changes - ~ hg qrefresh (if no qrefresh, metadata is kept; so loss is taking place here) - ~ hg qfinish -a At this point, graft metadata is lost. The alternate histedit workflow doesn't lose this metadata. Alternative workflows: A) Edit graft before it's committed: it would be great if there was a way for the graft extension to forgo commit B) histedit: this works and we use it for the purpose, but is very cumbersome because of the interactive nature and no thg GUI support; it would be so nice though if histedit would allow a shortcut option for "edit tip" (I've tried using --commands with a file containing "edit tip"), but it seems it doesn't parse revision names, so we need to make a special tool just to run histedit for tip In the absence of A) which would be the semantically correct way to do it, I think the MQ way is the best alternative, if only it didn't lose graft meta. -- 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
Re: [PATCH 01 of 10] contrib: have import-checker work mostly with native strings for mod names
On Mon, Aug 28, 2017 at 6:57 AM, Augie Fackler wrote: > >> On Aug 28, 2017, at 02:55, Martin von Zweigbergk >> wrote: >> >> On Wed, Aug 23, 2017 at 7:55 AM, Augie Fackler wrote: >>> # HG changeset patch >>> # User Augie Fackler >>> # Date 1503421161 14400 >>> # Tue Aug 22 12:59:21 2017 -0400 >>> # Node ID e915b9703f675b2f76c512347ddff0f6c65a9748 >>> # Parent edf503e5dfd408f900f3bad0a6923573813e276b >>> contrib: have import-checker work mostly with native strings for mod names >>> >>> Module names are a bit awkward to deal with portably otherwise. >>> >>> diff --git a/contrib/import-checker.py b/contrib/import-checker.py >>> --- a/contrib/import-checker.py >>> +++ b/contrib/import-checker.py >>> @@ -147,6 +147,8 @@ def fromlocalfunc(modulename, localmods) >> fromlocal2('bar', 2) >>> ('foo.bar', 'foo.bar.__init__', True) >>> """ >>> +if not isinstance(modulename, str): >>> +modulename = modulename.decode('ascii') >> >> Should this be 'if isinstance(modulename, bytes)' instead? That seems >> clearer to me. > > Clearer, but wrong, because str == bytes on Python 2 and you'd end up > decoding to a unicode rather than to a native string. Ah, I think I had gotten this backwards, thinking this was converting *to* bytes, so my comments didn't make much sense. Sorry about the noise. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D542: effectflag: document effect flag
quark added a comment. As I commented earlier in an email thread. I think it's cleaner to record a hash of patch to detect content change, so we will be able to detect undos: A -- amend --> B -- unamend --> C When asking the difference between A and C, we can answer "no change". I also think other chnages like meta, parent, user, data should be calculated directly from changelog because changelog is fast. You may argue that obsstore may have nodes unknown to chnagelog but I don't think the end-user care about those nodes (since they cannot see the actual content of them). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D542 To: lothiraldan, #hg-reviewers Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@33889: 4 new changesets
4 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/13dc7f29531e changeset: 33886:13dc7f29531e user:Martin von Zweigbergk date:Thu Aug 17 13:04:47 2017 -0700 summary: exchange: don't attempt phase exchange if phase-heads was in bundle https://www.mercurial-scm.org/repo/hg/rev/702a26fec3e2 changeset: 33887:702a26fec3e2 user:Durham Goode date:Wed Aug 23 12:34:56 2017 -0700 summary: bundlerepo: move temp bundle creation to a separate function https://www.mercurial-scm.org/repo/hg/rev/891118dcd279 changeset: 33888:891118dcd279 user:Durham Goode date:Wed Aug 23 12:35:03 2017 -0700 summary: bundle2: seek part back during iteration https://www.mercurial-scm.org/repo/hg/rev/f672d060a931 changeset: 33889:f672d060a931 bookmark:@ tag: tip user:Durham Goode date:Wed Aug 23 12:35:03 2017 -0700 summary: bundlerepo: move bundle2 part handling out to a function -- 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
[PATCH 10 of 10] contrib: add test-check-module-imports.t to the Python 3 whitelist
# HG changeset patch # User Augie Fackler # Date 1503436573 14400 # Tue Aug 22 17:16:13 2017 -0400 # Node ID 62fe41ce8dc879f92a047416b005fb295029cf13 # Parent 02257732eec8eab19c08175517370515da5712d9 contrib: add test-check-module-imports.t to the Python 3 whitelist This has the benefit of also catching most (if not all!) old-style print statements and except statements. diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -4,6 +4,7 @@ test-branch-tag-confict.t test-casecollision.t test-check-commit.t test-check-execute.t +test-check-module-imports.t test-check-pyflakes.t test-check-pylint.t test-check-shbang.t ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 09 of 10] tests: update test-obsolete to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503436520 14400 # Tue Aug 22 17:15:20 2017 -0400 # Node ID 02257732eec8eab19c08175517370515da5712d9 # Parent dc6d7a28a60abcf771feb40c86d3d23364f5d815 tests: update test-obsolete to pass our import checker diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -1241,8 +1241,14 @@ 1) We want to make sure that the cached bookmarks change $ cd .. $ cat >$TESTTMP/test_extension.py << EOF + > from __future__ import absolute_import, print_function > import weakref - > from mercurial import cmdutil, extensions, bookmarks, repoview + > from mercurial import ( + > bookmarks, + > cmdutil, + > extensions, + > repoview, + > ) > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs): > reporef = weakref.ref(bkmstoreinst._repo) > def trhook(tr): @@ -1250,7 +1256,7 @@ bookmarks change > hidden1 = repoview.computehidden(repo) > hidden = repoview.filterrevs(repo, 'visible') > if sorted(hidden1) != sorted(hidden): - > print "cache inconsistency" + > print("cache inconsistency") > bkmstoreinst._repo.currenttransaction().addpostclose('test_extension', trhook) > orig(bkmstoreinst, *args, **kwargs) > def extsetup(ui): ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 08 of 10] tests: update test-largefiles-cache to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503436514 14400 # Tue Aug 22 17:15:14 2017 -0400 # Node ID dc6d7a28a60abcf771feb40c86d3d23364f5d815 # Parent d3b8378b515f1986bea3bf1244383b3f6393781e tests: update test-largefiles-cache to pass our import checker diff --git a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t --- a/tests/test-largefiles-cache.t +++ b/tests/test-largefiles-cache.t @@ -94,9 +94,11 @@ Portable way to print file permissions: $ cat > ls-l.py < #!$PYTHON - > import sys, os + > from __future__ import absolute_import, print_function + > import os + > import sys > path = sys.argv[1] - > print('%03o' % (os.lstat(path).st_mode & 0777)) + > print('%03o' % (os.lstat(path).st_mode & 0o777)) > EOF $ chmod +x ls-l.py ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 07 of 10] tests: update test-inherit-mode to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503436509 14400 # Tue Aug 22 17:15:09 2017 -0400 # Node ID d3b8378b515f1986bea3bf1244383b3f6393781e # Parent 8f378e7db536977a5626db61b677f9d3171c82e6 tests: update test-inherit-mode to pass our import checker diff --git a/tests/test-inherit-mode.t b/tests/test-inherit-mode.t --- a/tests/test-inherit-mode.t +++ b/tests/test-inherit-mode.t @@ -10,7 +10,9 @@ just in case somebody has a strange $TMP $ cd dir $ cat >printmodes.py < import os, sys + > from __future__ import absolute_import, print_function + > import os + > import sys > > allnames = [] > isdir = {} @@ -25,12 +27,13 @@ just in case somebody has a strange $TMP > allnames.sort() > for name in allnames: > suffix = name in isdir and '/' or '' - > print('%05o %s%s' % (os.lstat(name).st_mode & 0, name, suffix)) + > print('%05o %s%s' % (os.lstat(name).st_mode & 0o, name, suffix)) > EOF $ cat >mode.py < from __future__ import absolute_import, print_function + > import os > import sys - > import os > print('%05o' % os.lstat(sys.argv[1]).st_mode) > EOF ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 06 of 10] tests: update test-relink to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503436290 14400 # Tue Aug 22 17:11:30 2017 -0400 # Node ID 8f378e7db536977a5626db61b677f9d3171c82e6 # Parent a9c15eac8e7197834a33b8026dbea054510d2109 tests: update test-relink to pass our import checker diff --git a/tests/test-relink.t b/tests/test-relink.t --- a/tests/test-relink.t +++ b/tests/test-relink.t @@ -8,13 +8,15 @@ > } $ cat > arelinked.py < import sys, os + > from __future__ import absolute_import, print_function + > import os + > import sys > from mercurial import util > path1, path2 = sys.argv[1:3] > if util.samefile(path1, path2): - > print '%s == %s' % (path1, path2) + > print('%s == %s' % (path1, path2)) > else: - > print '%s != %s' % (path1, path2) + > print('%s != %s' % (path1, path2)) > EOF ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 05 of 10] tests: update test-strip to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435566 14400 # Tue Aug 22 16:59:26 2017 -0400 # Node ID a9c15eac8e7197834a33b8026dbea054510d2109 # Parent 10362303381bb4e3ed5118ba2ae3055604432665 tests: update test-strip to pass our import checker diff --git a/tests/test-strip.t b/tests/test-strip.t --- a/tests/test-strip.t +++ b/tests/test-strip.t @@ -961,7 +961,8 @@ Use delayedstrip to strip inside a trans 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 3 >> I $ cat > $TESTTMP/delayedstrip.py < from mercurial import repair, commands + > from __future__ import absolute_import + > from mercurial import commands, repair > def reposetup(ui, repo): > def getnodes(expr): > return [repo.changelog.node(r) for r in repo.revs(expr)] ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 04 of 10] tests: update test-share to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435561 14400 # Tue Aug 22 16:59:21 2017 -0400 # Node ID 10362303381bb4e3ed5118ba2ae3055604432665 # Parent 4c700816d9153f10c1818a5e4b9125f9f0c83223 tests: update test-share to pass our import checker diff --git a/tests/test-share.t b/tests/test-share.t --- a/tests/test-share.t +++ b/tests/test-share.t @@ -326,7 +326,12 @@ verify that bookmarks are not written on $ cat > failpullbookmarks.py << EOF > """A small extension that makes bookmark pulls fail, for testing""" - > from mercurial import extensions, exchange, error + > from __future__ import absolute_import + > from mercurial import ( + > error, + > exchange, + > extensions, + > ) > def _pullbookmarks(orig, pullop): > orig(pullop) > raise error.HookAbort('forced failure by extension') ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 03 of 10] tests: update test-requires to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435557 14400 # Tue Aug 22 16:59:17 2017 -0400 # Node ID 4c700816d9153f10c1818a5e4b9125f9f0c83223 # Parent 78b19b1d11bd083a1aeef9c99895378e93e857a5 tests: update test-requires to pass our import checker diff --git a/tests/test-requires.t b/tests/test-requires.t --- a/tests/test-requires.t +++ b/tests/test-requires.t @@ -32,7 +32,8 @@ another repository of push/pull/clone on $ echo 'featuresetup-test' >> supported/.hg/requires $ cat > $TESTTMP/supported-locally/supportlocally.py < from mercurial import localrepo, extensions + > from __future__ import absolute_import + > from mercurial import extensions, localrepo > def featuresetup(ui, supported): > for name, module in extensions.extensions(ui): > if __name__ == module.__name__: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 02 of 10] tests: update test-progress to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435552 14400 # Tue Aug 22 16:59:12 2017 -0400 # Node ID 78b19b1d11bd083a1aeef9c99895378e93e857a5 # Parent 9bf8bd287bbf25b615a74cb6a47cce9c33bace4a tests: update test-progress to pass our import checker diff --git a/tests/test-progress.t b/tests/test-progress.t --- a/tests/test-progress.t +++ b/tests/test-progress.t @@ -1,7 +1,8 @@ $ cat > loop.py < from __future__ import absolute_import + > import time > from mercurial import commands, registrar - > import time > > cmdtable = {} > command = registrar.command(cmdtable) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 01 of 10] tests: update test-patchbomb to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435546 14400 # Tue Aug 22 16:59:06 2017 -0400 # Node ID 9bf8bd287bbf25b615a74cb6a47cce9c33bace4a # Parent b1f75d8e887a4c06e6b120807f3defc5c7b78d33 tests: update test-patchbomb to pass our import checker diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t --- a/tests/test-patchbomb.t +++ b/tests/test-patchbomb.t @@ -9,18 +9,19 @@ Mercurial-patchbomb/.* -> Mercurial-patc --===+[0-9]+=+$ -> --===*= (glob) $ cat > prune-blank-after-boundary.py < from __future__ import absolute_import, print_function > import sys > skipblank = False > trim = lambda x: x.strip(' \r\n') > for l in sys.stdin: > if trim(l).endswith('=--') or trim(l).endswith('=='): > skipblank = True - > print l, + > print(l, end='') > continue > if not trim(l) and skipblank: > continue > skipblank = False - > print l, + > print(l, end='') > EOF $ FILTERBOUNDARY="$PYTHON `pwd`/prune-blank-after-boundary.py" $ echo "[format]" >> $HGRCPATH ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 01 of 10] tests: update test-largefiles-wireproto to pass our import checker
On Mon, 28 Aug 2017 10:55:52 -0400, Augie Fackler wrote: > # HG changeset patch > # User Augie Fackler > # Date 1503435487 14400 > # Tue Aug 22 16:58:07 2017 -0400 > # Node ID 8108120d81448c42f5727d74d692b5c922a402ad > # Parent 99113426105723c0d1573f87b3c02db9d9582b95 > tests: update test-largefiles-wireproto to pass our import checker Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@33885: 19 new changesets (1 on stable)
19 new changesets (1 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/252fb66ee5bb changeset: 33867:252fb66ee5bb user:Yuya Nishihara date:Sat Aug 19 11:23:33 2017 +0900 summary: copies: use intersectmatchers() in non-merge p1 optimization https://www.mercurial-scm.org/repo/hg/rev/63773d7497b6 changeset: 33868:63773d7497b6 user:Jun Wu date:Sun Aug 20 10:55:05 2017 -0700 summary: test-revset: make it work with chg https://www.mercurial-scm.org/repo/hg/rev/5f3845b4ca15 changeset: 33869:5f3845b4ca15 user:Martin von Zweigbergk date:Mon Aug 21 22:13:51 2017 -0700 summary: run-tests: also highlight .py test files in summary messages https://www.mercurial-scm.org/repo/hg/rev/aa81c7a617dd changeset: 33870:aa81c7a617dd user:Martin von Zweigbergk date:Tue Aug 22 10:01:27 2017 -0700 summary: run-tests: remove unused pygments token type https://www.mercurial-scm.org/repo/hg/rev/9e8b01d0654f changeset: 33871:9e8b01d0654f user:Alex Gaynor date:Wed Aug 23 01:08:09 2017 + summary: tests: fixed a bytes/unicode confusion in the test runner https://www.mercurial-scm.org/repo/hg/rev/5d9890d8ca77 changeset: 33872:5d9890d8ca77 user:Augie Fackler date:Tue Aug 22 12:58:51 2017 -0400 summary: undumprevlog: update to valid Python 3 syntax https://www.mercurial-scm.org/repo/hg/rev/904bc1dc2694 changeset: 33873:904bc1dc2694 user:Augie Fackler date:Tue Aug 22 14:57:10 2017 -0400 summary: md5sum: assume hashlib exists now that we're 2.7 only https://www.mercurial-scm.org/repo/hg/rev/3b1add641232 changeset: 33874:3b1add641232 user:Augie Fackler date:Tue Aug 22 14:57:52 2017 -0400 summary: tests: update test-archive to always use hashlib https://www.mercurial-scm.org/repo/hg/rev/1378c971ec5d changeset: 33875:1378c971ec5d user:Augie Fackler date:Tue Aug 22 15:05:07 2017 -0400 summary: tests: stop using old except syntax in test-bundle2-format https://www.mercurial-scm.org/repo/hg/rev/998fad4b3072 changeset: 33876:998fad4b3072 user:Augie Fackler date:Tue Aug 22 10:58:29 2017 -0400 summary: contrib: work around some modules not existing on Py3 in import checker https://www.mercurial-scm.org/repo/hg/rev/bcf53149ebce changeset: 33877:bcf53149ebce user:Augie Fackler date:Tue Aug 22 12:58:28 2017 -0400 summary: contrib: make import checker always think in terms of bytes https://www.mercurial-scm.org/repo/hg/rev/c90014d5cdc3 changeset: 33878:c90014d5cdc3 user:Augie Fackler date:Tue Aug 22 11:00:46 2017 -0400 summary: python3: whitelist test-imports-checker.t, which now passes https://www.mercurial-scm.org/repo/hg/rev/169baf3d1d3c changeset: 33879:169baf3d1d3c user:Gábor Stefanik date:Tue Aug 22 16:08:31 2017 +0200 summary: copies: fix typo in comment https://www.mercurial-scm.org/repo/hg/rev/edf503e5dfd4 changeset: 33880:edf503e5dfd4 user:Gábor Stefanik date:Tue Aug 22 16:16:39 2017 +0200 summary: copies: fix misaligned lines https://www.mercurial-scm.org/repo/hg/rev/6a49c74b1e8f changeset: 33881:6a49c74b1e8f user:Rishabh Madan date:Sun Aug 13 19:58:45 2017 +0530 summary: releasenotes: add check flag for use of admonitions and its validity https://www.mercurial-scm.org/repo/hg/rev/8d75b9effa07 changeset: 33882:8d75b9effa07 user:Alex Gaynor date:Wed Aug 23 01:09:08 2017 + summary: bundle2: fixed usage of an attribute that was removed in py3k https://www.mercurial-scm.org/repo/hg/rev/e5d104c35e51 changeset: 33883:e5d104c35e51 user:Pulkit Goyal <7895pul...@gmail.com> date:Mon Aug 21 16:43:37 2017 +0530 summary: morestatus: check whether the conflict message is None before printing https://www.mercurial-scm.org/repo/hg/rev/5707bfe04deb changeset: 33884:5707bfe04deb branch: stable parent: 33862:fb672eac2702 user:Jun Wu date:Sun Aug 27 13:39:17 2017 -0700 summary: record: fix revert -i for lines without newline (issue5651) https://www.mercurial-scm.org/repo/hg/rev/800bb35d891e changeset: 33885:800bb35d891e bookmark:@ tag: tip parent: 33883:e5d104c35e51 user:Jun Wu date:Wed Aug 16 15:48:48 2017 -0700 summary: pushvars: do not mangle repo state -- 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
[PATCH 07 of 10] tests: update test-notify to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435527 14400 # Tue Aug 22 16:58:47 2017 -0400 # Node ID c34b3b4fbd7ebb6094836b71896530a7281cf01c # Parent 198590263d2e765f0ba50ec295962ca96d1d8313 tests: update test-notify to pass our import checker diff --git a/tests/test-notify.t b/tests/test-notify.t --- a/tests/test-notify.t +++ b/tests/test-notify.t @@ -1,6 +1,7 @@ $ cat > $TESTTMP/filter.py < from __future__ import print_function - > import sys, re + > from __future__ import absolute_import, print_function + > import re + > import sys > print(re.sub("\n[ \t]", " ", sys.stdin.read()), end="") > EOF ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 08 of 10] tests: update test-obsolete to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435532 14400 # Tue Aug 22 16:58:52 2017 -0400 # Node ID 889fedb3b2a228cdf6998ab6825c5ebec337eb02 # Parent c34b3b4fbd7ebb6094836b71896530a7281cf01c tests: update test-obsolete to pass our import checker diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -1207,8 +1207,9 @@ Test issue 4506 Test heads computation on pending index changes with obsolescence markers $ cd .. $ cat >$TESTTMP/test_extension.py << EOF + > from __future__ import absolute_import + > from mercurial.i18n import _ > from mercurial import cmdutil, registrar - > from mercurial.i18n import _ > > cmdtable = {} > command = registrar.command(cmdtable) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 04 of 10] tests: update test-logtoprocess to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435508 14400 # Tue Aug 22 16:58:28 2017 -0400 # Node ID 2d0bd884a8a10cd63777d59a2df43c2103102a11 # Parent 11a6c1d535b01c51e65fd8527542cd271b147398 tests: update test-logtoprocess to pass our import checker diff --git a/tests/test-logtoprocess.t b/tests/test-logtoprocess.t --- a/tests/test-logtoprocess.t +++ b/tests/test-logtoprocess.t @@ -8,8 +8,8 @@ Test if logtoprocess correctly captures $ hg init $ cat > $TESTTMP/foocommand.py << EOF + > from __future__ import absolute_import > from mercurial import registrar - > from time import sleep > cmdtable = {} > command = registrar.command(cmdtable) > @command(b'foo', []) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 06 of 10] tests: update test-merge1 to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435523 14400 # Tue Aug 22 16:58:43 2017 -0400 # Node ID 198590263d2e765f0ba50ec295962ca96d1d8313 # Parent 1a76ab57efe7ae6cea50119a6a3e06fcf5833a2a tests: update test-merge1 to pass our import checker diff --git a/tests/test-merge1.t b/tests/test-merge1.t --- a/tests/test-merge1.t +++ b/tests/test-merge1.t @@ -340,9 +340,14 @@ aren't changed), even if none of mode, s isn't changed on the filesystem (see also issue4583). $ cat > $TESTTMP/abort.py < from __future__ import absolute_import > # emulate aborting before "recordupdates()". in this case, files > # are changed without updating dirstate - > from mercurial import extensions, merge, error + > from mercurial import ( + > error, + > extensions, + > merge, + > ) > def applyupdates(orig, *args, **kwargs): > orig(*args, **kwargs) > raise error.Abort('intentional aborting') ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 10 of 10] tests: update test-patch to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435542 14400 # Tue Aug 22 16:59:02 2017 -0400 # Node ID db3b60e3edf8b0bbebeda19ca4caa298e90c429f # Parent e02a9d1bc10171bfc47d16a76f4a1677625bc3dd tests: update test-patch to pass our import checker diff --git a/tests/test-patch.t b/tests/test-patch.t --- a/tests/test-patch.t +++ b/tests/test-patch.t @@ -1,8 +1,9 @@ $ cat > patchtool.py < from __future__ import absolute_import, print_function > import sys - > print 'Using custom patch' + > print('Using custom patch') > if '--binary' in sys.argv: - > print '--binary found !' + > print('--binary found !') > EOF $ echo "[ui]" >> $HGRCPATH ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 09 of 10] tests: update test-pager to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435537 14400 # Tue Aug 22 16:58:57 2017 -0400 # Node ID e02a9d1bc10171bfc47d16a76f4a1677625bc3dd # Parent 889fedb3b2a228cdf6998ab6825c5ebec337eb02 tests: update test-pager to pass our import checker diff --git a/tests/test-pager.t b/tests/test-pager.t --- a/tests/test-pager.t +++ b/tests/test-pager.t @@ -342,7 +342,9 @@ Put annotate in the ignore list for page Environment variables like LESS and LV are set automatically: $ cat > $TESTTMP/printlesslv.py < import os, sys + > from __future__ import absolute_import + > import os + > import sys > sys.stdin.read() > for name in ['LESS', 'LV']: > sys.stdout.write(('%s=%s\n') % (name, os.environ.get(name, '-'))) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 05 of 10] tests: update test-merge-symlinks to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435517 14400 # Tue Aug 22 16:58:37 2017 -0400 # Node ID 1a76ab57efe7ae6cea50119a6a3e06fcf5833a2a # Parent 2d0bd884a8a10cd63777d59a2df43c2103102a11 tests: update test-merge-symlinks to pass our import checker diff --git a/tests/test-merge-symlinks.t b/tests/test-merge-symlinks.t --- a/tests/test-merge-symlinks.t +++ b/tests/test-merge-symlinks.t @@ -1,7 +1,8 @@ $ cat > echo.py < #!$PYTHON - > from __future__ import print_function - > import os, sys + > from __future__ import absolute_import, print_function + > import os + > import sys > try: > import msvcrt > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 02 of 10] tests: update test-log-exthook to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435493 14400 # Tue Aug 22 16:58:13 2017 -0400 # Node ID 87e153a77ff33905183cd5491b753918d256c388 # Parent 8108120d81448c42f5727d74d692b5c922a402ad tests: update test-log-exthook to pass our import checker diff --git a/tests/test-log-exthook.t b/tests/test-log-exthook.t --- a/tests/test-log-exthook.t +++ b/tests/test-log-exthook.t @@ -2,8 +2,12 @@ Test hg log changeset printer external h --- $ cat > $TESTTMP/logexthook.py < from mercurial import repair, commands - > from mercurial import cmdutil + > from __future__ import absolute_import + > from mercurial import ( + > cmdutil, + > commands, + > repair, + > ) > def rot13description(self, ctx): > summary = "summary".encode('rot13') > description = ctx.description().strip().splitlines()[0].encode('rot13') ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 03 of 10] tests: update test-log to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435502 14400 # Tue Aug 22 16:58:22 2017 -0400 # Node ID 11a6c1d535b01c51e65fd8527542cd271b147398 # Parent 87e153a77ff33905183cd5491b753918d256c388 tests: update test-log to pass our import checker diff --git a/tests/test-log.t b/tests/test-log.t --- a/tests/test-log.t +++ b/tests/test-log.t @@ -2027,7 +2027,8 @@ Check that adding an arbitrary name show $ cat > ../names.py < """A small extension to test adding arbitrary names to a repo""" - > from mercurial.namespaces import namespace + > from __future__ import absolute_import + > from mercurial import namespaces > > def reposetup(ui, repo): > foo = {'foo': repo[0].node()} @@ -2035,9 +2036,10 @@ Check that adding an arbitrary name show > namemap = lambda r, name: foo.get(name) > nodemap = lambda r, node: [name for name, n in foo.iteritems() >if n == node] - > ns = namespace("bars", templatename="bar", logname="barlog", - >colorname="barcolor", listnames=names, namemap=namemap, - >nodemap=nodemap) + > ns = namespaces.namespace( + > "bars", templatename="bar", logname="barlog", + > colorname="barcolor", listnames=names, namemap=namemap, + > nodemap=nodemap) > > repo.names.addnamespace(ns) > EOF ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 01 of 10] tests: update test-largefiles-wireproto to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435487 14400 # Tue Aug 22 16:58:07 2017 -0400 # Node ID 8108120d81448c42f5727d74d692b5c922a402ad # Parent 99113426105723c0d1573f87b3c02db9d9582b95 tests: update test-largefiles-wireproto to pass our import checker diff --git a/tests/test-largefiles-wireproto.t b/tests/test-largefiles-wireproto.t --- a/tests/test-largefiles-wireproto.t +++ b/tests/test-largefiles-wireproto.t @@ -226,7 +226,8 @@ Clone over http, no largefiles pulled on added 1 changesets with 1 changes to 1 files Archive contains largefiles - >>> import urllib2, os + >>> import os + >>> import urllib2 >>> u = 'http://localhost:%s/archive/default.zip' % os.environ['HGPORT2'] >>> with open('archive.zip', 'w') as f: ... f.write(urllib2.urlopen(u).read()) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 01 of 10] tests: update test-debugcommands to pass our import checker
On Mon, 28 Aug 2017 10:41:54 -0400, Augie Fackler wrote: > # HG changeset patch > # User Augie Fackler > # Date 1503431435 14400 > # Tue Aug 22 15:50:35 2017 -0400 > # Node ID 74152a04c3bd15b1e01a621df329b9a84e5bbca2 > # Parent 794f7bb739be9f5e16ab26e2f2d98fbbf8be5659 > tests: update test-debugcommands to pass our import checker Queued these, too. Many thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 08 of 10] tests: update test-impexp-branch to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503431497 14400 # Tue Aug 22 15:51:37 2017 -0400 # Node ID 69f5d19e016bfcc438e45382b34d18eff4135f23 # Parent 14ed1e0fc6a984318a0b5111a4c2439e596061c2 tests: update test-impexp-branch to pass our import checker diff --git a/tests/test-impexp-branch.t b/tests/test-impexp-branch.t --- a/tests/test-impexp-branch.t +++ b/tests/test-impexp-branch.t @@ -2,7 +2,9 @@ $ echo 'strip =' >> $HGRCPATH $ cat >findbranch.py < import re, sys + > from __future__ import absolute_import + > import re + > import sys > > head_re = re.compile('^#(?:(?:\\s+([A-Za-z][A-Za-z0-9_]*)(?:\\s.*)?)|(?:\\s*))$') > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 09 of 10] tests: update test-keyword to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503431507 14400 # Tue Aug 22 15:51:47 2017 -0400 # Node ID 352230d757644e16341a6104268f4e608cf97490 # Parent 69f5d19e016bfcc438e45382b34d18eff4135f23 tests: update test-keyword to pass our import checker diff --git a/tests/test-keyword.t b/tests/test-keyword.t --- a/tests/test-keyword.t +++ b/tests/test-keyword.t @@ -1412,7 +1412,7 @@ suppress expanding keywords at subsequen $ mv $HGRCPATH.new $HGRCPATH >>> from __future__ import print_function - >>> from hgclient import readchannel, runcommand, check + >>> from hgclient import check, readchannel, runcommand >>> @check ... def check(server): ... # hello block ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 10 of 10] tests: update test-largefiles-small-disk to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503435457 14400 # Tue Aug 22 16:57:37 2017 -0400 # Node ID ef55f9488b4eac33e16b464a2cfe7855c183811d # Parent 352230d757644e16341a6104268f4e608cf97490 tests: update test-largefiles-small-disk to pass our import checker diff --git a/tests/test-largefiles-small-disk.t b/tests/test-largefiles-small-disk.t --- a/tests/test-largefiles-small-disk.t +++ b/tests/test-largefiles-small-disk.t @@ -1,7 +1,10 @@ Test how largefiles abort in case the disk runs full $ cat > criple.py < import os, errno, shutil + > from __future__ import absolute_import + > import errno + > import os + > import shutil > from mercurial import util > # > # this makes the original largefiles code abort: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 07 of 10] tests: update test-help to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503431490 14400 # Tue Aug 22 15:51:30 2017 -0400 # Node ID 14ed1e0fc6a984318a0b5111a4c2439e596061c2 # Parent 31aa4a34ea4eb6578c7dd7bf3628909f415d3b4a tests: update test-help to pass our import checker diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -1516,8 +1516,8 @@ Test omit indicating for help > > This paragraph is never omitted, too (for extension) > ''' - > - > from mercurial import help, commands + > from __future__ import absolute_import + > from mercurial import commands, help > testtopic = """This paragraph is never omitted (for topic). > > .. container:: verbose ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 06 of 10] tests: update test-hardlinks to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503431484 14400 # Tue Aug 22 15:51:24 2017 -0400 # Node ID 31aa4a34ea4eb6578c7dd7bf3628909f415d3b4a # Parent d628faa82545e767f56850398b77500a7d576d12 tests: update test-hardlinks to pass our import checker diff --git a/tests/test-hardlinks.t b/tests/test-hardlinks.t --- a/tests/test-hardlinks.t +++ b/tests/test-hardlinks.t @@ -17,8 +17,9 @@ Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux): $ cat > linkcp.py < from __future__ import absolute_import + > import sys > from mercurial import util - > import sys > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True) > EOF ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 01 of 10] tests: update test-debugcommands to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503431435 14400 # Tue Aug 22 15:50:35 2017 -0400 # Node ID 74152a04c3bd15b1e01a621df329b9a84e5bbca2 # Parent 794f7bb739be9f5e16ab26e2f2d98fbbf8be5659 tests: update test-debugcommands to pass our import checker diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t --- a/tests/test-debugcommands.t +++ b/tests/test-debugcommands.t @@ -132,25 +132,27 @@ Test cache warming command Test internal debugstacktrace command $ cat > debugstacktrace.py << EOF - > from mercurial.util import debugstacktrace, dst, sys + > from __future__ import absolute_import + > import sys + > from mercurial import util > def f(): - > debugstacktrace(f=sys.stdout) + > util.debugstacktrace(f=sys.stdout) > g() > def g(): - > dst('hello from g\\n', skip=1) + > util.dst('hello from g\\n', skip=1) > h() > def h(): - > dst('hi ...\\nfrom h hidden in g', 1, depth=2) + > util.dst('hi ...\\nfrom h hidden in g', 1, depth=2) > f() > EOF $ $PYTHON debugstacktrace.py stacktrace at: - debugstacktrace.py:10 in * (glob) - debugstacktrace.py:3 in f + debugstacktrace.py:12 in * (glob) + debugstacktrace.py:5 in f hello from g at: - debugstacktrace.py:10 in * (glob) - debugstacktrace.py:4 in f + debugstacktrace.py:12 in * (glob) + debugstacktrace.py:6 in f hi ... from h hidden in g at: - debugstacktrace.py:4 in f - debugstacktrace.py:7 in g + debugstacktrace.py:6 in f + debugstacktrace.py:9 in g ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 03 of 10] tests: update test-eol to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503431466 14400 # Tue Aug 22 15:51:06 2017 -0400 # Node ID b2a6c360f3ffdf5821626820191389457ad0ec03 # Parent 3af7a4272590dae0812cd225cc49539a313b07c6 tests: update test-eol to pass our import checker diff --git a/tests/test-eol.t b/tests/test-eol.t --- a/tests/test-eol.t +++ b/tests/test-eol.t @@ -8,9 +8,11 @@ Test EOL extension Set up helpers $ cat > switch-eol.py < from __future__ import absolute_import + > import os > import sys > try: - > import os, msvcrt + > import msvcrt > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) > except ImportError: ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 05 of 10] tests: update test-glog to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503431478 14400 # Tue Aug 22 15:51:18 2017 -0400 # Node ID d628faa82545e767f56850398b77500a7d576d12 # Parent a3e63731e04c2a76937f7d40f905c7768a163167 tests: update test-glog to pass our import checker diff --git a/tests/test-glog.t b/tests/test-glog.t --- a/tests/test-glog.t +++ b/tests/test-glog.t @@ -82,7 +82,13 @@ o (0) root > } $ cat > printrevset.py < from mercurial import extensions, revsetlang, commands, cmdutil + > from __future__ import absolute_import + > from mercurial import ( + > cmdutil, + > commands, + > extensions, + > revsetlang, + > ) > > def uisetup(ui): > def printrevset(orig, ui, repo, *pats, **opts): ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 04 of 10] tests: update test-fncache to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503431472 14400 # Tue Aug 22 15:51:12 2017 -0400 # Node ID a3e63731e04c2a76937f7d40f905c7768a163167 # Parent b2a6c360f3ffdf5821626820191389457ad0ec03 tests: update test-fncache to pass our import checker diff --git a/tests/test-fncache.t b/tests/test-fncache.t --- a/tests/test-fncache.t +++ b/tests/test-fncache.t @@ -205,9 +205,9 @@ Encoding of reserved / long paths in the Aborting lock does not prevent fncache writes $ cat > exceptionext.py < from __future__ import absolute_import > import os - > from mercurial import commands, error - > from mercurial.extensions import wrapcommand, wrapfunction + > from mercurial import commands, error, extensions > > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs): > def releasewrap(): @@ -217,7 +217,7 @@ Aborting lock does not prevent fncache w > return l > > def reposetup(ui, repo): - > wrapfunction(repo, '_lock', lockexception) + > extensions.wrapfunction(repo, '_lock', lockexception) > > cmdtable = {} > @@ -236,7 +236,7 @@ Aborting lock does not prevent fncache w > wlock.release() > > def extsetup(ui): - > wrapcommand(commands.table, "commit", commitwrap) + > extensions.wrapcommand(commands.table, "commit", commitwrap) > EOF $ extpath=`pwd`/exceptionext.py $ hg init fncachetxn @@ -252,9 +252,9 @@ Aborting lock does not prevent fncache w Aborting transaction prevents fncache change $ cat > ../exceptionext.py < from __future__ import absolute_import > import os - > from mercurial import commands, error, localrepo - > from mercurial.extensions import wrapfunction + > from mercurial import commands, error, extensions, localrepo > > def wrapper(orig, self, *args, **kwargs): > tr = orig(self, *args, **kwargs) @@ -265,7 +265,8 @@ Aborting transaction prevents fncache ch > return tr > > def uisetup(ui): - > wrapfunction(localrepo.localrepository, 'transaction', wrapper) + > extensions.wrapfunction( + > localrepo.localrepository, 'transaction', wrapper) > > cmdtable = {} > @@ -287,9 +288,15 @@ Clean cached version Aborted transactions can be recovered later $ cat > ../exceptionext.py < from __future__ import absolute_import > import os - > from mercurial import commands, error, transaction, localrepo - > from mercurial.extensions import wrapfunction + > from mercurial import ( + > commands, + > error, + > extensions, + > localrepo, + > transaction, + > ) > > def trwrapper(orig, self, *args, **kwargs): > tr = orig(self, *args, **kwargs) @@ -303,8 +310,10 @@ Aborted transactions can be recovered la > raise error.Abort("forced transaction failure") > > def uisetup(ui): - > wrapfunction(localrepo.localrepository, 'transaction', trwrapper) - > wrapfunction(transaction.transaction, '_abort', abortwrapper) + > extensions.wrapfunction(localrepo.localrepository, 'transaction', + > trwrapper) + > extensions.wrapfunction(transaction.transaction, '_abort', + > abortwrapper) > > cmdtable = {} > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 02 of 10] tests: update test-dirstate to pass our import checker
# HG changeset patch # User Augie Fackler # Date 1503431459 14400 # Tue Aug 22 15:50:59 2017 -0400 # Node ID 3af7a4272590dae0812cd225cc49539a313b07c6 # Parent 74152a04c3bd15b1e01a621df329b9a84e5bbca2 tests: update test-dirstate to pass our import checker diff --git a/tests/test-dirstate.t b/tests/test-dirstate.t --- a/tests/test-dirstate.t +++ b/tests/test-dirstate.t @@ -66,7 +66,12 @@ Verify that exceptions during a dirstate coherent (issue4353) $ cat > ../dirstateexception.py < from mercurial import merge, extensions, error + > from __future__ import absolute_import + > from mercurial import ( + > error, + > extensions, + > merge, + > ) > > def wraprecordupdates(orig, repo, actions, branchmerge): > raise error.Abort("simulated error while recording dirstateupdates") ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D530: obsolete: move merge logic on the smaller object
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc0bbaefc2c5a: obsolete: move merge logic on the smaller object (authored by lothiraldan). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D530?vs=1334&id=1353 REVISION DETAIL https://phab.mercurial-scm.org/D530 AFFECTED FILES mercurial/obsutil.py CHANGE DETAILS diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py --- a/mercurial/obsutil.py +++ b/mercurial/obsutil.py @@ -339,6 +339,14 @@ new.markers = self.markers.copy() return new +@util.propertycache +def _set(self): +# immutable +return set(self) + +def canmerge(self, other): +return self._set.issubset(other._set) + def successorssets(repo, initialnode, closest=False, cache=None): """Return set of all latest successors of initial nodes @@ -554,16 +562,16 @@ # remove duplicated and subset seen = [] final = [] -candidate = sorted(((set(s), s) for s in succssets if s), - key=lambda x: len(x[1]), reverse=True) -for setversion, listversion in candidate: -for seenset, seensuccs in seen: -if setversion.issubset(seenset): -seensuccs.markers.update(listversion.markers) +candidate = sorted((s for s in succssets if s), + key=len, reverse=True) +for cand in candidate: +for seensuccs in seen: +if cand.canmerge(seensuccs): +seensuccs.markers.update(cand.markers) break else: -final.append(listversion) -seen.append((setversion, listversion)) +final.append(cand) +seen.append(cand) final.reverse() # put small successors set first cache[current] = final return cache[initialnode] To: lothiraldan, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D454: releasenotes: view admonition titles using -l flag
This revision was automatically updated to reflect the committed changes. Closed by commit rHG2a37459aedf2: releasenotes: view admonition titles using -l flag (authored by rishabhmadan96). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D454?vs=1331&id=1352 REVISION DETAIL https://phab.mercurial-scm.org/D454 AFFECTED FILES hgext/releasenotes.py tests/test-releasenotes-formatting.t CHANGE DETAILS diff --git a/tests/test-releasenotes-formatting.t b/tests/test-releasenotes-formatting.t --- a/tests/test-releasenotes-formatting.t +++ b/tests/test-releasenotes-formatting.t @@ -407,3 +407,16 @@ $ hg releasenotes -r . -c Invalid admonition 'fixes' present in changeset 0e7130d2705c (did you mean fix?) + + $ cd .. + +Usage of --list flag + + $ hg init relnotes-list + $ cd relnotes-list + $ hg releasenotes -l + feature: New Features + bc: Backwards Compatibility Changes + fix: Bug Fixes + perf: Performance Improvements + api: API Changes diff --git a/hgext/releasenotes.py b/hgext/releasenotes.py --- a/hgext/releasenotes.py +++ b/hgext/releasenotes.py @@ -275,6 +275,10 @@ ss = ", ".join(sorted(similar)) ui.write(_("(did you mean one of %s?)\n") % ss) +def _getadmonitionlist(ui, sections): +for section in sections: +ui.write("%s: %s\n" % (section[0], section[1])) + def parsenotesfromrevisions(repo, directives, revs): notes = parsedreleasenotes() @@ -467,7 +471,9 @@ @command('releasenotes', [('r', 'rev', '', _('revisions to process for release notes'), _('REV')), ('c', 'check', False, _('checks for validity of admonitions (if any)'), -_('REV'))], +_('REV')), +('l', 'list', False, _('list the available admonitions with their title'), +None)], _('hg releasenotes [-r REV] [-c] FILE')) def releasenotes(ui, repo, file_=None, **opts): """parse release notes from commit messages into an output file @@ -546,8 +552,10 @@ release note after it has been added to the release notes file. """ sections = releasenotessections(ui, repo) +if opts.get('list'): +return _getadmonitionlist(ui, sections) + rev = opts.get('rev') - revs = scmutil.revrange(repo, [rev or 'not public()']) if opts.get('check'): return checkadmonitions(ui, repo, sections.names(), revs) To: rishabhmadan96, #hg-reviewers, pulkit, yuja Cc: yuja, pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D531: obsolete: fix old typo
This revision was automatically updated to reflect the committed changes. Closed by commit rHG54c21114e41d: obsolete: fix old typo (authored by lothiraldan). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D531?vs=1335&id=1354#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D531?vs=1335&id=1354 REVISION DETAIL https://phab.mercurial-scm.org/D531 AFFECTED FILES mercurial/obsutil.py CHANGE DETAILS diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py --- a/mercurial/obsutil.py +++ b/mercurial/obsutil.py @@ -562,9 +562,9 @@ # remove duplicated and subset seen = [] final = [] -candidate = sorted((s for s in succssets if s), - key=len, reverse=True) -for cand in candidate: +candidates = sorted((s for s in succssets if s), +key=len, reverse=True) +for cand in candidates: for seensuccs in seen: if cand.canmerge(seensuccs): seensuccs.markers.update(cand.markers) To: lothiraldan, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel