D618: largefiles: remove unused assignments from wrapfunction()
lothiraldan added a comment. In https://phab.mercurial-scm.org/D618#10161, @mharbison72 wrote: > Is it acceptable to move the exthelper stuff in evolve into the core somewhere? The fact that there are so many functions and commands wrapped in largefiles makes it harder to read the code. (And sometimes it is a command, cmdutil and a subrepo function that need to be wrapped.) I like the simple annotation method evolve uses. (I'm not sure what to do about the few cases where the return value from these wrappers is used to add an option.) That sounds like an excellent idea! I'm not sure if exthelper needs some cleanup before upstreaming it. I'm gonna take a look at it. Please feel free to send cleanup patches if needed. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D618 To: martinvonz, #hg-reviewers, yuja Cc: lothiraldan, mharbison72, yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D542: effectflag: document effect flag
lothiraldan added a comment. @quark Thank you for reposting your comment here, it's helpful to not lose track on all these discussions. We've had this experiment in Evolve for a little while now and the users using it are giving positive feedback. The next step is to upstream it in core but turned off by default like the others experiments and gather data and feedback. The effect-flag design poses indeed the limitation you're bringing up. I've updated the first commit message to make it more obvious: https://phab.mercurial-scm.org/D533 However, I feel that it's not in this experiment scope, even though it overlaps with effect-flag on content change tracking. I hope that with all our current experiments (operation, effect-flag) and potential future ones (content hash), we will be able to find the best way to store and display the obsolescence history, both for centralized and decentralized workflows, because we do have the same goal: making the obsolescence history understandable to users. I propose that we start a separate experiment, so users could use it separately from effect-flag. I would be happy to collaborate on a first version of this experiment before the sprint and use the sprint to further discuss the design, what do you think ? 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
D555: cmdutil: allow extra properties to be added to each context
This revision was automatically updated to reflect the committed changes. Closed by commit rHGbe1fcffe651f: cmdutil: allow extra properties to be added to each context (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D555?vs=1810=1843 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 @@ -2617,7 +2617,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'] @@ -2658,7 +2659,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, quark 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
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb93658d7b2d5: show: pass the minimum length for nodes as a template keyword (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D556?vs=1383=1844 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, quark Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D558: show: use consistent (and possibly shorter) node lengths
This revision was automatically updated to reflect the committed changes. Closed by commit rHG98010c7a5745: show: use consistent (and possibly shorter) node lengths (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D558?vs=1811=1845 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-bookmark7b57 +book1b757 A custom bookmarks template works @@ -113,14 +113,14 @@ "bookmark": "a-longer-bookmark", "longestbookmarklen": 17, "node": "7b5709ab64cbc34da9b4367b64afff47f2c4ee83", -"nodelen": 5 +"nodelen": 4 }, { "active": false, "bookmark": "book1", "longestbookmarklen": 17, "node": "b757f780b8ffd71267c6ccb32e0882d9d32a8cc0", -"nodelen": 5 +"nodelen": 4 } ] @@ -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 + @ 7b57 commit for book2 + o b757 commit for book1 + o ba59 initial $ hg --config commands.show.aliasprefix='s sh' swork - @ 7b570 commit for book2 - o b757f commit for book1 - o ba592 initial + @ 7b57 commit for book2 + o b757 commit for book1 + o ba59 initial $ hg --config commands.show.aliasprefix='s sh' shwork - @ 7b570 commit for book2 - o b757f commit for book1 - o ba592 initial + @ 7b57 commit for book2 + o b757 commit for book1 + o ba59 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 + @ 9f17 commit 0 Even when it isn't the wdir $ hg -q up null $ hg show work - o 9f171 commit 0 + o 9f17 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 9f17 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 + @ 181c commit 1 + o 9f17 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 + @ 128c commit 2 + o 181c commit 1 + o 9f17 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 + @ 128c commit 2 + o 181c commit 1 | ~ @@ -68,22 +68,22 @@ created new head $ hg show work - @ f0abc commit 3 - | o 128c8 commit 2 + @ f0ab commit 3 + | o 128c commit 2 |/ - o 181cc commit 1 + o 181c commit 1 | ~ Even when wdir is something else $ hg -q up null $ hg show work - o f0abc commit 3 - | o 128c8 commit 2 + o f0ab commit 3 + | o 128c commit 2 |/ - o 181cc commit 1 + o 181c commit 1 | ~ @@ -95,13 +95,13 @@ created new head $ hg show work - @ 668ca commit 4 - | o f0abc commit 3 - | | o 128c8 commit 2 + @ 668c commit 4 + | o f0ab commit 3 + | | o 128c commit 2 | |/ - | o 181cc commit 1 + | o 181c commit 1 |/ - o 9f171 commit 0 + o 9f17 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 + @ f8dd (mybranch) commit 4 + o 90cf (mybranch) commit 3 + | o 128c commit 2 |/ - o 181cc commit 1 + o 181c commit 1 | ~ @@ -157,11 +157,11 @@ $ hg bookmark mybook $ hg show work - @ cac82 (mybook) commit 4 - o f0abc commit 3 - | o 128c8 (@) commit 2 + @ cac8 (mybook) commit 4 + o f0ab commit 3 + | o 128c (@) commit 2 |/ - o 181cc commit 1 + o 181c 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 6a75536ea0b1 + @ 3758 Added tag 0.2 for changeset 6379c25b76f1 + o 6379 (0.2) commit 3 + o a2ad Added tag 0.1 for changeset 6a75536ea0b1 | ~ @@ -205,15 +205,15 @@ $ hg commit -m 'commit 2' $ hg show work - @ 34834 (mybook) (mybranch) commit 2 - o 97fcc commit 1 + @ 3483 (mybook) (mybranch) commit 2 + o 97fc commit 1 Multiple bookmarks on same changeset render properly $ hg
D477: revlog: add option to mmap revlog index
mbthomas added a comment. I had put the numbers in the commit message, but that doesn't update the Phabricator summary, so I've done that manually. It should be clear from the numbers that the improvement only really surfaces when the filesystem cache is warm, and there is a penalty for using this option when the filesystem cache is cold. Since the cache should be warm more often than not, the expectation is an overall improvement. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D477 To: mbthomas, #fbhgext, indygreg, #hg-reviewers, durin42, quark Cc: quark, durin42, simonfar, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D477: revlog: add option to mmap revlog index
durin42 requested changes to this revision. durin42 added a comment. This revision now requires changes to proceed. Please include benchmark numbers in your commit message. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D477 To: mbthomas, #fbhgext, indygreg, #hg-reviewers, durin42, quark Cc: quark, durin42, simonfar, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: 4.4 Sprint Planning
> On Sep 14, 2017, at 01:16, Gregory Szorcwrote: > > Thank you and Kostia for volunteering to organize things on the ground! The > sprints can be chaotic and I'm sure you'll make great masters-of-ceremony. +1 > > While the draft schedule seems very reasonable (I'd be happy if it were the > final schedule), I'd like to throw out a few ideas and observations. > > Experience from previous Sprints tells me that people are pretty drained by > the 3rd day. I like the idea of a "vision statements" session to hash out > project direction. But I'm a bit worried about doing that on Sunday. If we > have the session, I'd prefer see it done on Friday or Saturday when everyone > is still pretty fresh. I /think/ it would make a natural follow-up to the > "state of" sessions. Maybe we could do it after lunch on Friday? Although I > do worry about information overload if we stack all the heavy talking on > Friday. It might also be useful for people to have time to digest all the > "state of" information and to connect with others before we start thinking > about vision statements. Maybe we could do state-of things quickly Friday morning after introductions, capped at an hour *total*, and then talk vision statement etc Saturday morning when we're all fresh. > Personally, I love when things get done at the Sprint. The best Sprints for > me are when I walk away feeling energized about what was accomplished. > Something I feel has been lacking from previous Sprints is a natural "book > end" to the event. Sundays can kind of tail off and fizzle. What do others > think about some kind of "closing" event where we announce accomplishments > and leave on a high note? Sounds like something we should try. > Another area I'd like to explore is establishing more formal goals or even > "tracks" for the Sprint - before the Sprint starts. It would be cool if by > the time I get on a plane I have a pretty good sense of what we're going to > try to do at the Sprint. For example, perhaps a few people sign up for Python > 3 porting, others on storage futures, another group on UX papercuts, and > another group on bug triage and fixing. Being a reviewer and patch author, if > I have time to "page in" areas that I know will be a focus at the Sprint, it > should enable me - and others - to have a more productive Sprint. > > Finally, I'd really like to make sure we address as many of the "only at the > Sprint" activities as we can. We tend to save many of our larger backwards > compatibility breaking decisions for Sprints. Going back to knowing what will > happen before the Sprint, if we could get a list of major proposals on the > wiki before the Sprint so everyone has time to digest them and isn't > surprised by the crazy ones, I think that would go a long way. > > Thanks again for starting this thread, Ryan! > ___ > 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
D529: uncommit: move fb-extension to core which uncommits a changeset
This revision was automatically updated to reflect the committed changes. Closed by commit rHGd01819c8f3c4: uncommit: move fb-extension to core which uncommits a changeset (authored by pulkit, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D529?vs=1823=1848 REVISION DETAIL https://phab.mercurial-scm.org/D529 AFFECTED FILES hgext/uncommit.py tests/test-uncommit.t CHANGE DETAILS diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t new file mode 100644 --- /dev/null +++ b/tests/test-uncommit.t @@ -0,0 +1,366 @@ +Test uncommit - set up the config + + $ cat >> $HGRCPATH < [experimental] + > evolution=createmarkers, allowunstable + > [extensions] + > uncommit = + > drawdag=$TESTDIR/drawdag.py + > EOF + +Build up a repo + + $ hg init repo + $ cd repo + $ hg bookmark foo + +Help for uncommit + + $ hg help uncommit + hg uncommit [OPTION]... [FILE]... + + uncommit part or all of a local changeset + + This command undoes the effect of a local commit, returning the affected + files to their uncommitted state. This means that files modified or + deleted in the changeset will be left unchanged, and so will remain + modified in the working directory. + + (use 'hg help -e uncommit' to show help for the uncommit extension) + + options ([+] can be repeated): + + --empty allow an empty commit after uncommiting + -I --include PATTERN [+] include names matching the given patterns + -X --exclude PATTERN [+] exclude names matching the given patterns + + (some details hidden, use --verbose to show complete help) + +Uncommit with no commits should fail + + $ hg uncommit + abort: cannot uncommit null changeset + [255] + +Create some commits + + $ touch files + $ hg add files + $ for i in a ab abc abcd abcde; do echo $i > files; echo $i > file-$i; hg add file-$i; hg commit -m "added file-$i"; done + $ ls + file-a + file-ab + file-abc + file-abcd + file-abcde + files + + $ hg log -G -T '{rev}:{node} {desc}' --hidden + @ 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde + | + o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd + | + o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc + | + o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab + | + o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a + +Simple uncommit off the top, also moves bookmark + + $ hg bookmark + * foo 4:6c4fd43ed714 + $ hg uncommit + $ hg status + M files + A file-abcde + $ hg bookmark + * foo 3:6db330d65db4 + + $ hg log -G -T '{rev}:{node} {desc}' --hidden + x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde + | + @ 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd + | + o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc + | + o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab + | + o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a + + +Recommit + + $ hg commit -m 'new change abcde' + $ hg status + $ hg heads -T '{rev}:{node} {desc}' + 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde (no-eol) + +Uncommit of non-existent and unchanged files has no effect + $ hg uncommit nothinghere + nothing to uncommit + [1] + $ hg status + $ hg uncommit file-abc + nothing to uncommit + [1] + $ hg status + +Try partial uncommit, also moves bookmark + + $ hg bookmark + * foo 5:0c07a3ccda77 + $ hg uncommit files + $ hg status + M files + $ hg bookmark + * foo 6:3727deee06f7 + $ hg heads -T '{rev}:{node} {desc}' + 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde (no-eol) + $ hg log -r . -p -T '{rev}:{node} {desc}' + 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcdediff -r 6db330d65db4 -r 3727deee06f7 file-abcde + --- /dev/nullThu Jan 01 00:00:00 1970 + + +++ b/file-abcde Thu Jan 01 00:00:00 1970 + + @@ -0,0 +1,1 @@ + +abcde + + $ hg log -G -T '{rev}:{node} {desc}' --hidden + @ 6:3727deee06f72f5ffa8db792ee299cf39e3e190b new change abcde + | + | x 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde + |/ + | x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde + |/ + o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd + | + o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc + | + o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab + | + o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a + + $ hg commit -m 'update files for abcde' + +Uncommit with dirty state + + $ echo "foo" >> files + $ cat files + abcde + foo + $ hg status + M files + $ hg uncommit files + $ cat files + abcde + foo + $ hg commit -m "files abcde + foo" + +Uncommit in the middle of a stack, does not move bookmark + + $ hg checkout '.^^^' + 1 files updated, 0 files merged, 2 files
D614: registrar: make cmdtype an attribute of the function in registar.command
durin42 added inline comments. INLINE COMMENTS > dispatch.py:491 > def __getattr__(self, name): > -adefaults = {r'norepo': True, > +adefaults = {r'norepo': True, r'cmdtype': 'unrecoverable', > r'optionalrepo': False, r'inferrepo': False} Shouldn't this reference the constant from the enum class? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D614 To: pulkit, #hg-reviewers, durham Cc: durin42, durham, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] revlog: update signature of dummy addgroup() in bundlerepo and unionrepo
On Sat, Sep 16, 2017 at 12:14:50AM +0900, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara> # Date 1505487525 -32400 > # Fri Sep 15 23:58:45 2017 +0900 > # Node ID 18004bf555f8c1087753ab3ca3a16741c0ce6482 > # Parent 98010c7a5745e1b47bf17268ef023338d5989274 > revlog: update signature of dummy addgroup() in bundlerepo and unionrepo queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D696: registrar: add a enum 'cmdtype' for the type of the command
yuja requested changes to this revision. yuja added a comment. This revision now requires changes to proceed. To make it less controversial, I would move these constants to registrar.command class and rename them to lowercaseconstants. The registrar provides semi-public API, which should be consistently named. I think this should be folded to the other registrar patch, and sent with the patches which actually change the behavior depending on the cmdtype value. So marked as change requested. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D696 To: pulkit, #hg-reviewers, durham, yuja Cc: yuja, durham, indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D663: dirstate: perform transactions with _map using single call, where possible
yuja accepted this revision. yuja added a comment. This revision is now accepted and ready to land. Queued, thanks. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D663 To: mbolin, #hg-reviewers, phillco, yuja Cc: yuja, phillco, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D715: repair: preserve phase also when not using generaldelta (issue5678)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG91f0677dc920: repair: preserve phase also when not using generaldelta (issue5678) (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D715?vs=1833=1847 REVISION DETAIL https://phab.mercurial-scm.org/D715 AFFECTED FILES mercurial/changegroup.py mercurial/repair.py tests/test-rebase-scenario-global.t tests/test-strip.t CHANGE DETAILS diff --git a/tests/test-strip.t b/tests/test-strip.t --- a/tests/test-strip.t +++ b/tests/test-strip.t @@ -1116,6 +1116,6 @@ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg (glob) $ hg unbundle -q .hg/strip-backup/* -BROKEN: obsmarker got lost $ hg debugobsolete + cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +) {'user': 'test'} $ cd .. diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t --- a/tests/test-rebase-scenario-global.t +++ b/tests/test-rebase-scenario-global.t @@ -399,11 +399,10 @@ $ hg rebase -s 1 -d 2 rebasing 1:d2ae7f538514 "b" saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/d2ae7f538514-2953539b-rebase.hg (glob) -BROKEN: d36c should remain public $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n' o 2:c882 draft b | - @ 1:d36c draft c + @ 1:d36c public c | o 0:cb9a public a diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -38,7 +38,7 @@ totalhash = hashlib.sha1(''.join(allhashes)).hexdigest() name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix) -cgversion = changegroup.safeversion(repo) +cgversion = changegroup.localversion(repo) comp = None if cgversion != '01': bundletype = "HG20" diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -872,6 +872,11 @@ versions.discard('02') return versions +def localversion(repo): +# Finds the best version to use for bundles that are meant to be used +# locally, such as those from strip and shelve, and temporary bundles. +return max(supportedoutgoingversions(repo)) + def safeversion(repo): # Finds the smallest version that it's safe to assume clients of the repo # will support. For example, all hg versions that support generaldelta also To: martinvonz, #hg-reviewers, indygreg, quark, durham, durin42 Cc: quark, indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D663: dirstate: perform transactions with _map using single call, where possible
This revision was automatically updated to reflect the committed changes. Closed by commit rHG6d734a3a76e2: dirstate: perform transactions with _map using single call, where possible (authored by mbolin, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D663?vs=1817=1842 REVISION DETAIL https://phab.mercurial-scm.org/D663 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 @@ -550,7 +550,8 @@ for d in util.finddirs(f): if d in self._dirs: break -if d in self._map and self[d] != 'r': +entry = self._map.get(d) +if entry is not None and entry[0] != 'r': raise error.Abort( _('file %r in dirstate clashes with %r') % (d, f)) if oldstate in "?r" and "_dirs" in self.__dict__: @@ -580,22 +581,23 @@ def normallookup(self, f): '''Mark a file normal, but possibly dirty.''' -if self._pl[1] != nullid and f in self._map: +if self._pl[1] != nullid: # if there is a merge going on and the file was either # in state 'm' (-1) or coming from other parent (-2) before # being removed, restore that state. -entry = self._map[f] -if entry[0] == 'r' and entry[2] in (-1, -2): -source = self._copymap.get(f) -if entry[2] == -1: -self.merge(f) -elif entry[2] == -2: -self.otherparent(f) -if source: -self.copy(source, f) -return -if entry[0] == 'm' or entry[0] == 'n' and entry[2] == -2: -return +entry = self._map.get(f) +if entry is not None: +if entry[0] == 'r' and entry[2] in (-1, -2): +source = self._copymap.get(f) +if entry[2] == -1: +self.merge(f) +elif entry[2] == -2: +self.otherparent(f) +if source: +self.copy(source, f) +return +if entry[0] == 'm' or entry[0] == 'n' and entry[2] == -2: +return self._addpath(f, 'n', 0, -1, -1) self._copymap.pop(f, None) if f in self._nonnormalset: @@ -624,14 +626,15 @@ self._dirty = True self._droppath(f) size = 0 -if self._pl[1] != nullid and f in self._map: -# backup the previous state -entry = self._map[f] -if entry[0] == 'm': # merge -size = -1 -elif entry[0] == 'n' and entry[2] == -2: # other parent -size = -2 -self._otherparentset.add(f) +if self._pl[1] != nullid: +entry = self._map.get(f) +if entry is not None: +# backup the previous state +if entry[0] == 'm': # merge +size = -1 +elif entry[0] == 'n' and entry[2] == -2: # other parent +size = -2 +self._otherparentset.add(f) self._map[f] = dirstatetuple('r', 0, size, 0) self._nonnormalset.add(f) if size == 0: To: mbolin, #hg-reviewers, phillco, yuja Cc: yuja, phillco, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH] revlog: update signature of dummy addgroup() in bundlerepo and unionrepo
# HG changeset patch # User Yuya Nishihara# Date 1505487525 -32400 # Fri Sep 15 23:58:45 2017 +0900 # Node ID 18004bf555f8c1087753ab3ca3a16741c0ce6482 # Parent 98010c7a5745e1b47bf17268ef023338d5989274 revlog: update signature of dummy addgroup() in bundlerepo and unionrepo Per c8b6ed51386b, 2f5c45fe3a3b and 00e3f909907f. diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -164,7 +164,7 @@ class bundlerevlog(revlog.revlog): def addrevision(self, text, transaction, link, p1=None, p2=None, d=None): raise NotImplementedError -def addgroup(self, revs, linkmapper, transaction): +def addgroup(self, deltas, transaction, addrevisioncb=None): raise NotImplementedError def strip(self, rev, minlink): raise NotImplementedError diff --git a/mercurial/unionrepo.py b/mercurial/unionrepo.py --- a/mercurial/unionrepo.py +++ b/mercurial/unionrepo.py @@ -126,7 +126,7 @@ class unionrevlog(revlog.revlog): def addrevision(self, text, transaction, link, p1=None, p2=None, d=None): raise NotImplementedError -def addgroup(self, revs, linkmapper, transaction): +def addgroup(self, deltas, transaction, addrevisioncb=None): raise NotImplementedError def strip(self, rev, minlink): raise NotImplementedError ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D714: tests: add test for issue5678
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb5d7e7d5c573: tests: add test for issue5678 (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D714?vs=1832=1846 REVISION DETAIL https://phab.mercurial-scm.org/D714 AFFECTED FILES tests/test-rebase-scenario-global.t tests/test-strip.t CHANGE DETAILS diff --git a/tests/test-strip.t b/tests/test-strip.t --- a/tests/test-strip.t +++ b/tests/test-strip.t @@ -1097,3 +1097,25 @@ 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +) {'operation': 'replace', 'user': 'test'} 08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +) {'operation': 'replace', 'user': 'test'} 26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +) {'operation': 'replace', 'user': 'test'} + $ cd .. + +Test that obsmarkers are restored even when not using generaldelta + + $ hg --config format.usegeneraldelta=no init issue5678 + $ cd issue5678 + $ cat >> .hg/hgrc < [experimental] + > evolution=all + > EOF + $ echo a > a + $ hg ci -Aqm a + $ hg ci --amend -m a2 + $ hg debugobsolete + cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +) {'user': 'test'} + $ hg strip . + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg (glob) + $ hg unbundle -q .hg/strip-backup/* +BROKEN: obsmarker got lost + $ hg debugobsolete + $ cd .. diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t --- a/tests/test-rebase-scenario-global.t +++ b/tests/test-rebase-scenario-global.t @@ -375,6 +375,40 @@ $ cd .. +Check that temporary bundle doesn't lose phase when not using generaldelta + + $ hg --config format.usegeneraldelta=no init issue5678 + $ cd issue5678 + $ grep generaldelta .hg/requires + [1] + $ echo a > a + $ hg ci -Aqm a + $ echo b > b + $ hg ci -Aqm b + $ hg co -q '.^' + $ echo c > c + $ hg ci -Aqm c + $ hg phase --public + $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n' + @ 2:d36c public c + | + | o 1:d2ae draft b + |/ + o 0:cb9a public a + + $ hg rebase -s 1 -d 2 + rebasing 1:d2ae7f538514 "b" + saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/d2ae7f538514-2953539b-rebase.hg (glob) +BROKEN: d36c should remain public + $ hg log -G -T '{rev}:{node|shortest} {phase} {desc}\n' + o 2:c882 draft b + | + @ 1:d36c draft c + | + o 0:cb9a public a + + $ cd .. + Test for revset We need a bit different graph To: martinvonz, #hg-reviewers, quark, indygreg, durin42 Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH buildfix] tests: fix test-uncommit.t to not rely on GNU rm's flags behavior
# HG changeset patch # User Augie Fackler# Date 1505502693 14400 # Fri Sep 15 15:11:33 2017 -0400 # Node ID 042b6de785af1dd5a65c4cc7202d8a1004ab # Parent 99a25fd51eee06baf00117114f84b630dd75f15e tests: fix test-uncommit.t to not rely on GNU rm's flags behavior FreeBSD rm(1) was failing thus: --- test-uncommit.t +++ test-uncommit.t.err @@ -299,6 +299,9 @@ $ cd .. $ rm repo1 -rf + rm: repo1: is a directory + rm: -rf: No such file or directory + [1] Testing uncommit while merge diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t --- a/tests/test-uncommit.t +++ b/tests/test-uncommit.t @@ -298,7 +298,7 @@ Uncommit leaving an empty changeset A Q $ cd .. - $ rm repo1 -rf + $ rm -rf repo1 Testing uncommit while merge ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH buildfix v2] tests: fix test-uncommit.t to not rely on GNU rm's flags behavior
# HG changeset patch # User Augie Fackler# Date 1505502693 14400 # Fri Sep 15 15:11:33 2017 -0400 # Node ID 933ca2b610855d7479a2514e81b5eb9ad1c13cb4 # Parent 99a25fd51eee06baf00117114f84b630dd75f15e tests: fix test-uncommit.t to not rely on GNU rm's flags behavior FreeBSD rm(1) was failing thus: > --- test-uncommit.t > +++ test-uncommit.t.err > @@ -299,6 +299,9 @@ > >$ cd .. >$ rm repo1 -rf > + rm: repo1: is a directory > + rm: -rf: No such file or directory > + [1] > > Testing uncommit while merge diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t --- a/tests/test-uncommit.t +++ b/tests/test-uncommit.t @@ -298,7 +298,7 @@ Uncommit leaving an empty changeset A Q $ cd .. - $ rm repo1 -rf + $ rm -rf repo1 Testing uncommit while merge ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D722: obsmarker: track operation by default
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We added support for including the operation responsible for creating the obsmarker in https://phab.mercurial-scm.org/rHG3546a771e376f55e7051149673d368d53d85f8d0 (obsolete: add operation metadata to rebase/amend/histedit obsmarkers, 2017-05-09). However, soon thereafter, in https://phab.mercurial-scm.org/rHGf432897a9f4926c9abb58e1ca667a7fa1e5f91f0 (obsmarker: add an experimental flag controlling "operation" recording, 2017-05-20), it was hidden behind a config that was off by default. It seems unlikely that people will manually turn it on, and obsmarkers/evolution as a whole is still experimental anyway, so let's turn on the tracking by default. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D722 AFFECTED FILES mercurial/configitems.py tests/test-drawdag.t tests/test-histedit-obsolete.t tests/test-obsmarker-template.t tests/test-obsolete-divergent.t tests/test-obsolete.t tests/test-rebase-obsolete.t CHANGE DETAILS diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t --- a/tests/test-rebase-obsolete.t +++ b/tests/test-rebase-obsolete.t @@ -101,9 +101,9 @@ o 0:cd010b8cd998 A $ hg debugobsolete - 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (*) {'user': 'test'} (glob) - 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (*) {'user': 'test'} (glob) - 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (*) {'user': 'test'} (glob) + 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} + 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} + 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} $ cd .. @@ -171,20 +171,20 @@ o 0:cd010b8cd998 A $ hg debugobsolete - 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob) - 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob) - 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob) + 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} + 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} + 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} More complex case where part of the rebase set were already rebased $ hg rebase --rev 'desc(D)' --dest 'desc(H)' rebasing 9:08483444fef9 "D" $ hg debugobsolete - 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob) - 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob) - 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob) - 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob) + 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} + 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} + 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} + 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (Thu Jan 01 00:00:00 1970 +) {'operation': 'rebase', 'user': 'test'} $ hg log -G @ 11:4596109a6a43 D | @@ -209,12 +209,12 @@ note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D" (tip) rebasing 10:5ae4c968c6ac "C" $ hg debugobsolete - 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob) - 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob) - 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob) -
D723: templates: introduce a obsfateoperation() function
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/D723 AFFECTED FILES mercurial/obsutil.py mercurial/templater.py tests/test-obsmarker-template.t CHANGE DETAILS diff --git a/tests/test-obsmarker-template.t b/tests/test-obsmarker-template.t --- a/tests/test-obsmarker-template.t +++ b/tests/test-obsmarker-template.t @@ -14,9 +14,10 @@ > [templates] > obsfatesuccessors = "{if(successors, " as ")}{join(successors, ", ")}" > obsfateverb = "{obsfateverb(successors)}" + > obsfateoperations = "{if(obsfateoperations(markers), " using {join(obsfateoperations(markers), ", ")}")}" > 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})")}")}" - > obsfate = "{obsfateverb}{obsfateoperation}{obsfatesuccessors}{obsfateusers}{obsfatedate}; " + > obsfate = "{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}; " > [alias] > tlog = log -G -T '{node|short}\ > {if(predecessors, "\n Predecessors: {predecessors}")}\ @@ -90,21 +91,21 @@ o d004c8f274b9 | | @ 471f378eab4c - |/ Obsfate: rewritten as 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 3: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 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 3: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 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); o ea207398892e $ hg up 'desc(A1)' --hidden @@ -127,7 +128,7 @@ o d004c8f274b9 | | @ a468dc9b3633 - |/ Obsfate: rewritten as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); + |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); o ea207398892e Predecessors template should show all the predecessors as we force their display @@ -156,9 +157,9 @@ o d004c8f274b9 | | @ a468dc9b3633 - |/ Obsfate: rewritten as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); + |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); | x 471f378eab4c - |/ Obsfate: rewritten as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); o ea207398892e @@ -201,9 +202,9 @@ @ d004c8f274b9 | | x a468dc9b3633 - |/ Obsfate: rewritten as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); + |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); | x 471f378eab4c - |/ Obsfate: rewritten as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); o ea207398892e $ hg fatelogjson --hidden @@ -653,7 +654,7 @@ | o fdf9bde5129a |/ | @ 471f378eab4c - |/ Obsfate: rewritten as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +); rewritten as 4:019fadeab383 by test (at 1970-01-01 00:00 +); + |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +); rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +); o ea207398892e $ hg up 'desc(A1)' @@ -709,11 +710,11 @@ o 019fadeab383 | | x 65b757b745b9 - |/ Obsfate: rewritten as 4:019fadeab383 by test (at 1970-01-01 00:00 +); + |/ Obsfate: rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +); | @ fdf9bde5129a |/ | x 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 +); + |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +); rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +); o ea207398892e @@ -859,7 +860,7 @@ o eb5a0daa2192 | | @ 0dec01379d3b - | |Obsfate: rewritten as
D674: filemerge: use arbitraryfilectx for backup files
phillco planned changes to this revision. phillco added a comment. Putting back in my queue -- still have two comments of Martin's to respond to. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D674 To: phillco, #hg-reviewers Cc: sid0, martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH buildfix-svn] tests: fix test-convert-hg-svn.t for e34abf9e8c
# HG changeset patch # User Augie Fackler# Date 1505503981 14400 # Fri Sep 15 15:33:01 2017 -0400 # Node ID 6527d101d236a8e54225772f077f3a175bf17b75 # Parent 99a25fd51eee06baf00117114f84b630dd75f15e tests: fix test-convert-hg-svn.t for e34abf9e8c For some reason this test should have been specifying convert.svn.trunk all along, but the listed commit was what broke things. diff --git a/tests/test-convert-hg-svn.t b/tests/test-convert-hg-svn.t --- a/tests/test-convert-hg-svn.t +++ b/tests/test-convert-hg-svn.t @@ -8,6 +8,8 @@ > [extensions] > convert = > mq = + > [convert] + > svn.trunk = > EOF $ SVNREPOPATH=`pwd`/svn-repo ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH buildfix v2] tests: fix test-uncommit.t to not rely on GNU rm's flags behavior
On Fri, Sep 15, 2017 at 12:16 PM, Augie Facklerwrote: > > # HG changeset patch > # User Augie Fackler > # Date 1505502693 14400 > # Fri Sep 15 15:11:33 2017 -0400 > # Node ID 933ca2b610855d7479a2514e81b5eb9ad1c13cb4 > # Parent 99a25fd51eee06baf00117114f84b630dd75f15e > tests: fix test-uncommit.t to not rely on GNU rm's flags behavior Queued, thanks! ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D477: revlog: add option to mmap revlog index
durham added a comment. Also, the improvements should become more pronounced if we fix some algorithms (like phases) that access really old commits. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D477 To: mbthomas, #fbhgext, indygreg, #hg-reviewers, durin42, quark Cc: durham, quark, durin42, simonfar, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@34142: 15 new changesets
15 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/82bd4c5a81e5 changeset: 34128:82bd4c5a81e5 user:Yuya Nishiharadate:Sun Sep 10 23:37:14 2017 +0900 summary: extensions: fix wrapcommand/function of class instance https://www.mercurial-scm.org/repo/hg/rev/902219a99901 changeset: 34129:902219a99901 user:Yuya Nishihara date:Thu Sep 07 22:27:23 2017 +0900 summary: debuginstall: use codecs.lookup() to detect invalid encoding https://www.mercurial-scm.org/repo/hg/rev/ada8a19672ab changeset: 34130:ada8a19672ab user:Yuya Nishihara date:Thu Sep 07 22:36:54 2017 +0900 summary: debuginstall: do not pass exception object to formatter (issue5676) https://www.mercurial-scm.org/repo/hg/rev/0fa781320203 changeset: 34131:0fa781320203 user:Yuya Nishihara date:Sun Sep 03 14:32:11 2017 +0900 summary: doctest: bulk-replace string literals with b'' for Python 3 https://www.mercurial-scm.org/repo/hg/rev/264872544362 changeset: 34132:264872544362 user:Yuya Nishihara date:Sun Sep 03 14:35:37 2017 +0900 summary: doctest: replace .iteritems() with .items() https://www.mercurial-scm.org/repo/hg/rev/708b5530a273 changeset: 34133:708b5530a273 user:Yuya Nishihara date:Sun Sep 03 14:37:25 2017 +0900 summary: doctest: replace chr() with pycompat.bytechr() https://www.mercurial-scm.org/repo/hg/rev/d4d4d11bac77 changeset: 34134:d4d4d11bac77 user:Yuya Nishihara date:Sun Sep 03 14:38:58 2017 +0900 summary: doctest: replace str() with bytes() https://www.mercurial-scm.org/repo/hg/rev/e9e225f16932 changeset: 34135:e9e225f16932 user:Yuya Nishihara date:Sun Sep 03 15:42:27 2017 +0900 summary: doctest: pass encoding name as system string https://www.mercurial-scm.org/repo/hg/rev/414a3513c2bd changeset: 34136:414a3513c2bd user:Yuya Nishihara date:Sun Sep 03 15:47:17 2017 +0900 summary: doctest: do not embed non-ascii characters in docstring https://www.mercurial-scm.org/repo/hg/rev/a8994d08e4a2 changeset: 34137:a8994d08e4a2 user:Yuya Nishihara date:Sun Sep 03 14:56:31 2017 +0900 summary: doctest: use print_function and convert bytes to unicode where needed https://www.mercurial-scm.org/repo/hg/rev/0f9936d80e01 changeset: 34138:0f9936d80e01 user:Yuya Nishihara date:Sun Sep 03 15:16:01 2017 +0900 summary: doctest: upgrade old-style "except" clause https://www.mercurial-scm.org/repo/hg/rev/be00af4a1ac5 changeset: 34139:be00af4a1ac5 user:Yuya Nishihara date:Sun Sep 03 17:33:10 2017 +0900 summary: doctest: coerce dict.keys() to list https://www.mercurial-scm.org/repo/hg/rev/52ec9ac0303b changeset: 34140:52ec9ac0303b user:Yuya Nishihara date:Thu Aug 24 22:33:28 2017 +0900 summary: doctest: normalize b'', u'' and exception output on Python 3 https://www.mercurial-scm.org/repo/hg/rev/9b4d7d4855f5 changeset: 34141:9b4d7d4855f5 user:Yuya Nishihara date:Sun Sep 03 15:09:04 2017 +0900 summary: doctest: enable tests by default on Python 3 https://www.mercurial-scm.org/repo/hg/rev/24bf823377fc changeset: 34142:24bf823377fc bookmark:@ tag: tip user:Phil Cohen date:Tue Sep 12 19:27:01 2017 -0700 summary: merge: move cwd-missing detection to helper functions -- 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
D724: templater: extract shortest() logic from template function
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It can be useful for extensions to be able to produce the shortest unambiguous hash. That logic is currently inside the shortest() template function. Let's move it out of the templater. I've put it scmutil because I couldn't think of a better place, but I'm happy to move it if someone tells me where to put it. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D724 AFFECTED FILES mercurial/scmutil.py mercurial/templater.py CHANGE DETAILS diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -24,6 +24,7 @@ registrar, revset as revsetmod, revsetlang, +scmutil, templatefilters, templatekw, util, @@ -1023,41 +1024,7 @@ # which would be unacceptably slow. so we look for hash collision in # unfiltered space, which means some hashes may be slightly longer. cl = mapping['ctx']._repo.unfiltered().changelog -def isvalid(test): -try: -if cl._partialmatch(test) is None: -return False - -try: -i = int(test) -# if we are a pure int, then starting with zero will not be -# confused as a rev; or, obviously, if the int is larger than -# the value of the tip rev -if test[0] == '0' or i > len(cl): -return True -return False -except ValueError: -return True -except error.RevlogError: -return False -except error.WdirUnsupported: -# single 'ff...' match -return True - -shortest = node -startlength = max(6, minlength) -length = startlength -while True: -test = node[:length] -if isvalid(test): -shortest = test -if length == minlength or length > startlength: -return shortest -length -= 1 -else: -length += 1 -if len(shortest) <= length: -return shortest +return scmutil.shortest(cl, node, minlength) @templatefunc('strip(text[, chars])') def strip(context, mapping, args): diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -418,6 +418,43 @@ tree = revsetlang.parse(revspec) return tree and tree[0] in ('range', 'rangepre', 'rangepost', 'rangeall') +def shortest(revlog, node, minlength): +def isvalid(test): +try: +if revlog._partialmatch(test) is None: +return False + +try: +i = int(test) +# if we are a pure int, then starting with zero will not be +# confused as a rev; or, obviously, if the int is larger than +# the value of the tip rev +if test[0] == '0' or i > len(revlog): +return True +return False +except ValueError: +return True +except error.RevlogError: +return False +except error.WdirUnsupported: +# single 'ff...' match +return True + +shortest = node +startlength = max(6, minlength) +length = startlength +while True: +test = node[:length] +if isvalid(test): +shortest = test +if length == minlength or length > startlength: +return shortest +length -= 1 +else: +length += 1 +if len(shortest) <= length: +return shortest + def revpair(repo, revs): if not revs: return repo.dirstate.p1(), None 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
Re: [PATCH windows] tests: add and remove some (glob) markers
> On Sep 15, 2017, at 22:08, Augie Facklerwrote: > > # HG changeset patch > # User Augie Fackler > # Date 1505527705 14400 > # Fri Sep 15 22:08:25 2017 -0400 > # Node ID 0da0e691552a428641c75e1633e5f1d0fbf3483e > # Parent 209120041d12b524648fa856732aa404dfedd91d > tests: add and remove some (glob) markers These are the sane-looking failures on the Windows buildbot. The run-tests failure looks like some sort of environment variable setting dance is failing on Windows (huh?), and I'm singularly baffled by the test-patchbomb-tls.t failure. But we're close to getting that builder to pass. > > I have no idea if these changes are reasonable, but they look like > they'd help on the Windows buildbot. > > diff --git a/tests/test-drawdag.t b/tests/test-drawdag.t > --- a/tests/test-drawdag.t > +++ b/tests/test-drawdag.t > @@ -261,12 +261,12 @@ Change file contents via comments > a > FILE B > b > - FILE dir1/a > + FILE dir1/a (glob) > 1 > 2 > - FILE dir1/c > + FILE dir1/c (glob) > 5 > - FILE dir2/b > + FILE dir2/b (glob) > 34 > - FILE dir2/c > + FILE dir2/c (glob) > 6 > diff --git a/tests/test-lfconvert.t b/tests/test-lfconvert.t > --- a/tests/test-lfconvert.t > +++ b/tests/test-lfconvert.t > @@ -128,7 +128,7 @@ add some changesets to rename/remove/mer > $ hg merge > merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat > merging sub/normal2 and stuff/normal2 to stuff/normal2 > - warning: stuff/maybelarge.dat looks like a binary file. (glob) > + warning: stuff/maybelarge.dat looks like a binary file. > warning: conflicts while merging stuff/maybelarge.dat! (edit, then use 'hg > resolve --mark') > 0 files updated, 1 files merged, 0 files removed, 1 files unresolved > use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to > abandon > diff --git a/tests/test-shelve.t b/tests/test-shelve.t > --- a/tests/test-shelve.t > +++ b/tests/test-shelve.t > @@ -352,7 +352,7 @@ force a conflicted merge to occur > > # Unresolved merge conflicts: > # > - # a/a > + # a/a (glob) > # > # To mark files as resolved: hg resolve --mark FILE > > ___ > Mercurial-devel mailing list > Mercurial-devel@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
mercurial@34145: 3 new changesets (3 on stable)
3 new changesets (3 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/b5d7e7d5c573 changeset: 34143:b5d7e7d5c573 branch: stable parent: 34090:987a85c42b08 user:Martin von Zweigbergkdate:Thu Sep 14 11:16:47 2017 -0700 summary: tests: add test for issue5678 https://www.mercurial-scm.org/repo/hg/rev/91f0677dc920 changeset: 34144:91f0677dc920 branch: stable user:Martin von Zweigbergk date:Thu Sep 14 11:16:57 2017 -0700 summary: repair: preserve phase also when not using generaldelta (issue5678) https://www.mercurial-scm.org/repo/hg/rev/1908dc958639 changeset: 34145:1908dc958639 branch: stable tag: tip user:Durham Goode date:Mon Sep 11 15:59:18 2017 -0700 summary: ssh: fix flakey ssh errors on BSD systems -- 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 windows] tests: add and remove some (glob) markers
# HG changeset patch # User Augie Fackler# Date 1505527705 14400 # Fri Sep 15 22:08:25 2017 -0400 # Node ID 0da0e691552a428641c75e1633e5f1d0fbf3483e # Parent 209120041d12b524648fa856732aa404dfedd91d tests: add and remove some (glob) markers I have no idea if these changes are reasonable, but they look like they'd help on the Windows buildbot. diff --git a/tests/test-drawdag.t b/tests/test-drawdag.t --- a/tests/test-drawdag.t +++ b/tests/test-drawdag.t @@ -261,12 +261,12 @@ Change file contents via comments a FILE B b - FILE dir1/a + FILE dir1/a (glob) 1 2 - FILE dir1/c + FILE dir1/c (glob) 5 - FILE dir2/b + FILE dir2/b (glob) 34 - FILE dir2/c + FILE dir2/c (glob) 6 diff --git a/tests/test-lfconvert.t b/tests/test-lfconvert.t --- a/tests/test-lfconvert.t +++ b/tests/test-lfconvert.t @@ -128,7 +128,7 @@ add some changesets to rename/remove/mer $ hg merge merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat merging sub/normal2 and stuff/normal2 to stuff/normal2 - warning: stuff/maybelarge.dat looks like a binary file. (glob) + warning: stuff/maybelarge.dat looks like a binary file. warning: conflicts while merging stuff/maybelarge.dat! (edit, then use 'hg resolve --mark') 0 files updated, 1 files merged, 0 files removed, 1 files unresolved use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -352,7 +352,7 @@ force a conflicted merge to occur # Unresolved merge conflicts: # - # a/a + # a/a (glob) # # To mark files as resolved: hg resolve --mark FILE ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH windows] tests: add and remove some (glob) markers
On Fri, 15 Sep 2017 22:08:45 -0400, Augie Facklerwrote: # HG changeset patch # User Augie Fackler # Date 1505527705 14400 # Fri Sep 15 22:08:25 2017 -0400 # Node ID 0da0e691552a428641c75e1633e5f1d0fbf3483e # Parent 209120041d12b524648fa856732aa404dfedd91d tests: add and remove some (glob) markers I got a clean run with this here, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH windows] tests: add and remove some (glob) markers
On Fri, 15 Sep 2017 22:14:31 -0400, Augie Facklerwrote: On Sep 15, 2017, at 22:08, Augie Fackler wrote: # HG changeset patch # User Augie Fackler # Date 1505527705 14400 # Fri Sep 15 22:08:25 2017 -0400 # Node ID 0da0e691552a428641c75e1633e5f1d0fbf3483e # Parent 209120041d12b524648fa856732aa404dfedd91d tests: add and remove some (glob) markers These are the sane-looking failures on the Windows buildbot. The run-tests failure looks like some sort of environment variable setting dance is failing on Windows (huh?), and I'm singularly baffled by the test-patchbomb-tls.t failure. But we're close to getting that builder to pass. I'm baffled by the run-tests failure too. The test runs fine outside of buildbot on that system. Any chance you can force a debug run of this test, to see what is lurking behind $RUNTESTDIR? The patchbomb test failure is transient. I've seen cases where `hg serve` daemons from the previous run aren't killed for some reason. Aside from subsequent serve errors, a telltale sign is the warnings in the build phase dropping from 7 to 1, as the C code isn't rebuilt. (Compare before[1] and after[2] the Patch Tuesday reboot.) When I notice that, I have to manually kill off the stuck python process. But sometimes there is no stuck process, and these *.t errors clear on their own. I wonder if the serve process looks like it is running to the parent process, which stops waiting, but it hasn't opened the listening port yet when a test process tries to connect. I'll check Monday to see if python processes are stuck. [1] https://buildbot.mercurial-scm.org/builders/Win7%20x86_64%20hg%20tests/builds/181/steps/make%20local/logs/stdio [2] https://buildbot.mercurial-scm.org/builders/Win7%20x86_64%20hg%20tests/builds/183/steps/make%20local/logs/stdio ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D542: effectflag: document effect flag
quark requested changes to this revision. quark added a comment. This revision now requires changes to proceed. In https://phab.mercurial-scm.org/D542#11973, @lothiraldan wrote: > @quark Thank you for reposting your comment here, it's helpful to not lose track > on all these discussions. > > We've had this experiment in Evolve for a little while now and the users using it > are giving positive feedback. The next step is to upstream it in core but turned off by > default like the others experiments and gather data and feedback. I think the upstream has a higher barrier about implementation details. A lot of fb extensions need to be partially or completely rewritten before going upstream. I'm not sure if evolve is somehow an exception. But it does not feel quite right especially because your approach has known hard-to-solve defect and there are known better alternatives. > [...] > I propose that we start a separate experiment, so users could use it > separately from effect-flag. I would be happy to collaborate on a first > version of this experiment before the sprint and use the sprint to further > discuss the design, what do you think ? I'm not going to the sprint this time unfortunately. But if you have //concrete// examples where effect-flag is better in theory, I'd be happy to discuss them here. Since you have admitted the defect without giving a solution, and did not response to the alternative I proposed, I'm still -1 on this series. I have marked it explicitly hopefully to make other reviewers' life easier. I think what I proposed is not hard to implement (I can complete it in 3 work days), so if you can help implement it instead, that'll be great and I'll be happy to provide technical help for any difficulty you encounter. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D542 To: lothiraldan, #hg-reviewers, quark Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D612: command: add a cmdtype argument to registrar.command
quark added subscribers: indygreg, quark. quark added a comment. I think @indygreg has some ideas around making "read-only" vs "writable" repo objects. I personally think it's cleaner to make this repo level. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D612 To: pulkit, #hg-reviewers, durham Cc: quark, indygreg, smf, yuja, durham, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH stable] ssh: fix flakey ssh errors on BSD systems
On Fri, Sep 15, 2017 at 2:32 PM, Augie Facklerwrote: > # HG changeset patch > # User Durham Goode > # Date 1505170758 25200 > # Mon Sep 11 15:59:18 2017 -0700 > # Branch stable > # Node ID 7d51e7a6ca176e3de6a8f1c4881afacbf4687487 > # Parent 91f0677dc92028e4778f58adf365940fbed48fa9 > ssh: fix flakey ssh errors on BSD systems Queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D477: revlog: add option to mmap revlog index
quark added a comment. In https://phab.mercurial-scm.org/D477#12028, @mbthomas wrote: > I had put the numbers in the commit message, but that doesn't update the Phabricator summary, so I've done that manually. I think you were using `arc` and can use `hg phabsend` to get the commit message updated. See https://www.mercurial-scm.org/wiki/Phabricator for instructions. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D477 To: mbthomas, #fbhgext, indygreg, #hg-reviewers, durin42, quark Cc: durham, quark, durin42, simonfar, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH stable] ssh: fix flakey ssh errors on BSD systems
# HG changeset patch # User Durham Goode# Date 1505170758 25200 # Mon Sep 11 15:59:18 2017 -0700 # Branch stable # Node ID 7d51e7a6ca176e3de6a8f1c4881afacbf4687487 # Parent 91f0677dc92028e4778f58adf365940fbed48fa9 ssh: fix flakey ssh errors on BSD systems This is a trivial backport of c037fd655b47 performed by au...@google.com, but the change is still really Durham's not mine, so I [augie] am leaving him as the author. diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py --- a/mercurial/sshpeer.py +++ b/mercurial/sshpeer.py @@ -190,23 +190,33 @@ class sshpeer(wireproto.wirepeer): self.pipei = doublepipe(self.ui, self.pipei, self.pipee) self.pipeo = doublepipe(self.ui, self.pipeo, self.pipee) -# skip any noise generated by remote shell -self._callstream("hello") -r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40))) +def badresponse(): +self._abort(error.RepoError(_('no suitable response from ' + 'remote hg'))) + +try: +# skip any noise generated by remote shell +self._callstream("hello") +r = self._callstream("between", pairs=("%s-%s" % ("0"*40, "0"*40))) +except IOError: +badresponse() + lines = ["", "dummy"] max_noise = 500 while lines[-1] and max_noise: -l = r.readline() -self.readerr() -if lines[-1] == "1\n" and l == "\n": -break -if l: -self.ui.debug("remote: ", l) -lines.append(l) -max_noise -= 1 +try: +l = r.readline() +self.readerr() +if lines[-1] == "1\n" and l == "\n": +break +if l: +self.ui.debug("remote: ", l) +lines.append(l) +max_noise -= 1 +except IOError: +badresponse() else: -self._abort(error.RepoError(_('no suitable response from ' - 'remote hg'))) +badresponse() self._caps = set() for l in reversed(lines): ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH buildfix-svn] tests: fix test-convert-hg-svn.t for e34abf9e8c
On Fri, Sep 15, 2017 at 12:34 PM, Augie Facklerwrote: > # HG changeset patch > # User Augie Fackler > # Date 1505503981 14400 > # Fri Sep 15 15:33:01 2017 -0400 > # Node ID 6527d101d236a8e54225772f077f3a175bf17b75 > # Parent 99a25fd51eee06baf00117114f84b630dd75f15e > tests: fix test-convert-hg-svn.t for e34abf9e8c > > For some reason this test should have been specifying > convert.svn.trunk all along, but the listed commit was what broke > things. After some testing, it turns out that the config is also read here: https://www.mercurial-scm.org/repo/hg/file/24bf823377fc/hgext/convert/subversion.py#l406. There, the default is effectively None. So I'll drop Boris's patch instead and he can send a new version. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: D529: uncommit: move fb-extension to core which uncommits a changeset
We've had some discussion about this on irc. The evolve behavior of preserving empty commits is important in one circumstance: when the commit will briefly be empty, but should retain its identity for the purposes of evolution. Personally, I've never used uncommit and ended up with an empty commit (via the evolve version, which I currently use), so I've got a pretty strong sense that this is an edge case. Here's where we're landing for the time being: We'll add --keep to uncommit, preserve the current default, but refuse to do no-arguments `uncommit` if the working directory is dirty. This prevents users from accidentally blowing their foot off in the cases that are the most likely to cause pain. This still leaves some difficulty at the margins (how do you uncommit everything if you've got a dirty working directory?), but we can probably overcome that in time. One thing we hope will help there is a generalized `hg undo` command, which it sounds like Facebook has at least partially drafted. Note that this is not necessarily a final state for uncommit: it's possible that after further experimentation we'll flip the default, or otherwise adjust behavior. It's a complicated balancing act between what's intuitive (which we don't all agree on) and preserving the richest metadata possible. Thanks, Augie > On Sep 15, 2017, at 12:03, pulkit (Pulkit Goyal) >wrote: > > This revision was automatically updated to reflect the committed changes. > Closed by commit rHGd01819c8f3c4: uncommit: move fb-extension to core which > uncommits a changeset (authored by pulkit, committed by ). > > REPOSITORY > rHG Mercurial > > CHANGES SINCE LAST UPDATE > https://phab.mercurial-scm.org/D529?vs=1823=1848 > > REVISION DETAIL > https://phab.mercurial-scm.org/D529 > > AFFECTED FILES > hgext/uncommit.py > tests/test-uncommit.t > > CHANGE DETAILS > > diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t > new file mode 100644 > --- /dev/null > +++ b/tests/test-uncommit.t > @@ -0,0 +1,366 @@ > +Test uncommit - set up the config > + > + $ cat >> $HGRCPATH < + > [experimental] > + > evolution=createmarkers, allowunstable > + > [extensions] > + > uncommit = > + > drawdag=$TESTDIR/drawdag.py > + > EOF > + > +Build up a repo > + > + $ hg init repo > + $ cd repo > + $ hg bookmark foo > + > +Help for uncommit > + > + $ hg help uncommit > + hg uncommit [OPTION]... [FILE]... > + > + uncommit part or all of a local changeset > + > + This command undoes the effect of a local commit, returning the > affected > + files to their uncommitted state. This means that files modified or > + deleted in the changeset will be left unchanged, and so will remain > + modified in the working directory. > + > + (use 'hg help -e uncommit' to show help for the uncommit extension) > + > + options ([+] can be repeated): > + > + --empty allow an empty commit after uncommiting > + -I --include PATTERN [+] include names matching the given patterns > + -X --exclude PATTERN [+] exclude names matching the given patterns > + > + (some details hidden, use --verbose to show complete help) > + > +Uncommit with no commits should fail > + > + $ hg uncommit > + abort: cannot uncommit null changeset > + [255] > + > +Create some commits > + > + $ touch files > + $ hg add files > + $ for i in a ab abc abcd abcde; do echo $i > files; echo $i > file-$i; hg > add file-$i; hg commit -m "added file-$i"; done > + $ ls > + file-a > + file-ab > + file-abc > + file-abcd > + file-abcde > + files > + > + $ hg log -G -T '{rev}:{node} {desc}' --hidden > + @ 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde > + | > + o 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd > + | > + o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc > + | > + o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab > + | > + o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a > + > +Simple uncommit off the top, also moves bookmark > + > + $ hg bookmark > + * foo 4:6c4fd43ed714 > + $ hg uncommit > + $ hg status > + M files > + A file-abcde > + $ hg bookmark > + * foo 3:6db330d65db4 > + > + $ hg log -G -T '{rev}:{node} {desc}' --hidden > + x 4:6c4fd43ed714e7fcd8adbaa7b16c953c2e985b60 added file-abcde > + | > + @ 3:6db330d65db434145c0b59d291853e9a84719b24 added file-abcd > + | > + o 2:abf2df566fc193b3ac34d946e63c1583e4d4732b added file-abc > + | > + o 1:69a232e754b08d568c4899475faf2eb44b857802 added file-ab > + | > + o 0:3004d2d9b50883c1538fc754a3aeb55f1b4084f6 added file-a > + > + > +Recommit > + > + $ hg commit -m 'new change abcde' > + $ hg status > + $ hg heads -T '{rev}:{node} {desc}' > + 5:0c07a3ccda771b25f1cb1edbd02e683723344ef1 new change abcde (no-eol) > + > +Uncommit of non-existent and unchanged files has no effect > + $ hg uncommit
D724: templater: extract shortest() logic from template function
martinvonz updated this revision to Diff 1860. martinvonz edited the summary of this revision. Herald added a reviewer: indygreg. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D724?vs=1859=1860 REVISION DETAIL https://phab.mercurial-scm.org/D724 AFFECTED FILES mercurial/revlog.py mercurial/templater.py CHANGE DETAILS diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -1023,41 +1023,7 @@ # which would be unacceptably slow. so we look for hash collision in # unfiltered space, which means some hashes may be slightly longer. cl = mapping['ctx']._repo.unfiltered().changelog -def isvalid(test): -try: -if cl._partialmatch(test) is None: -return False - -try: -i = int(test) -# if we are a pure int, then starting with zero will not be -# confused as a rev; or, obviously, if the int is larger than -# the value of the tip rev -if test[0] == '0' or i > len(cl): -return True -return False -except ValueError: -return True -except error.RevlogError: -return False -except error.WdirUnsupported: -# single 'ff...' match -return True - -shortest = node -startlength = max(6, minlength) -length = startlength -while True: -test = node[:length] -if isvalid(test): -shortest = test -if length == minlength or length > startlength: -return shortest -length -= 1 -else: -length += 1 -if len(shortest) <= length: -return shortest +return cl.shortest(node, minlength) @templatefunc('strip(text[, chars])') def strip(context, mapping, args): diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -1128,6 +1128,44 @@ raise LookupError(id, self.indexfile, _('no match found')) +def shortest(self, hexnode, minlength=1): +"""Find the shortest unambiguous prefix that matches hexnode.""" +def isvalid(test): +try: +if self._partialmatch(test) is None: +return False + +try: +i = int(test) +# if we are a pure int, then starting with zero will not be +# confused as a rev; or, obviously, if the int is larger +# than the value of the tip rev +if test[0] == '0' or i > len(self): +return True +return False +except ValueError: +return True +except error.RevlogError: +return False +except error.WdirUnsupported: +# single 'ff...' match +return True + +shortest = hexnode +startlength = max(6, minlength) +length = startlength +while True: +test = hexnode[:length] +if isvalid(test): +shortest = test +if length == minlength or length > startlength: +return shortest +length -= 1 +else: +length += 1 +if len(shortest) <= length: +return shortest + def cmp(self, node, text): """compare text with a given file revision To: martinvonz, #hg-reviewers, quark, indygreg Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D724: templater: extract shortest() logic from template function
martinvonz added a comment. In https://phab.mercurial-scm.org/D724#12091, @quark wrote: > It might make sense to be a revlog method if we don't really care about the "cleanness" of revlog class. I slightly prefer that. Heh, that's what I decided to do. I apparently forgot to send it after tests had run, but now it's there. PTAL. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D724 To: martinvonz, #hg-reviewers, quark, indygreg Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D722: obsmarker: track operation by default
quark accepted this revision. quark added a comment. I think we do need this information recorded. Previous discussion suggests 10% increase in obsstore size is bad. But the current obsstore format has other stupid repetitive information like "user". So I won't blame this patch. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D722 To: martinvonz, #hg-reviewers, quark Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 6 of 8 py3] drawdag: tagsmod.tag() takes a list of names, not a single name
# HG changeset patch # User Augie Fackler# Date 1503465841 14400 # Wed Aug 23 01:24:01 2017 -0400 # Node ID 6780213e5a48edeef40d6fa24ef5cb939de8abdc # Parent 370f8212917c1af7e6189d3f0a7ca59ec49d1a4a drawdag: tagsmod.tag() takes a list of names, not a single name We were getting lucky on Python 2 since we have only one-byte names, but on Python 3 badness was happening. diff --git a/tests/drawdag.py b/tests/drawdag.py --- a/tests/drawdag.py +++ b/tests/drawdag.py @@ -346,7 +346,7 @@ def debugdrawdag(ui, repo, **opts): ctx = simplecommitctx(repo, name, pctxs, added) n = ctx.commit() committed[name] = n -tagsmod.tag(repo, name, n, message=None, user=None, date=None, +tagsmod.tag(repo, [name], n, message=None, user=None, date=None, local=True) # handle special comments ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 8 of 8 py3] drawdag: port to python 3
# HG changeset patch # User Augie Fackler# Date 1503465796 14400 # Wed Aug 23 01:23:16 2017 -0400 # Node ID d08554602cdbd245ddd213af325473da037a240f # Parent 962f6b24541c419fc135ebd75de8529344d85d31 drawdag: port to python 3 diff --git a/tests/drawdag.py b/tests/drawdag.py --- a/tests/drawdag.py +++ b/tests/drawdag.py @@ -92,6 +92,7 @@ from mercurial import ( error, node, obsolete, +pycompat, registrar, scmutil, tags as tagsmod, @@ -100,9 +101,9 @@ from mercurial import ( cmdtable = {} command = registrar.command(cmdtable) -_pipechars = '\\/+-|' -_nonpipechars = ''.join(chr(i) for i in xrange(33, 127) -if chr(i) not in _pipechars) +_pipechars = b'\\/+-|' +_nonpipechars = b''.join(pycompat.bytechr(i) for i in range(33, 127) +if pycompat.bytechr(i) not in _pipechars) def _isname(ch): """char -> bool. return True if ch looks like part of a name, False @@ -113,7 +114,7 @@ def _parseasciigraph(text): r"""str -> {str : [str]}. convert the ASCII graph to edges >>> import pprint ->>> pprint.pprint({k: [vv for vv in v] +>>> pprint.pprint({pycompat.sysstr(k): [pycompat.sysstr(vv) for vv in v] ... for k, v in _parseasciigraph(b''' ...G ...| @@ -132,8 +133,8 @@ def _parseasciigraph(text): 'G': ['F'], 'H': ['A'], 'I': ['H']} ->>> pprint.pprint({k: [vv for vv in v] -... for k, v in _parseasciigraph(br''' +>>> pprint.pprint({pycompat.sysstr(k): [pycompat.sysstr(vv) for vv in v] +... for k, v in _parseasciigraph(b''' ... ofoo ... |\ ... +---o bar @@ -150,11 +151,11 @@ def _parseasciigraph(text): ... ''').items()}) {'a': [], 'b': ['a'], - 'bar': ['b', 'a'], + 'bar': ['baz'], 'baz': [], 'c': ['b'], 'd': ['b'], - 'foo': ['baz', 'b']} + 'foo': ['b']} """ lines = text.splitlines() edges = collections.defaultdict(list) # {node: []} @@ -163,16 +164,16 @@ def _parseasciigraph(text): """(int, int) -> char. give a coordinate, return the char. return a space for anything out of range""" if x < 0 or y < 0: -return ' ' +return b' ' try: -return lines[y][x] +return lines[y][x:x + 1] or b' ' except IndexError: -return ' ' +return b' ' def getname(y, x): """(int, int) -> str. like get(y, x) but concatenate left and right parts. if name is an 'o', try to replace it to the right""" -result = '' +result = b'' for i in itertools.count(0): ch = get(y, x - i) if not _isname(ch): @@ -183,17 +184,17 @@ def _parseasciigraph(text): if not _isname(ch): break result += ch -if result == 'o': +if result == b'o': # special handling, find the name to the right -result = '' +result = b'' for i in itertools.count(2): ch = get(y, x + i) -if ch == ' ' or ch in _pipechars: +if ch == b' ' or ch in _pipechars: if result or x + i >= len(lines[y]): break else: result += ch -return result or 'o' +return result or b'o' return result def parents(y, x): @@ -209,19 +210,19 @@ def _parseasciigraph(text): if '-' (or '+') is not in excepted, and get(y, x) is '-' (or '+'), the next line (y + 1, x) will be checked instead.""" ch = get(y, x) -if any(ch == c and c not in expected for c in '-+'): +if any(ch == c and c not in expected for c in (b'-', b'+')): y += 1 return follow(y + 1, x, expected) -if ch in expected or ('o' in expected and _isname(ch)): +if ch in expected or (b'o' in expected and _isname(ch)): visit.append((y, x)) # -o- # starting point: # /|\ # follow '-' (horizontally), and '/|\' (to the bottom) -follow(y + 1, x, '|') -follow(y + 1, x - 1, '/') -follow(y + 1, x + 1, '\\') -follow(y, x - 1, '-') -follow(y, x + 1, '-') +follow(y + 1, x, b'|') +follow(y + 1, x - 1, b'/') +follow(y + 1, x + 1, b'\\') +follow(y, x - 1, b'-') +follow(y, x + 1, b'-') while visit: y, x = visit.pop() @@ -232,28 +233,28 @@ def _parseasciigraph(text): if _isname(ch): result.append(getname(y, x)) continue -elif ch == '|': -follow(y + 1, x, '/|o') -follow(y + 1, x - 1, '/') -follow(y + 1, x + 1, '\\') -elif ch == '+': -follow(y, x -
[PATCH 1 of 8 py3] bundle2: raise a more helpful error if building a bundle part header fails
# HG changeset patch # User Augie Fackler# Date 1505515049 14400 # Fri Sep 15 18:37:29 2017 -0400 # Node ID 662bbd6d96952985eff807f424dd128663724672 # Parent 209120041d12b524648fa856732aa404dfedd91d bundle2: raise a more helpful error if building a bundle part header fails I've tripped on this several times now, and am tired of debugging. Now the header parts are part of the error message when the ''.join() fails, which makes debugging obvious. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1050,7 +1050,11 @@ class bundlepart(object): header.append(key) header.append(value) ## finalize header -headerchunk = ''.join(header) +try: +headerchunk = ''.join(header) +except TypeError: +raise TypeError(u'Found a non-bytes trying to ' +u'build bundle part header: %r' % header) outdebug(ui, 'header chunk size: %i' % len(headerchunk)) yield _pack(_fpartheadersize, len(headerchunk)) yield headerchunk ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 5 of 8 py3] bruterebase: port to python 3
# HG changeset patch # User Augie Fackler# Date 1503465779 14400 # Wed Aug 23 01:22:59 2017 -0400 # Node ID 370f8212917c1af7e6189d3f0a7ca59ec49d1a4a # Parent 050dd624a9a887c3efde65b7750311d3d3bd716c bruterebase: port to python 3 diff --git a/tests/bruterebase.py b/tests/bruterebase.py --- a/tests/bruterebase.py +++ b/tests/bruterebase.py @@ -15,10 +15,15 @@ from mercurial import ( from hgext import rebase +try: +xrange +except NameError: +xrange = range + cmdtable = {} command = registrar.command(cmdtable) -@command('debugbruterebase') +@command(b'debugbruterebase') def debugbruterebase(ui, repo, source, dest): """for every non-empty subset of source, run rebase -r subset -d dest @@ -33,28 +38,28 @@ def debugbruterebase(ui, repo, source, d def getdesc(rev): result = cl.changelogrevision(rev).description if rev >= repolen: -result += "'" +result += b"'" return result -for i in xrange(1, 2 ** len(srevs)): +for i in range(1, 2 ** len(srevs)): subset = [rev for j, rev in enumerate(srevs) if i & (1 << j) != 0] -spec = revsetlang.formatspec('%ld', subset) -tr = repo.transaction('rebase') +spec = revsetlang.formatspec(b'%ld', subset) +tr = repo.transaction(b'rebase') tr.report = lambda x: 0 # hide "transaction abort" ui.pushbuffer() try: rebase.rebase(ui, repo, dest=dest, rev=[spec]) except error.Abort as ex: -summary = 'ABORT: %s' % ex +summary = b'ABORT: %s' % ex except Exception as ex: -summary = 'CRASH: %s' % ex +summary = b'CRASH: %s' % ex else: # short summary about new nodes cl = repo.changelog descs = [] for rev in xrange(repolen, len(repo)): -desc = '%s:' % getdesc(rev) +desc = b'%s:' % getdesc(rev) for prev in cl.parentrevs(rev): if prev > -1: desc += getdesc(prev) @@ -62,8 +67,8 @@ def debugbruterebase(ui, repo, source, d descs.sort() summary = ' '.join(descs) ui.popbuffer() -repo.vfs.tryunlink('rebasestate') +repo.vfs.tryunlink(b'rebasestate') -subsetdesc = ''.join(getdesc(rev) for rev in subset) -ui.write(('%s: %s\n') % (subsetdesc.rjust(len(srevs)), summary)) +subsetdesc = b''.join(getdesc(rev) for rev in subset) +ui.write((b'%s: %s\n') % (subsetdesc.rjust(len(srevs)), summary)) tr.abort() ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 7 of 8 py3] drawdag: add a couple of doctests to help with python3 porting
# HG changeset patch # User Augie Fackler# Date 1503499886 14400 # Wed Aug 23 10:51:26 2017 -0400 # Node ID 962f6b24541c419fc135ebd75de8529344d85d31 # Parent 6780213e5a48edeef40d6fa24ef5cb939de8abdc drawdag: add a couple of doctests to help with python3 porting diff --git a/tests/drawdag.py b/tests/drawdag.py --- a/tests/drawdag.py +++ b/tests/drawdag.py @@ -110,7 +110,52 @@ def _isname(ch): return ch in _nonpipechars def _parseasciigraph(text): -"""str -> {str : [str]}. convert the ASCII graph to edges""" +r"""str -> {str : [str]}. convert the ASCII graph to edges + +>>> import pprint +>>> pprint.pprint({k: [vv for vv in v] +... for k, v in _parseasciigraph(b''' +...G +...| +... I D C F # split: B -> E, F, G +... \ \| | # replace: C -> D -> H +...H B E # prune: F, I +... \|/ +... A +... ''').items()}) +{'A': [], + 'B': ['A'], + 'C': ['B'], + 'D': ['B'], + 'E': ['A'], + 'F': ['E'], + 'G': ['F'], + 'H': ['A'], + 'I': ['H']} +>>> pprint.pprint({k: [vv for vv in v] +... for k, v in _parseasciigraph(br''' +... ofoo +... |\ +... +---o bar +... | | | +... | o | baz +... | / +... +---o d +... | | +... +---o c +... | | +... o | b +... |/ +... o a +... ''').items()}) +{'a': [], + 'b': ['a'], + 'bar': ['b', 'a'], + 'baz': [], + 'c': ['b'], + 'd': ['b'], + 'foo': ['baz', 'b']} +""" lines = text.splitlines() edges = collections.defaultdict(list) # {node: []} @@ -277,6 +322,18 @@ def _walkgraph(edges): v.remove(leaf) def _getcomments(text): +""" +>>> [s for s in _getcomments(b''' +...G +...| +... I D C F # split: B -> E, F, G +... \ \| | # replace: C -> D -> H +...H B E # prune: F, I +... \|/ +... A +... ''')] +['split: B -> E, F, G', 'replace: C -> D -> H', 'prune: F, I'] +""" for line in text.splitlines(): if ' # ' not in line: continue diff --git a/tests/test-doctest.py b/tests/test-doctest.py --- a/tests/test-doctest.py +++ b/tests/test-doctest.py @@ -78,3 +78,5 @@ testmod('hgext.convert.filemap') testmod('hgext.convert.p4') testmod('hgext.convert.subversion') testmod('hgext.mq') +# Helper scripts in tests/ that have doctests: +testmod('drawdag') ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 3 of 8 py3] exchange: use '%d' % x instead of str(x) to encode ints
# HG changeset patch # User Augie Fackler# Date 1503451273 14400 # Tue Aug 22 21:21:13 2017 -0400 # Node ID e6d61e2a38873be057c9ecd0432750935423d745 # Parent 43b1c3ab1d6a4af1ea86f4e9d676d52740782895 exchange: use '%d' % x instead of str(x) to encode ints Recommended by Yuya instead of using pycompat.bytestr() in this case. diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -791,8 +791,8 @@ def _pushb2phases(pushop, bundler): part = bundler.newpart('pushkey') part.addparam('namespace', enc('phases')) part.addparam('key', enc(newremotehead.hex())) -part.addparam('old', enc(str(phases.draft))) -part.addparam('new', enc(str(phases.public))) +part.addparam('old', enc('%d' % phases.draft)) +part.addparam('new', enc('%d' % phases.public)) part2node.append((part.id, newremotehead)) pushop.pkfailcb[part.id] = handlefailure ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 8 py3] bundles: turn nbchanges int into a bytestr using pycompat.bytestr
# HG changeset patch # User Augie Fackler# Date 1505515116 14400 # Fri Sep 15 18:38:36 2017 -0400 # Node ID 43b1c3ab1d6a4af1ea86f4e9d676d52740782895 # Parent 662bbd6d96952985eff807f424dd128663724672 bundles: turn nbchanges int into a bytestr using pycompat.bytestr Fixes some python 3 failures. diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1448,7 +1448,7 @@ def _addpartsfromopts(ui, repo, bundler, part = bundler.newpart('changegroup', data=cg.getchunks()) part.addparam('version', cg.version) if 'clcount' in cg.extras: -part.addparam('nbchanges', str(cg.extras['clcount']), +part.addparam('nbchanges', pycompat.bytestr(cg.extras['clcount']), mandatory=False) if opts.get('phases') and repo.revs('%ln and secret()', outgoing.missingheads): @@ -1524,7 +1524,7 @@ def writebundle(ui, cg, filename, bundle part = bundle.newpart('changegroup', data=cg.getchunks()) part.addparam('version', cg.version) if 'clcount' in cg.extras: -part.addparam('nbchanges', str(cg.extras['clcount']), +part.addparam('nbchanges', pycompat.bytestr(cg.extras['clcount']), mandatory=False) chunkiter = bundle.getchunks() else: diff --git a/mercurial/exchange.py b/mercurial/exchange.py --- a/mercurial/exchange.py +++ b/mercurial/exchange.py @@ -423,7 +423,7 @@ def push(repo, remote, force=False, revs if opargs is None: opargs = {} pushop = pushoperation(repo, remote, force, revs, newbranch, bookmarks, - **opargs) + **pycompat.strkwargs(opargs)) if pushop.remote.local(): missing = (set(pushop.repo.requirements) - pushop.remote.local().supported) @@ -1640,7 +1640,8 @@ def _getbundlechangegrouppart(bundler, r part = bundler.newpart('changegroup', data=cgstream) if cgversions: part.addparam('version', version) -part.addparam('nbchanges', str(len(outgoing.missing)), mandatory=False) +part.addparam('nbchanges', pycompat.bytestr(len(outgoing.missing)), + mandatory=False) if 'treemanifest' in repo.requirements: part.addparam('treemanifest', '1') ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 4 of 8 py3] repair: reliably obtain bytestr of node ids
# HG changeset patch # User Augie Fackler# Date 1503451354 14400 # Tue Aug 22 21:22:34 2017 -0400 # Node ID 050dd624a9a887c3efde65b7750311d3d3bd716c # Parent e6d61e2a38873be057c9ecd0432750935423d745 repair: reliably obtain bytestr of node ids diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -12,7 +12,10 @@ import errno import hashlib from .i18n import _ -from .node import short +from .node import ( +hex, +short, +) from . import ( bundle2, changegroup, @@ -21,6 +24,7 @@ from . import ( exchange, obsolete, obsutil, +pycompat, util, ) @@ -35,8 +39,9 @@ def _bundle(repo, bases, heads, node, su # Include a hash of all the nodes in the filename for uniqueness allcommits = repo.set('%ln::%ln', bases, heads) allhashes = sorted(c.hex() for c in allcommits) -totalhash = hashlib.sha1(''.join(allhashes)).hexdigest() -name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix) +totalhash = hashlib.sha1(''.join(allhashes)).digest() +name = "%s/%s-%s-%s.hg" % (backupdir, pycompat.bytestr(short(node)), + hex(totalhash[:4]), suffix) cgversion = changegroup.safeversion(repo) comp = None ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D724: templater: extract shortest() logic from template function
quark accepted this revision. quark added a comment. It might make sense to be a revlog method if we don't really care about the "cleanness" of revlog class. I slightly prefer that. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D724 To: martinvonz, #hg-reviewers, quark Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D723: templates: introduce a obsfateoperation() function
quark accepted this revision. quark added a comment. I think this is a good step forward. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D723 To: martinvonz, #hg-reviewers, quark Cc: quark, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D723: templates: introduce a obsfateoperation() function
martinvonz updated this revision to Diff 1861. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D723?vs=1858=1861 REVISION DETAIL https://phab.mercurial-scm.org/D723 AFFECTED FILES mercurial/obsutil.py mercurial/templater.py tests/test-obsmarker-template.t CHANGE DETAILS diff --git a/tests/test-obsmarker-template.t b/tests/test-obsmarker-template.t --- a/tests/test-obsmarker-template.t +++ b/tests/test-obsmarker-template.t @@ -14,9 +14,10 @@ > [templates] > obsfatesuccessors = "{if(successors, " as ")}{join(successors, ", ")}" > obsfateverb = "{obsfateverb(successors)}" + > obsfateoperations = "{if(obsfateoperations(markers), " using {join(obsfateoperations(markers), ", ")}")}" > 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})")}")}" - > obsfate = "{obsfateverb}{obsfateoperation}{obsfatesuccessors}{obsfateusers}{obsfatedate}; " + > obsfate = "{obsfateverb}{obsfateoperations}{obsfatesuccessors}{obsfateusers}{obsfatedate}; " > [alias] > tlog = log -G -T '{node|short}\ > {if(predecessors, "\n Predecessors: {predecessors}")}\ @@ -90,21 +91,21 @@ o d004c8f274b9 | | @ 471f378eab4c - |/ Obsfate: rewritten as 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 3: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 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 3: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 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test1, test2 (between 2001-04-19 04:25 + and 2009-02-13 23:31 +); o ea207398892e $ hg up 'desc(A1)' --hidden @@ -127,7 +128,7 @@ o d004c8f274b9 | | @ a468dc9b3633 - |/ Obsfate: rewritten as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); + |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); o ea207398892e Predecessors template should show all the predecessors as we force their display @@ -156,9 +157,9 @@ o d004c8f274b9 | | @ a468dc9b3633 - |/ Obsfate: rewritten as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); + |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); | x 471f378eab4c - |/ Obsfate: rewritten as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); o ea207398892e @@ -201,9 +202,9 @@ @ d004c8f274b9 | | x a468dc9b3633 - |/ Obsfate: rewritten as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); + |/ Obsfate: rewritten using amend as 3:d004c8f274b9 by test2 (at 2001-04-19 04:25 +); | x 471f378eab4c - |/ Obsfate: rewritten as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); + |/ Obsfate: rewritten using amend as 2:a468dc9b3633 by test1 (at 2009-02-13 23:31 +); o ea207398892e $ hg fatelogjson --hidden @@ -653,7 +654,7 @@ | o fdf9bde5129a |/ | @ 471f378eab4c - |/ Obsfate: rewritten as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +); rewritten as 4:019fadeab383 by test (at 1970-01-01 00:00 +); + |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +); rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +); o ea207398892e $ hg up 'desc(A1)' @@ -709,11 +710,11 @@ o 019fadeab383 | | x 65b757b745b9 - |/ Obsfate: rewritten as 4:019fadeab383 by test (at 1970-01-01 00:00 +); + |/ Obsfate: rewritten using amend as 4:019fadeab383 by test (at 1970-01-01 00:00 +); | @ fdf9bde5129a |/ | x 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 +); + |/ Obsfate: rewritten using amend as 2:fdf9bde5129a by test (at 1970-01-01 00:00 +); rewritten using amend as 3:65b757b745b9 by test (at 1970-01-01 00:00 +); o ea207398892e @@ -859,7 +860,7 @@ o eb5a0daa2192 | | @ 0dec01379d3b - | |Obsfate:
[PATCH 3 of 4 python3] posix: use slicing to grab a single byte out of a bytes in HFS+ normcase code
# HG changeset patch # User Augie Fackler# Date 1505519045 14400 # Fri Sep 15 19:44:05 2017 -0400 # Node ID 8a1f211ac2afb3e49a15def443b7f556ee3c0d47 # Parent 33c529f19fdf5dbecc7e2853e8eabaac4cc347e2 posix: use slicing to grab a single byte out of a bytes in HFS+ normcase code diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -372,7 +372,7 @@ if pycompat.sysplatform == 'darwin': c = encoding.getutf8char(path, pos) pos += len(c) except ValueError: -c = '%%%02X' % ord(path[pos]) +c = '%%%02X' % ord(path[pos:pos + 1]) pos += 1 s += c ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 4 python3] encoding: ensure getutf8char always returns a bytestr, never an int
# HG changeset patch # User Augie Fackler# Date 1505519012 14400 # Fri Sep 15 19:43:32 2017 -0400 # Node ID 33c529f19fdf5dbecc7e2853e8eabaac4cc347e2 # Parent 34469e4e2187381259d78ec0a35c2dd5b0e9e85a encoding: ensure getutf8char always returns a bytestr, never an int diff --git a/mercurial/encoding.py b/mercurial/encoding.py --- a/mercurial/encoding.py +++ b/mercurial/encoding.py @@ -458,9 +458,9 @@ def getutf8char(s, pos): ''' # find how many bytes to attempt decoding from first nibble -l = _utf8len[ord(s[pos]) >> 4] +l = _utf8len[ord(s[pos:pos + 1]) >> 4] if not l: # ascii -return s[pos] +return s[pos:pos + 1] c = s[pos:pos + l] # validate with attempted decode ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 4 of 4 python3] posix: always pass a native str to unicodedata.normalize's first arg
# HG changeset patch # User Augie Fackler# Date 1505519072 14400 # Fri Sep 15 19:44:32 2017 -0400 # Node ID 4fd8345c78af58b6303a06590a83b8fd6c8fa00f # Parent 8a1f211ac2afb3e49a15def443b7f556ee3c0d47 posix: always pass a native str to unicodedata.normalize's first arg diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -379,7 +379,7 @@ if pycompat.sysplatform == 'darwin': u = s.decode('utf-8') # Decompose then lowercase (HFS+ technote specifies lower) -enc = unicodedata.normalize('NFD', u).lower().encode('utf-8') +enc = unicodedata.normalize(r'NFD', u).lower().encode('utf-8') # drop HFS+ ignored characters return encoding.hfsignoreclean(enc) ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 1 of 4 python3] posix: fix HFS+ normcase doctest to produce valid bytes literals in Python 3
# HG changeset patch # User Augie Fackler# Date 1505518982 14400 # Fri Sep 15 19:43:02 2017 -0400 # Node ID 34469e4e2187381259d78ec0a35c2dd5b0e9e85a # Parent d08554602cdbd245ddd213af325473da037a240f posix: fix HFS+ normcase doctest to produce valid bytes literals in Python 3 We were previously getting lucky on Python 2. diff --git a/mercurial/posix.py b/mercurial/posix.py --- a/mercurial/posix.py +++ b/mercurial/posix.py @@ -344,11 +344,11 @@ if pycompat.sysplatform == 'darwin': >>> normcase(b'UPPER') 'upper' ->>> normcase(b'Caf\xc3\xa9') +>>> normcase(b'Caf\\xc3\\xa9') 'cafe\\xcc\\x81' ->>> normcase(b'\xc3\x89') +>>> normcase(b'\\xc3\\x89') 'e\\xcc\\x81' ->>> normcase(b'\xb8\xca\xc3\xca\xbe\xc8.JPG') # issue3918 +>>> normcase(b'\\xb8\\xca\\xc3\\xca\\xbe\\xc8.JPG') # issue3918 '%b8%ca%c3\\xca\\xbe%c8.jpg' ''' ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel