D6187: wix: fix the package build when not adding features
durin42 created this revision. durin42 added a reviewer: indygreg. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Should have used ifdef, not if. Sigh. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6187 AFFECTED FILES contrib/packaging/wix/mercurial.wxs CHANGE DETAILS diff --git a/contrib/packaging/wix/mercurial.wxs b/contrib/packaging/wix/mercurial.wxs --- a/contrib/packaging/wix/mercurial.wxs +++ b/contrib/packaging/wix/mercurial.wxs @@ -129,7 +129,7 @@ - + To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6169: unshelve: disable unshelve during merge (issue5123)
navaneeth.suresh added a comment. Thanks for queuing Yuya. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6169 To: navaneeth.suresh, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH evolve-ext] uncommit: abort if an explicitly given file cannot be uncommitted (BC)
# HG changeset patch # User Matt Harbison # Date 1554259321 14400 # Tue Apr 02 22:42:01 2019 -0400 # Node ID 272e76e20c3c52fcae8a4c2003f73d8db77e566b # Parent e8515ee7a7cc0281d905f762e26e8956ccfd7f74 uncommit: abort if an explicitly given file cannot be uncommitted (BC) This corresponds to f4147ca63d39 in the core uncommit extension. diff --git a/hgext3rd/evolve/cmdrewrite.py b/hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py +++ b/hgext3rd/evolve/cmdrewrite.py @@ -520,17 +520,42 @@ if disallowunstable and not onahead: raise error.Abort(_("cannot uncommit in the middle of a stack")) +match = scmutil.match(old, pats, opts) + +# Check all explicitly given files; abort if there's a problem. +if match.files(): +s = old.status(old.p1(), match, listclean=True) +eligible = set(s.added) | set(s.modified) | set(s.removed) + +badfiles = set(match.files()) - eligible + +# Naming a parent directory of an eligible file is OK, even +# if not everything tracked in that directory can be +# uncommitted. +if badfiles: +badfiles -= set([f for f in util.dirs(eligible)]) + +for f in sorted(badfiles): +if f in s.clean: +hint = _(b"file was not changed in working directory " + b"parent") +elif repo.wvfs.exists(f): +hint = _(b"file was untracked in working directory parent") +else: +hint = _(b"file does not exist") + +raise error.Abort(_(b'cannot uncommit "%s"') + % scmutil.getuipathfn(repo)(f), hint=hint) + # Recommit the filtered changeset tr = repo.transaction('uncommit') if interactive: opts['all'] = True -match = scmutil.match(old, pats, opts) newid = _interactiveuncommit(ui, repo, old, match) else: newid = None includeorexclude = opts.get('include') or opts.get('exclude') if (pats or includeorexclude or opts.get('all')): -match = scmutil.match(old, pats, opts) if not (opts['message'] or opts['logfile']): opts['message'] = old.description() message = cmdutil.logmessage(ui, opts) diff --git a/tests/test-uncommit.t b/tests/test-uncommit.t --- a/tests/test-uncommit.t +++ b/tests/test-uncommit.t @@ -514,3 +514,22 @@ (use 'hg prune .' to remove it) $ hg status ? foo + +Bad explicit paths abort, like the bundled commit extension + + $ hg uncommit foo + abort: cannot uncommit "foo" + (file was untracked in working directory parent) + [255] + + $ hg ci -Aqm 'add foo' + $ hg uncommit bar + abort: cannot uncommit "bar" + (file does not exist) + [255] + $ hg uncommit d + abort: cannot uncommit "d" + (file was not changed in working directory parent) + [255] + + $ hg status ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6177: histedit: narrow the scope of discarded ui output
This revision was automatically updated to reflect the committed changes. Closed by commit rHG15d2afa31e57: histedit: narrow the scope of discarded ui output (authored by rdamazio, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D6177?vs=14614=14636#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6177?vs=14614=14636 REVISION DETAIL https://phab.mercurial-scm.org/D6177 AFFECTED FILES hgext/histedit.py tests/test-histedit-arguments.t tests/test-histedit-edit.t tests/test-histedit-fold-non-commute.t tests/test-histedit-fold.t tests/test-histedit-merge-tools.t tests/test-histedit-non-commute.t tests/test-histedit-obsolete.t tests/test-qrecord.t CHANGE DETAILS diff --git a/tests/test-qrecord.t b/tests/test-qrecord.t --- a/tests/test-qrecord.t +++ b/tests/test-qrecord.t @@ -446,7 +446,6 @@ > edit ea55e2ae468f foo bar > EOF 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - adding a Editing (ea55e2ae468f), you may commit or record as needed now. (hg histedit --continue to resume) [1] diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t --- a/tests/test-histedit-obsolete.t +++ b/tests/test-histedit-obsolete.t @@ -216,7 +216,6 @@ > edit b346ab9a313d 6 c > EOF 0 files updated, 0 files merged, 1 files removed, 0 files unresolved - adding c Editing (b346ab9a313d), you may commit or record as needed now. (hg histedit --continue to resume) [1] @@ -351,7 +350,6 @@ > pick ee118ab9fa44 16 k > EOF 0 files updated, 0 files merged, 6 files removed, 0 files unresolved - adding f Editing (b449568bf7fc), you may commit or record as needed now. (hg histedit --continue to resume) [1] @@ -394,7 +392,6 @@ > pick ee118ab9fa44 16 k > EOF 0 files updated, 0 files merged, 6 files removed, 0 files unresolved - adding f Editing (b449568bf7fc), you may commit or record as needed now. (hg histedit --continue to resume) [1] diff --git a/tests/test-histedit-non-commute.t b/tests/test-histedit-non-commute.t --- a/tests/test-histedit-non-commute.t +++ b/tests/test-histedit-non-commute.t @@ -87,7 +87,6 @@ edit the history $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') Fix up the change (pick 39522b764e3d) @@ -145,7 +144,6 @@ edit the history $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') Fix up the change (pick 39522b764e3d) @@ -241,7 +239,6 @@ edit the history, this time with a fold action $ hg histedit 3 --commands $EDITED 2>&1 | fixbundle - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved merging e warning: conflicts while merging e! (edit, then use 'hg resolve --mark') Fix up the change (mess 39522b764e3d) diff --git a/tests/test-histedit-merge-tools.t b/tests/test-histedit-merge-tools.t new file mode 100644 --- /dev/null +++ b/tests/test-histedit-merge-tools.t @@ -0,0 +1,57 @@ +Test histedit extension: Merge tools + + +Initialization +--- + + $ . "$TESTDIR/histedit-helpers.sh" + + $ cat >> $HGRCPATH < [alias] + > logt = log --template '{rev}:{node|short} {desc|firstline}\n' + > [extensions] + > histedit= + > mockmakedate = $TESTDIR/mockmakedate.py + > [ui] + > pre-merge-tool-output-template='pre-merge message for {node}\n' + > EOF + +Merge conflict +-- + + $ hg init r + $ cd r + $ echo foo > file + $ hg add file + $ hg ci -m "First" -d "1 0" + $ echo bar > file + $ hg ci -m "Second" -d "2 0" + + $ hg logt --graph + @ 1:2aa920f62fb9 Second + | + o 0:7181f42b8fca First + + +Invert the order of the commits, but fail the merge. + $ hg histedit --config ui.merge=false --commands - 2>&1 < pick 2aa920f62fb9 Second + > pick 7181f42b8fca First + > EOF + merging file + pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec + merging file failed! + Fix up the change (pick 7181f42b8fca) + (hg histedit --continue to resume) + + $ hg histedit --abort | fixbundle + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + +Invert the order of the commits, and pretend the merge succeeded. + $ hg histedit --config ui.merge=true --commands - 2>&1 < pick 2aa920f62fb9 Second + > pick 7181f42b8fca First + > EOF + merging file + pre-merge message for b90fa2e91a6d11013945a5f684be45b84a8ca6ec + 7181f42b8fca: skipping changeset (no changes) diff --git a/tests/test-histedit-fold.t b/tests/test-histedit-fold.t --- a/tests/test-histedit-fold.t +++ b/tests/test-histedit-fold.t @@ -287,7 +287,6 @@ > drop 888f9082bf99 2 +5 > fold 251d831eeec5 3 +6 >
D6169: unshelve: disable unshelve during merge (issue5123)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG03f6480bfdda: unshelve: disable unshelve during merge (issue5123) (authored by navaneeth.suresh, committed by ). CHANGED PRIOR TO COMMIT https://phab.mercurial-scm.org/D6169?vs=14616=14635#toc REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6169?vs=14616=14635 REVISION DETAIL https://phab.mercurial-scm.org/D6169 AFFECTED FILES hgext/shelve.py tests/test-shelve.t CHANGE DETAILS diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -,3 +,49 @@ test (4|13):33f7f61e6c5e (re) $ cd .. + +Abort unshelve while merging (issue5123) + + + $ hg init issue5123 + $ cd issue5123 + $ echo > a + $ hg ci -Am a + adding a + $ hg co null + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ echo > b + $ hg ci -Am b + adding b + created new head + $ echo > c + $ hg add c + $ hg shelve + shelved as default + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg co 1 + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge 0 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) +-- successful merge with two parents + $ hg log -G + @ changeset: 1:406bf70c274f + tag: tip + parent: -1: + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: b + + @ changeset: 0:ada8c9eb8252 + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: a + +-- trying to pull in the shelve bits +-- unshelve should abort otherwise, it'll eat my second parent. + $ hg unshelve + abort: cannot unshelve while merging + [255] + + $ cd .. diff --git a/hgext/shelve.py b/hgext/shelve.py --- a/hgext/shelve.py +++ b/hgext/shelve.py @@ -978,6 +978,12 @@ return unshelvecontinue(ui, repo, state, opts) elif len(shelved) > 1: raise error.Abort(_('can only unshelve one change at a time')) + +# abort unshelve while merging (issue5123) +parents = repo[None].parents() +if len(parents) > 1: +raise error.Abort(_('cannot unshelve while merging')) + elif not shelved: shelved = listshelves(repo) if not shelved: To: navaneeth.suresh, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH V4] uncommit: abort if an explicitly given file cannot be uncommitted
On Mon, 01 Apr 2019 23:05:18 -0400, Matt Harbison wrote: > # HG changeset patch > # User Matt Harbison > # Date 1553910795 14400 > # Fri Mar 29 21:53:15 2019 -0400 > # Node ID 8ced6cadf535d8f7502f61db01ddcb8b2629a17a > # Parent eec20025ada33889233e553c5825aac36b708f6c > uncommit: abort if an explicitly given file cannot be uncommitted Flagged as (BC) and queued, thanks. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6186: changelog: parse copy metadata if available in extras
martinvonz updated this revision to Diff 14634. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6186?vs=14627=14634 REVISION DETAIL https://phab.mercurial-scm.org/D6186 AFFECTED FILES mercurial/changelog.py mercurial/context.py mercurial/copies.py tests/test-copies-in-changeset.t tests/test-copies.t CHANGE DETAILS diff --git a/tests/test-copies.t b/tests/test-copies.t --- a/tests/test-copies.t +++ b/tests/test-copies.t @@ -1,4 +1,4 @@ -#testcases filelog compatibility +#testcases filelog compatibility changeset $ cat >> $HGRCPATH << EOF > [extensions] @@ -14,6 +14,14 @@ > EOF #endif +#if changeset + $ cat >> $HGRCPATH << EOF + > [experimental] + > copies.read-from = changeset-only + > copies.write-to = changeset-only + > EOF +#endif + $ REPONUM=0 $ newrepo() { > cd $TESTTMP @@ -376,11 +384,13 @@ o 0 add x on branch 1 x $ hg debugp1copies -r 2 + x -> z (changeset !) $ hg debugp2copies -r 2 - x -> z + x -> z (no-changeset !) $ hg debugpathcopies 1 2 + x -> z (changeset !) $ hg debugpathcopies 0 2 - x -> z + x -> z (no-changeset !) Copy x->y on one side of merge and copy x->z on the other side. Pathcopies from one parent of the merge to the merge should include the copy from the other side. @@ -539,6 +549,9 @@ Grafting revision 4 on top of revision 2, showing that it respect the rename: +TODO: Make this work with copy info in changesets (probably by writing a +changeset-centric version of copies.mergecopies()) +#if no-changeset $ hg up 2 -q $ hg graft -r 4 --base 3 --hidden grafting 4:af28412ec03c "added d, modified b" (tip) @@ -554,6 +567,8 @@ b +baba +#endif + Test to make sure that fullcopytracing algorithm don't fail when both the merging csets are dirty (a dirty cset is one who is not the descendant of merge base) - diff --git a/tests/test-copies-in-changeset.t b/tests/test-copies-in-changeset.t --- a/tests/test-copies-in-changeset.t +++ b/tests/test-copies-in-changeset.t @@ -2,11 +2,13 @@ $ cat >> $HGRCPATH << EOF > [experimental] > copies.write-to=changeset-only + > copies.read-from=changeset-only > [alias] > changesetcopies = log -r . -T "files: {files} > p1copies: {get(extras,'p1copies')} > p2copies: {get(extras,'p2copies')} > " + > showcopies = log -r . -T '{file_copies % "{source} -> {name}\n"}' > EOF Check that copies are recorded correctly @@ -26,6 +28,15 @@ c\x00a (esc) d\x00a (esc) p2copies: + $ hg showcopies + a -> b + a -> c + a -> d + $ hg showcopies --config experimental.copies.read-from=compatibility + a -> b + a -> c + a -> d + $ hg showcopies --config experimental.copies.read-from=filelog-only Check that renames are recorded correctly @@ -35,6 +46,8 @@ files: b b2 p1copies: b2\x00b (esc) p2copies: + $ hg showcopies + b -> b2 Rename onto existing file. This should get recorded in the changeset files list and in the extras, even though there is no filelog entry. @@ -51,6 +64,8 @@ files: c p1copies: c\x00b2 (esc) p2copies: + $ hg showcopies + b2 -> c $ hg debugindex c rev linkrev nodeid p1 p2 0 1 b789fdd96dc2 @@ -79,6 +94,10 @@ p1copies: g\x00a (esc) i\x00f (esc) p2copies: h\x00d (esc) + $ hg showcopies + a -> g + d -> h + f -> i Test writing to both changeset and filelog @@ -94,6 +113,12 @@ copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 \x01 (esc) a + $ hg showcopies + a -> j + $ hg showcopies --config experimental.copies.read-from=compatibility + a -> j + $ hg showcopies --config experimental.copies.read-from=filelog-only + a -> j Test writing only to filelog @@ -109,5 +134,10 @@ copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 \x01 (esc) a + $ hg showcopies + $ hg showcopies --config experimental.copies.read-from=compatibility + a -> k + $ hg showcopies --config experimental.copies.read-from=filelog-only + a -> k $ cd .. diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -162,8 +162,8 @@ def usechangesetcentricalgo(repo): """Checks if we should use changeset-centric copy algorithms""" -return (repo.ui.config('experimental', 'copies.read-from') == -'compatibility') +return (repo.ui.config('experimental', 'copies.read-from') in +('changeset-only', 'compatibility')) def _committedforwardcopies(a, b, match): """Like _forwardcopies(), but b.rev() cannot be None (working copy)""" diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -441,6 +441,21 @@ return self._changeset.files @propertycache def _copies(self): +source =
mercurial@42036: 14 new changesets
14 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/bf87d34a675c changeset: 42023:bf87d34a675c user:Gregory Szorc date:Sat Mar 09 16:36:08 2019 -0800 summary: contrib: PowerShell script to install development dependencies https://www.mercurial-scm.org/repo/hg/rev/b05a3e28cf24 changeset: 42024:b05a3e28cf24 user:Gregory Szorc date:Fri Mar 15 11:24:08 2019 -0700 summary: automation: perform tasks on remote machines https://www.mercurial-scm.org/repo/hg/rev/66fc05ff0ea3 changeset: 42025:66fc05ff0ea3 user:Alexander Kobjolke date:Thu Mar 21 21:44:29 2019 +0100 summary: crecord: draw on the whole screen https://www.mercurial-scm.org/repo/hg/rev/98908e36d58a changeset: 42026:98908e36d58a user:Pulkit Goyal date:Sun Mar 17 18:29:23 2019 +0300 summary: discovery: prevent recomputing info about server and outgoing changesets https://www.mercurial-scm.org/repo/hg/rev/d36a7da96a5a changeset: 42027:d36a7da96a5a user:Pulkit Goyal date:Sun Mar 17 18:34:28 2019 +0300 summary: discovery: drop some unused sets https://www.mercurial-scm.org/repo/hg/rev/0cc9d7918754 changeset: 42028:0cc9d7918754 user:Pulkit Goyal date:Sun Mar 17 18:43:27 2019 +0300 summary: discovery: prevent deleting items from a dictionary https://www.mercurial-scm.org/repo/hg/rev/19ccc6788a27 changeset: 42029:19ccc6788a27 user:Pulkit Goyal date:Sun Mar 17 18:45:53 2019 +0300 summary: discovery: move cl.hasnode outside of the for-loop https://www.mercurial-scm.org/repo/hg/rev/6ae1a776dd1a changeset: 42030:6ae1a776dd1a user:Pierre-Yves David date:Tue Mar 26 14:02:40 2019 +0100 summary: debugdiscovery: allow to select random seed during debugdiscovery run https://www.mercurial-scm.org/repo/hg/rev/d31d8c5279c6 changeset: 42031:d31d8c5279c6 user:Pierre-Yves David date:Tue Mar 26 14:04:33 2019 +0100 summary: debugdiscovery: small internal refactoring https://www.mercurial-scm.org/repo/hg/rev/63165e4a76da changeset: 42032:63165e4a76da user:Pierre-Yves David date:Tue Mar 26 17:25:22 2019 +0100 summary: debugdiscovery: display more statistic about the common set https://www.mercurial-scm.org/repo/hg/rev/c3a16c282dd8 changeset: 42033:c3a16c282dd8 user:Pierre-Yves David date:Tue Mar 26 17:26:11 2019 +0100 summary: debugdiscovery: drop duplicated information https://www.mercurial-scm.org/repo/hg/rev/fd8d13ea1bcc changeset: 42034:fd8d13ea1bcc user:Pierre-Yves David date:Tue Mar 26 17:26:54 2019 +0100 summary: debugdiscovery: only list common heads on verbose https://www.mercurial-scm.org/repo/hg/rev/eec20025ada3 changeset: 42035:eec20025ada3 user:Pierre-Yves David date:Tue Mar 26 17:35:28 2019 +0100 summary: debugdiscovery: display time elapsed during the discovery step https://www.mercurial-scm.org/repo/hg/rev/0129bf02fa04 changeset: 42036:0129bf02fa04 bookmark:@ tag: tip user:Martin von Zweigbergk date:Wed Mar 27 14:55:46 2019 -0700 summary: remotefilelog: prefetch files in deterministic order -- 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
[Bug 6110] New: excessive logging to blackbox.log
https://bz.mercurial-scm.org/show_bug.cgi?id=6110 Bug ID: 6110 Summary: excessive logging to blackbox.log Product: Mercurial Version: 4.9 Hardware: PC OS: Linux Status: UNCONFIRMED Severity: bug Priority: wish Component: blackbox Assignee: bugzi...@mercurial-scm.org Reporter: mplam...@janestreet.com CC: mercurial-devel@mercurial-scm.org Created attachment 2039 --> https://bz.mercurial-scm.org/attachment.cgi?id=2039=edit Blackbox output when running via chg Beginning in hg 4.9, a lot of extra data is being written to the blackbox.log file. This makes it difficult to read through a blackbox, and makes each log entry take up much more space on disk. In 4.8 and before, running $ HGRCPATH= hg log -r . --config extensions.blackbox= would output something like this in the blackbox: > log -r . > log -r . exited 0 after 0.94 seconds Now in 4.9, extra lines are printed out for each command, for each extension that is enabled. $ HGRCPATH= hg log -r . --config extensions.blackbox= now outputs something like this in the blackbox: > > reposetup for blackbox took 33.86 us > > all reposetup took 9.248 ms > log -r . --config 'extensions.blackbox=' > log -r . --config 'extensions.blackbox=' exited 0 after 0.05 seconds The lines about extensions setup seem like debugging output that should not be enabled by default. This example is small, but this gets noisier as more extensions are enabled. The problem gets far worse when chg is used. This command: $ HGRCPATH= chg log -r . --config extensions.blackbox= outputs 55 lines to the blackbox.log (an example is attached) -- You are receiving this mail because: You are on the CC list for the bug. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6180: wix: add functionality to inject additional Features into installer
This revision was automatically updated to reflect the committed changes. Closed by commit rHG1711f5813a63: wix: add functionality to inject additional Features into installer (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6180?vs=14630=14633 REVISION DETAIL https://phab.mercurial-scm.org/D6180 AFFECTED FILES contrib/packaging/hgpackaging/wix.py contrib/packaging/wix/build.py contrib/packaging/wix/mercurial.wxs CHANGE DETAILS diff --git a/contrib/packaging/wix/mercurial.wxs b/contrib/packaging/wix/mercurial.wxs --- a/contrib/packaging/wix/mercurial.wxs +++ b/contrib/packaging/wix/mercurial.wxs @@ -129,6 +129,11 @@ + + + + + diff --git a/contrib/packaging/wix/build.py b/contrib/packaging/wix/build.py --- a/contrib/packaging/wix/build.py +++ b/contrib/packaging/wix/build.py @@ -39,6 +39,9 @@ 'py2exe binary.')) parser.add_argument('--extra-wxs', help='CSV of path_to_wxs_file=working_dir_for_wxs_file') +parser.add_argument('--extra-features', +help=('CSV of extra feature names to include ' + 'in the installer from the extra wxs files')) args = parser.parse_args() @@ -64,6 +67,8 @@ if args.extra_wxs: kwargs['extra_wxs'] = dict( thing.split("=") for thing in args.extra_wxs.split(',')) +if args.extra_features: +kwargs['extra_features'] = args.extra_features.split(',') if args.sign_sn or args.sign_cert: fn = build_signed_installer diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py --- a/contrib/packaging/hgpackaging/wix.py +++ b/contrib/packaging/hgpackaging/wix.py @@ -179,8 +179,9 @@ def build_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, msi_name='mercurial', version=None, post_build_fn=None, -extra_packages_script: typing.Optional[str]=None, -extra_wxs:typing.Optional[typing.Dict[str,str]]=None): +extra_packages_script=None, +extra_wxs:typing.Optional[typing.Dict[str,str]]=None, +extra_features:typing.Optional[typing.List[str]]=None): """Build a WiX MSI installer. ``source_dir`` is the path to the Mercurial source tree to use. @@ -197,6 +198,8 @@ print a null byte followed by a newline-separated list of packages that should be included in the exe. ``extra_wxs`` is a dict of {wxs_name: working_dir_for_wxs_build}. +``extra_features`` is a list of additional named Features to include in +the build. These must match Feature names in one of the wxs scripts. """ arch = 'x64' if r'\x64' in os.environ.get('LIB', '') else 'x86' @@ -256,6 +259,9 @@ defines['Version'] = version defines['Comments'] = 'Installs Mercurial version %s' % version defines['VCRedistSrcDir'] = str(hg_build_dir) +if extra_features: +assert all(';' not in f for f in extra_features) +defines['MercurialExtraFeatures'] = ';'.join(extra_features) run_candle(wix_path, build_dir, source, source_build_rel, defines=defines) @@ -298,7 +304,7 @@ name: str, version=None, subject_name=None, cert_path=None, cert_password=None, timestamp_url=None, extra_packages_script=None, - extra_wxs=None): + extra_wxs=None, extra_features=None): """Build an installer with signed executables.""" post_build_fn = make_post_build_signing_fn( @@ -312,7 +318,7 @@ msi_name=name.lower(), version=version, post_build_fn=post_build_fn, extra_packages_script=extra_packages_script, - extra_wxs=extra_wxs) + extra_wxs=extra_wxs, extra_features=extra_features) description = '%s %s' % (name, version) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6179: wix: add support for additional wxs files
This revision was automatically updated to reflect the committed changes. Closed by commit rHG978b03d5f66e: wix: add support for additional wxs files (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6179?vs=14629=14632 REVISION DETAIL https://phab.mercurial-scm.org/D6179 AFFECTED FILES contrib/packaging/hgpackaging/wix.py contrib/packaging/wix/build.py CHANGE DETAILS diff --git a/contrib/packaging/wix/build.py b/contrib/packaging/wix/build.py --- a/contrib/packaging/wix/build.py +++ b/contrib/packaging/wix/build.py @@ -37,6 +37,8 @@ parser.add_argument('--extra-packages-script', help=('Script to execute to include extra packages in ' 'py2exe binary.')) +parser.add_argument('--extra-wxs', +help='CSV of path_to_wxs_file=working_dir_for_wxs_file') args = parser.parse_args() @@ -59,6 +61,9 @@ if args.extra_packages_script: kwargs['extra_packages_script'] = args.extra_packages_script +if args.extra_wxs: +kwargs['extra_wxs'] = dict( +thing.split("=") for thing in args.extra_wxs.split(',')) if args.sign_sn or args.sign_cert: fn = build_signed_installer diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py --- a/contrib/packaging/hgpackaging/wix.py +++ b/contrib/packaging/hgpackaging/wix.py @@ -12,6 +12,7 @@ import re import subprocess import tempfile +import typing import xml.dom.minidom from .downloads import ( @@ -178,7 +179,8 @@ def build_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, msi_name='mercurial', version=None, post_build_fn=None, -extra_packages_script=None): +extra_packages_script: typing.Optional[str]=None, +extra_wxs:typing.Optional[typing.Dict[str,str]]=None): """Build a WiX MSI installer. ``source_dir`` is the path to the Mercurial source tree to use. @@ -194,6 +196,7 @@ into the py2exe binary. It should stage packages into the virtualenv and print a null byte followed by a newline-separated list of packages that should be included in the exe. +``extra_wxs`` is a dict of {wxs_name: working_dir_for_wxs_build}. """ arch = 'x64' if r'\x64' in os.environ.get('LIB', '') else 'x86' @@ -235,6 +238,9 @@ wxs_source_dir = source_dir / rel_path run_candle(wix_path, build_dir, wxs, wxs_source_dir, defines=defines) +for source, rel_path in sorted((extra_wxs or {}).items()): +run_candle(wix_path, build_dir, source, rel_path, defines=defines) + # candle.exe doesn't like when we have an open handle on the file. # So use TemporaryDirectory() instead of NamedTemporaryFile(). with tempfile.TemporaryDirectory() as td: @@ -269,6 +275,11 @@ assert source.endswith('.wxs') args.append(str(build_dir / ('%s.wixobj' % source[:-4]))) +for source, rel_path in sorted((extra_wxs or {}).items()): +assert source.endswith('.wxs') +source = os.path.basename(source) +args.append(str(build_dir / ('%s.wixobj' % source[:-4]))) + args.extend([ str(build_dir / 'library.wixobj'), str(build_dir / 'mercurial.wixobj'), @@ -286,7 +297,8 @@ def build_signed_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, name: str, version=None, subject_name=None, cert_path=None, cert_password=None, - timestamp_url=None, extra_packages_script=None): + timestamp_url=None, extra_packages_script=None, + extra_wxs=None): """Build an installer with signed executables.""" post_build_fn = make_post_build_signing_fn( @@ -299,7 +311,8 @@ info = build_installer(source_dir, python_exe=python_exe, msi_name=name.lower(), version=version, post_build_fn=post_build_fn, - extra_packages_script=extra_packages_script) + extra_packages_script=extra_packages_script, + extra_wxs=extra_wxs) description = '%s %s' % (name, version) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
This revision was automatically updated to reflect the committed changes. Closed by commit rHG715d3220ac4f: wix: add a hook for a prebuild script to inject extra libraries (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6164?vs=14628=14631 REVISION DETAIL https://phab.mercurial-scm.org/D6164 AFFECTED FILES contrib/packaging/hgpackaging/py2exe.py contrib/packaging/hgpackaging/wix.py contrib/packaging/wix/build.py CHANGE DETAILS diff --git a/contrib/packaging/wix/build.py b/contrib/packaging/wix/build.py --- a/contrib/packaging/wix/build.py +++ b/contrib/packaging/wix/build.py @@ -34,6 +34,9 @@ help='URL of timestamp server to use for signing') parser.add_argument('--version', help='Version string to use') +parser.add_argument('--extra-packages-script', +help=('Script to execute to include extra packages in ' + 'py2exe binary.')) args = parser.parse_args() @@ -54,6 +57,9 @@ 'version': args.version, } +if args.extra_packages_script: +kwargs['extra_packages_script'] = args.extra_packages_script + if args.sign_sn or args.sign_cert: fn = build_signed_installer kwargs['name'] = args.name diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py --- a/contrib/packaging/hgpackaging/wix.py +++ b/contrib/packaging/hgpackaging/wix.py @@ -177,7 +177,8 @@ def build_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, -msi_name='mercurial', version=None, post_build_fn=None): +msi_name='mercurial', version=None, post_build_fn=None, +extra_packages_script=None): """Build a WiX MSI installer. ``source_dir`` is the path to the Mercurial source tree to use. @@ -189,6 +190,10 @@ Mercurial but before invoking WiX. It can be used to e.g. facilitate signing. It is passed the paths to the Mercurial source, build, and dist directories and the resolved Mercurial version. +``extra_packages_script`` is a command to be run to inject extra packages +into the py2exe binary. It should stage packages into the virtualenv and +print a null byte followed by a newline-separated list of packages that +should be included in the exe. """ arch = 'x64' if r'\x64' in os.environ.get('LIB', '') else 'x86' @@ -200,7 +205,8 @@ build_py2exe(source_dir, hg_build_dir, python_exe, 'wix', requirements_txt, - extra_packages=EXTRA_PACKAGES) + extra_packages=EXTRA_PACKAGES, + extra_packages_script=extra_packages_script) version = version or normalize_version(find_version(source_dir)) print('using version string: %s' % version) @@ -280,7 +286,7 @@ def build_signed_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, name: str, version=None, subject_name=None, cert_path=None, cert_password=None, - timestamp_url=None): + timestamp_url=None, extra_packages_script=None): """Build an installer with signed executables.""" post_build_fn = make_post_build_signing_fn( @@ -292,7 +298,8 @@ info = build_installer(source_dir, python_exe=python_exe, msi_name=name.lower(), version=version, - post_build_fn=post_build_fn) + post_build_fn=post_build_fn, + extra_packages_script=extra_packages_script) description = '%s %s' % (name, version) diff --git a/contrib/packaging/hgpackaging/py2exe.py b/contrib/packaging/hgpackaging/py2exe.py --- a/contrib/packaging/hgpackaging/py2exe.py +++ b/contrib/packaging/hgpackaging/py2exe.py @@ -25,7 +25,8 @@ python_exe: pathlib.Path, build_name: str, venv_requirements_txt: pathlib.Path, extra_packages=None, extra_excludes=None, - extra_dll_excludes=None): + extra_dll_excludes=None, + extra_packages_script=None): """Build Mercurial with py2exe. Build files will be placed in ``build_dir``. @@ -105,6 +106,16 @@ env['DISTUTILS_USE_SDK'] = '1' env['MSSdk'] = '1' +if extra_packages_script: +more_packages = set(subprocess.check_output( +extra_packages_script, + cwd=build_dir).split(b'\0')[-1].strip().decode('utf-8').splitlines()) +if more_packages: +if not extra_packages: +extra_packages = more_packages +else: +extra_packages |= more_packages + if extra_packages: env['HG_PY2EXE_EXTRA_PACKAGES'] = ' '.join(sorted(extra_packages)) if extra_excludes: To: durin42,
D6180: wix: add functionality to inject additional Features into installer
durin42 updated this revision to Diff 14630. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6180?vs=14618=14630 REVISION DETAIL https://phab.mercurial-scm.org/D6180 AFFECTED FILES contrib/packaging/hgpackaging/wix.py contrib/packaging/wix/build.py contrib/packaging/wix/mercurial.wxs CHANGE DETAILS diff --git a/contrib/packaging/wix/mercurial.wxs b/contrib/packaging/wix/mercurial.wxs --- a/contrib/packaging/wix/mercurial.wxs +++ b/contrib/packaging/wix/mercurial.wxs @@ -129,6 +129,11 @@ + + + + + diff --git a/contrib/packaging/wix/build.py b/contrib/packaging/wix/build.py --- a/contrib/packaging/wix/build.py +++ b/contrib/packaging/wix/build.py @@ -39,6 +39,9 @@ 'py2exe binary.')) parser.add_argument('--extra-wxs', help='CSV of path_to_wxs_file=working_dir_for_wxs_file') +parser.add_argument('--extra-features', +help=('CSV of extra feature names to include ' + 'in the installer from the extra wxs files')) args = parser.parse_args() @@ -64,6 +67,8 @@ if args.extra_wxs: kwargs['extra_wxs'] = dict( thing.split("=") for thing in args.extra_wxs.split(',')) +if args.extra_features: +kwargs['extra_features'] = args.extra_features.split(',') if args.sign_sn or args.sign_cert: fn = build_signed_installer diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py --- a/contrib/packaging/hgpackaging/wix.py +++ b/contrib/packaging/hgpackaging/wix.py @@ -179,8 +179,9 @@ def build_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, msi_name='mercurial', version=None, post_build_fn=None, -extra_packages_script: typing.Optional[str]=None, -extra_wxs:typing.Optional[typing.Dict[str,str]]=None): +extra_packages_script=None, +extra_wxs:typing.Optional[typing.Dict[str,str]]=None, +extra_features:typing.Optional[typing.List[str]]=None): """Build a WiX MSI installer. ``source_dir`` is the path to the Mercurial source tree to use. @@ -197,6 +198,8 @@ print a null byte followed by a newline-separated list of packages that should be included in the exe. ``extra_wxs`` is a dict of {wxs_name: working_dir_for_wxs_build}. +``extra_features`` is a list of additional named Features to include in +the build. These must match Feature names in one of the wxs scripts. """ arch = 'x64' if r'\x64' in os.environ.get('LIB', '') else 'x86' @@ -256,6 +259,9 @@ defines['Version'] = version defines['Comments'] = 'Installs Mercurial version %s' % version defines['VCRedistSrcDir'] = str(hg_build_dir) +if extra_features: +assert all(';' not in f for f in extra_features) +defines['MercurialExtraFeatures'] = ';'.join(extra_features) run_candle(wix_path, build_dir, source, source_build_rel, defines=defines) @@ -298,7 +304,7 @@ name: str, version=None, subject_name=None, cert_path=None, cert_password=None, timestamp_url=None, extra_packages_script=None, - extra_wxs=None): + extra_wxs=None, extra_features=None): """Build an installer with signed executables.""" post_build_fn = make_post_build_signing_fn( @@ -312,7 +318,7 @@ msi_name=name.lower(), version=version, post_build_fn=post_build_fn, extra_packages_script=extra_packages_script, - extra_wxs=extra_wxs) + extra_wxs=extra_wxs, extra_features=extra_features) description = '%s %s' % (name, version) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6179: wix: add support for additional wxs files
durin42 updated this revision to Diff 14629. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6179?vs=14617=14629 REVISION DETAIL https://phab.mercurial-scm.org/D6179 AFFECTED FILES contrib/packaging/hgpackaging/wix.py contrib/packaging/wix/build.py CHANGE DETAILS diff --git a/contrib/packaging/wix/build.py b/contrib/packaging/wix/build.py --- a/contrib/packaging/wix/build.py +++ b/contrib/packaging/wix/build.py @@ -37,6 +37,8 @@ parser.add_argument('--extra-packages-script', help=('Script to execute to include extra packages in ' 'py2exe binary.')) +parser.add_argument('--extra-wxs', +help='CSV of path_to_wxs_file=working_dir_for_wxs_file') args = parser.parse_args() @@ -59,6 +61,9 @@ if args.extra_packages_script: kwargs['extra_packages_script'] = args.extra_packages_script +if args.extra_wxs: +kwargs['extra_wxs'] = dict( +thing.split("=") for thing in args.extra_wxs.split(',')) if args.sign_sn or args.sign_cert: fn = build_signed_installer diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py --- a/contrib/packaging/hgpackaging/wix.py +++ b/contrib/packaging/hgpackaging/wix.py @@ -12,6 +12,7 @@ import re import subprocess import tempfile +import typing import xml.dom.minidom from .downloads import ( @@ -178,7 +179,8 @@ def build_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, msi_name='mercurial', version=None, post_build_fn=None, -extra_packages_script=None): +extra_packages_script: typing.Optional[str]=None, +extra_wxs:typing.Optional[typing.Dict[str,str]]=None): """Build a WiX MSI installer. ``source_dir`` is the path to the Mercurial source tree to use. @@ -194,6 +196,7 @@ into the py2exe binary. It should stage packages into the virtualenv and print a null byte followed by a newline-separated list of packages that should be included in the exe. +``extra_wxs`` is a dict of {wxs_name: working_dir_for_wxs_build}. """ arch = 'x64' if r'\x64' in os.environ.get('LIB', '') else 'x86' @@ -235,6 +238,9 @@ wxs_source_dir = source_dir / rel_path run_candle(wix_path, build_dir, wxs, wxs_source_dir, defines=defines) +for source, rel_path in sorted((extra_wxs or {}).items()): +run_candle(wix_path, build_dir, source, rel_path, defines=defines) + # candle.exe doesn't like when we have an open handle on the file. # So use TemporaryDirectory() instead of NamedTemporaryFile(). with tempfile.TemporaryDirectory() as td: @@ -269,6 +275,11 @@ assert source.endswith('.wxs') args.append(str(build_dir / ('%s.wixobj' % source[:-4]))) +for source, rel_path in sorted((extra_wxs or {}).items()): +assert source.endswith('.wxs') +source = os.path.basename(source) +args.append(str(build_dir / ('%s.wixobj' % source[:-4]))) + args.extend([ str(build_dir / 'library.wixobj'), str(build_dir / 'mercurial.wixobj'), @@ -286,7 +297,8 @@ def build_signed_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, name: str, version=None, subject_name=None, cert_path=None, cert_password=None, - timestamp_url=None, extra_packages_script=None): + timestamp_url=None, extra_packages_script=None, + extra_wxs=None): """Build an installer with signed executables.""" post_build_fn = make_post_build_signing_fn( @@ -299,7 +311,8 @@ info = build_installer(source_dir, python_exe=python_exe, msi_name=name.lower(), version=version, post_build_fn=post_build_fn, - extra_packages_script=extra_packages_script) + extra_packages_script=extra_packages_script, + extra_wxs=extra_wxs) description = '%s %s' % (name, version) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
durin42 updated this revision to Diff 14628. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6164?vs=14576=14628 REVISION DETAIL https://phab.mercurial-scm.org/D6164 AFFECTED FILES contrib/packaging/hgpackaging/py2exe.py contrib/packaging/hgpackaging/wix.py contrib/packaging/wix/build.py CHANGE DETAILS diff --git a/contrib/packaging/wix/build.py b/contrib/packaging/wix/build.py --- a/contrib/packaging/wix/build.py +++ b/contrib/packaging/wix/build.py @@ -34,6 +34,9 @@ help='URL of timestamp server to use for signing') parser.add_argument('--version', help='Version string to use') +parser.add_argument('--extra-packages-script', +help=('Script to execute to include extra packages in ' + 'py2exe binary.')) args = parser.parse_args() @@ -54,6 +57,9 @@ 'version': args.version, } +if args.extra_packages_script: +kwargs['extra_packages_script'] = args.extra_packages_script + if args.sign_sn or args.sign_cert: fn = build_signed_installer kwargs['name'] = args.name diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py --- a/contrib/packaging/hgpackaging/wix.py +++ b/contrib/packaging/hgpackaging/wix.py @@ -177,7 +177,8 @@ def build_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, -msi_name='mercurial', version=None, post_build_fn=None): +msi_name='mercurial', version=None, post_build_fn=None, +extra_packages_script=None): """Build a WiX MSI installer. ``source_dir`` is the path to the Mercurial source tree to use. @@ -189,6 +190,10 @@ Mercurial but before invoking WiX. It can be used to e.g. facilitate signing. It is passed the paths to the Mercurial source, build, and dist directories and the resolved Mercurial version. +``extra_packages_script`` is a command to be run to inject extra packages +into the py2exe binary. It should stage packages into the virtualenv and +print a null byte followed by a newline-separated list of packages that +should be included in the exe. """ arch = 'x64' if r'\x64' in os.environ.get('LIB', '') else 'x86' @@ -200,7 +205,8 @@ build_py2exe(source_dir, hg_build_dir, python_exe, 'wix', requirements_txt, - extra_packages=EXTRA_PACKAGES) + extra_packages=EXTRA_PACKAGES, + extra_packages_script=extra_packages_script) version = version or normalize_version(find_version(source_dir)) print('using version string: %s' % version) @@ -280,7 +286,7 @@ def build_signed_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, name: str, version=None, subject_name=None, cert_path=None, cert_password=None, - timestamp_url=None): + timestamp_url=None, extra_packages_script=None): """Build an installer with signed executables.""" post_build_fn = make_post_build_signing_fn( @@ -292,7 +298,8 @@ info = build_installer(source_dir, python_exe=python_exe, msi_name=name.lower(), version=version, - post_build_fn=post_build_fn) + post_build_fn=post_build_fn, + extra_packages_script=extra_packages_script) description = '%s %s' % (name, version) diff --git a/contrib/packaging/hgpackaging/py2exe.py b/contrib/packaging/hgpackaging/py2exe.py --- a/contrib/packaging/hgpackaging/py2exe.py +++ b/contrib/packaging/hgpackaging/py2exe.py @@ -25,7 +25,8 @@ python_exe: pathlib.Path, build_name: str, venv_requirements_txt: pathlib.Path, extra_packages=None, extra_excludes=None, - extra_dll_excludes=None): + extra_dll_excludes=None, + extra_packages_script=None): """Build Mercurial with py2exe. Build files will be placed in ``build_dir``. @@ -105,6 +106,16 @@ env['DISTUTILS_USE_SDK'] = '1' env['MSSdk'] = '1' +if extra_packages_script: +more_packages = set(subprocess.check_output( +extra_packages_script, + cwd=build_dir).split(b'\0')[-1].strip().decode('utf-8').splitlines()) +if more_packages: +if not extra_packages: +extra_packages = more_packages +else: +extra_packages |= more_packages + if extra_packages: env['HG_PY2EXE_EXTRA_PACKAGES'] = ' '.join(sorted(extra_packages)) if extra_excludes: To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org
D6183: copies: add config option for writing copy metadata to file and/or changset
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This introduces a config option that lets you choose to write copy metadata to the changeset extras instead of to filelog. There's also an option to write it to both places. I imagine that may possibly be useful when transitioning an existing repo. The copy metadata is stored as two fields in extras: one for copies since p1 and one for copies since p2. I may need to add more information later in order to make copy tracing faster. Specifically, I'm thinking out recording which files were added or removed so that copies._chaincopies() doesn't have to look at the manifest for that. But that would just be an optimization and that can be added once we know if it's necessary. I have also considered saving space by using replacing the destination file path by an index into the "files" list, but that can also be changed later (but before the feature is ready to release). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6183 AFFECTED FILES mercurial/changelog.py mercurial/configitems.py mercurial/localrepo.py tests/test-annotate.t tests/test-copies-in-changeset.t tests/test-fastannotate-hg.t CHANGE DETAILS diff --git a/tests/test-fastannotate-hg.t b/tests/test-fastannotate-hg.t --- a/tests/test-fastannotate-hg.t +++ b/tests/test-fastannotate-hg.t @@ -443,7 +443,7 @@ > def reposetup(ui, repo): > class legacyrepo(repo.__class__): > def _filecommit(self, fctx, manifest1, manifest2, - > linkrev, tr, changelist): + > linkrev, tr, changelist, includecopymeta): > fname = fctx.path() > text = fctx.data() > flog = self.file(fname) diff --git a/tests/test-copies-in-changeset.t b/tests/test-copies-in-changeset.t new file mode 100644 --- /dev/null +++ b/tests/test-copies-in-changeset.t @@ -0,0 +1,113 @@ + + $ cat >> $HGRCPATH << EOF + > [experimental] + > copies.write-to=changeset-only + > [alias] + > changesetcopies = log -r . -T "files: {files} + > p1copies: {get(extras,'p1copies')} + > p2copies: {get(extras,'p2copies')} + > " + > EOF + +Check that copies are recorded correctly + + $ hg init repo + $ cd repo + $ echo a > a + $ hg add a + $ hg ci -m initial + $ hg cp a b + $ hg cp a c + $ hg cp a d + $ hg ci -m 'copy a to b, c, and d' + $ hg changesetcopies + files: b c d + p1copies: b\x00a (esc) + c\x00a (esc) + d\x00a (esc) + p2copies: + +Check that renames are recorded correctly + + $ hg mv b b2 + $ hg ci -m 'rename b to b2' + $ hg changesetcopies + files: b b2 + p1copies: b2\x00b (esc) + p2copies: + +Rename onto existing file. This should get recorded in the changeset files list and in the extras, +even though there is no filelog entry. + + $ hg cp b2 c --force + $ hg st --copies + M c +b2 + $ hg debugindex c + rev linkrev nodeid p1 p2 + 0 1 b789fdd96dc2 + $ hg ci -m 'move b onto d' + $ hg changesetcopies + files: c + p1copies: c\x00b2 (esc) + p2copies: + $ hg debugindex c + rev linkrev nodeid p1 p2 + 0 1 b789fdd96dc2 + +Create a merge commit with copying done during merge. + + $ hg co 0 + 0 files updated, 0 files merged, 3 files removed, 0 files unresolved + $ hg cp a e + $ hg cp a f + $ hg ci -m 'copy a to e and f' + created new head + $ hg merge 3 + 3 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) +File 'a' exists on both sides, so 'g' could be recorded as being from p1 or p2, but we currently +always record it as being from p1 + $ hg cp a g +File 'd' exists only in p2, so 'h' should be from p2 + $ hg cp d h +File 'f' exists only in p1, so 'i' should be from p1 + $ hg cp f i + $ hg ci -m 'merge' + $ hg changesetcopies + files: g h i + p1copies: g\x00a (esc) + i\x00f (esc) + p2copies: h\x00d (esc) + +Test writing to both changeset and filelog + + $ hg cp a j + $ hg ci -m 'copy a to j' --config experimental.copies.write-to=compatibility + $ hg changesetcopies + files: j + p1copies: j\x00a (esc) + p2copies: + $ hg debugdata j 0 + \x01 (esc) + copy: a + copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 + \x01 (esc) + a + +Test writing only to filelog + + $ hg cp a k + $ hg ci -m 'copy a to k' --config experimental.copies.write-to=filelog-only + $ hg changesetcopies + files: k + p1copies: + p2copies: + $ hg debugdata k 0 + \x01 (esc) + copy: a + copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 + \x01 (esc) + a + + $ cd .. diff --git a/tests/test-annotate.t b/tests/test-annotate.t --- a/tests/test-annotate.t +++ b/tests/test-annotate.t @@ -438,7 +438,7 @@ > def reposetup(ui, repo): > class
D6186: changelog: parse copy metadata if available in extras
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This lets read back the copy metadata we just started writing. There are still many places left to teach about getting the copy information from the changeset, but we have enough ({file_copies}, specifically) that we can add it now and have some test coverage of it. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6186 AFFECTED FILES mercurial/changelog.py mercurial/context.py mercurial/copies.py tests/test-copies-in-changeset.t CHANGE DETAILS diff --git a/tests/test-copies-in-changeset.t b/tests/test-copies-in-changeset.t --- a/tests/test-copies-in-changeset.t +++ b/tests/test-copies-in-changeset.t @@ -2,11 +2,13 @@ $ cat >> $HGRCPATH << EOF > [experimental] > copies.write-to=changeset-only + > copies.read-from=changeset-only > [alias] > changesetcopies = log -r . -T "files: {files} > p1copies: {get(extras,'p1copies')} > p2copies: {get(extras,'p2copies')} > " + > showcopies = log -r . -T '{file_copies % "{source} -> {name}\n"}' > EOF Check that copies are recorded correctly @@ -26,6 +28,15 @@ c\x00a (esc) d\x00a (esc) p2copies: + $ hg showcopies + a -> b + a -> c + a -> d + $ hg showcopies --config experimental.copies.read-from=compatibility + a -> b + a -> c + a -> d + $ hg showcopies --config experimental.copies.read-from=filelog-only Check that renames are recorded correctly @@ -35,6 +46,8 @@ files: b b2 p1copies: b2\x00b (esc) p2copies: + $ hg showcopies + b -> b2 Rename onto existing file. This should get recorded in the changeset files list and in the extras, even though there is no filelog entry. @@ -51,6 +64,8 @@ files: c p1copies: c\x00b2 (esc) p2copies: + $ hg showcopies + b2 -> c $ hg debugindex c rev linkrev nodeid p1 p2 0 1 b789fdd96dc2 @@ -79,6 +94,10 @@ p1copies: g\x00a (esc) i\x00f (esc) p2copies: h\x00d (esc) + $ hg showcopies + a -> g + d -> h + f -> i Test writing to both changeset and filelog @@ -94,6 +113,12 @@ copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 \x01 (esc) a + $ hg showcopies + a -> j + $ hg showcopies --config experimental.copies.read-from=compatibility + a -> j + $ hg showcopies --config experimental.copies.read-from=filelog-only + a -> j Test writing only to filelog @@ -109,5 +134,10 @@ copyrev: b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 \x01 (esc) a + $ hg showcopies + $ hg showcopies --config experimental.copies.read-from=compatibility + a -> k + $ hg showcopies --config experimental.copies.read-from=filelog-only + a -> k $ cd .. diff --git a/mercurial/copies.py b/mercurial/copies.py --- a/mercurial/copies.py +++ b/mercurial/copies.py @@ -162,8 +162,8 @@ def usechangesetcentricalgo(repo): """Checks if we should use changeset-centric copy algorithms""" -return (repo.ui.config('experimental', 'copies.read-from') == -'compatibility') +return (repo.ui.config('experimental', 'copies.read-from') in +('changeset-only', 'compatibility')) def _committedforwardcopies(a, b, match): """Like _forwardcopies(), but b.rev() cannot be None (working copy)""" diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -441,6 +441,21 @@ return self._changeset.files @propertycache def _copies(self): +source = self._repo.ui.config('experimental', 'copies.read-from') +p1copies = self._changeset.p1copies +p2copies = self._changeset.p2copies +# If config says to get copy metadata only from changeset, then return +# that, defaulting to {} if there was no copy metadata. +# In compatibility mode, we return copy data from the changeset if +# it was recorded there, and otherwise we fall back to getting it from +# the filelogs (below). +if (source == 'changeset-only' or +(source == 'compatibility' and p1copies is not None)): +return p1copies or {}, p2copies or {} + +# Otherwise (config said to read only from filelog, or we are in +# compatiblity mode and there is not data in the changeset), we get +# the copy metadata from the filelogs. p1copies = {} p2copies = {} p1 = self.p1() diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -87,6 +87,18 @@ ] return "\n".join(items) +def decodecopies(data): +try: +copies = {} +for l in data.split('\n'): +k, v = l.split('\0') +copies[_string_unescape(k)] = _string_unescape(v) +return copies +except ValueError: +# Perhaps someone had chosen the same key name (e.g.
D6185: changelog: pass default extras into decodeextra()
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I want to use the function with a different default (empty dict, to be specific) and this enables that. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6185 AFFECTED FILES mercurial/changelog.py CHANGE DETAILS diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -54,18 +54,18 @@ text = text.replace('\n', '') return stringutil.unescapestr(text) -def decodeextra(text): +def decodeextra(text, default): """ >>> from .pycompat import bytechr as chr ->>> sorted(decodeextra(encodeextra({b'foo': b'bar', b'baz': chr(0) + b'2'}) -...).items()) +>>> sorted(decodeextra(encodeextra({b'foo': b'bar', b'baz': chr(0) + b'2'}), +..._defaultextra).items()) [('baz', '\\x002'), ('branch', 'default'), ('foo', 'bar')] >>> sorted(decodeextra(encodeextra({b'foo': b'bar', -... b'baz': chr(92) + chr(0) + b'2'}) -...).items()) +... b'baz': chr(92) + chr(0) + b'2'}), +..._defaultextra).items()) [('baz', '\\x002'), ('branch', 'default'), ('foo', 'bar')] """ -extra = _defaultextra.copy() +extra = default for l in text.split('\0'): if l: k, v = _string_unescape(l).split(':', 1) @@ -275,7 +275,7 @@ if raw is None: return _defaultextra -return decodeextra(raw) +return decodeextra(raw, _defaultextra.copy()) @property def files(self): 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
D6184: changelog: extract a _string_unescape() to mirror _string_escape()
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We use our own _string_escape() to encode the "extras" field. Then we use codecs.escape_decode() to escape it. But there's also a little workaround for dealing with escaped text that looks like octal numbers since the fix for https://bz.mercurial-scm.org/show_bug.cgi?id=3156. This patch extracts the call to codecs.escape_decode() along with the fix for octal numbers and puts it in a _string_unescape(). It also updates the test to check for the octal-number case from the aforementioned bug. As you may have suspected, I want to be able to reuse this new function later. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6184 AFFECTED FILES mercurial/changelog.py CHANGE DETAILS diff --git a/mercurial/changelog.py b/mercurial/changelog.py --- a/mercurial/changelog.py +++ b/mercurial/changelog.py @@ -35,17 +35,25 @@ """ >>> from .pycompat import bytechr as chr >>> d = {b'nl': chr(10), b'bs': chr(92), b'cr': chr(13), b'nul': chr(0)} ->>> s = b"ab%(nl)scd%(bs)s%(bs)sn%(nul)sab%(cr)scd%(bs)s%(nl)s" % d +>>> s = b"ab%(nl)scd%(bs)s%(bs)sn%(nul)s12ab%(cr)scd%(bs)s%(nl)s" % d >>> s -'ab\\ncdn\\x00ab\\rcd\\n' +'ab\\ncdn\\x0012ab\\rcd\\n' >>> res = _string_escape(s) ->>> s == stringutil.unescapestr(res) +>>> s == _string_unescape(res) True """ # subset of the string_escape codec text = text.replace('\\', '').replace('\n', '\\n').replace('\r', '\\r') return text.replace('\0', '\\0') +def _string_unescape(text): +if '\\0' in text: +# fix up \0 without getting into trouble with \\0 +text = text.replace('', '\n') +text = text.replace('\\0', '\0') +text = text.replace('\n', '') +return stringutil.unescapestr(text) + def decodeextra(text): """ >>> from .pycompat import bytechr as chr @@ -60,12 +68,7 @@ extra = _defaultextra.copy() for l in text.split('\0'): if l: -if '\\0' in l: -# fix up \0 without getting into trouble with \\0 -l = l.replace('', '\n') -l = l.replace('\\0', '\0') -l = l.replace('\n', '') -k, v = stringutil.unescapestr(l).split(':', 1) +k, v = _string_unescape(l).split(':', 1) extra[k] = v return extra 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
D6164: wix: add a hook for a prebuild script to inject extra libraries
indygreg added a comment. In https://phab.mercurial-scm.org/D6164#90074, @durin42 wrote: > In https://phab.mercurial-scm.org/D6164#90073, @indygreg wrote: > > > I would prefer you fix them :) > > > Okay, then what should we call it? `--extra-packages-script` since that's what it's for? Sounds good! And maybe change it to emit a newline delimited list of packages? I don't see a benefit to using `\0` since we don't need binary safety. IMO `\0` just makes it harder to implement said scripts. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
durin42 added a comment. In https://phab.mercurial-scm.org/D6164#90073, @indygreg wrote: > I would prefer you fix them :) Okay, then what should we call it? `--extra-packages-script` since that's what it's for? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #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 8 of 8 "] upgrade: support upgrade to/from zstd storage (issue6088)
On Sun, Mar 31, 2019 at 8:39 AM Pierre-Yves David < pierre-yves.da...@ens-lyon.org> wrote: > # HG changeset patch > # User Boris Feld > # Date 1549032662 -3600 > # Fri Feb 01 15:51:02 2019 +0100 > # Node ID 7acbe373397d9fb6dfb176b1a69b4ee5f2bf18ba > # Parent 2cfe9983fa92313d58f0420ec62f2341a810343e > # EXP-Topic zstd-revlog > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 7acbe373397d > upgrade: support upgrade to/from zstd storage (issue6088) > > Now that we have an official config option for a shiny format improvement, > we > better make it simple to migrate to/from it. > > diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py > --- a/mercurial/upgrade.py > +++ b/mercurial/upgrade.py > @@ -80,6 +80,8 @@ def supporteddestrequirements(repo): > 'revlogv1', > 'store', > localrepo.SPARSEREVLOG_REQUIREMENT, > +'exp-compression-zstd', > +'zstd-revlog', > } > > def allowednewrequirements(repo): > @@ -97,6 +99,8 @@ def allowednewrequirements(repo): > 'fncache', > 'generaldelta', > localrepo.SPARSEREVLOG_REQUIREMENT, > +'exp-compression-zstd', > +'zstd-revlog', > } > We shouldn't be adding zstd related requirements to static sets because zstd support may not be available. We want to make their addition conditional on zstd support being available. > > def preservedrequirements(repo): > diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t > --- a/tests/test-upgrade-repo.t > +++ b/tests/test-upgrade-repo.t > @@ -854,4 +854,108 @@ Check that we can remove the sparse-revl >generaldelta >revlogv1 >store > + > +Check upgrading to a zstd revlog > + > + > +upgrade > + > This needs protected behind an `#if zstd`. > + $ hg --config format.revlog-compression=zstd debugupgraderepo --run > >/dev/null > + copy of old repository backed up at > $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob) > + the old repository will not be deleted; remove it to free up disk space > once the upgraded repository is verified > + $ hg debugformat -v > + format-variantrepo config default > + fncache: yesyes yes > + dotencode: yesyes yes > + generaldelta: yesyes yes > + sparserevlog: yesyes yes > + plain-cl-delta:yesyes yes > + compression: zstd zlibzlib > + compression-level: default default default > + $ cat .hg/requires > + dotencode > + fncache > + generaldelta > + revlogv1 > + sparserevlog > + store > + zstd-revlog > + > +downgrade > + > + $ hg debugupgraderepo --run > + abort: cannot upgrade repository; requirement would be removed: > zstd-revlog > + [255] > + $ hg debugformat -v > + format-variantrepo config default > + fncache: yesyes yes > + dotencode: yesyes yes > + generaldelta: yesyes yes > + sparserevlog: yesyes yes > + plain-cl-delta:yesyes yes > + compression: zstd zlibzlib > + compression-level: default default default > + $ cat .hg/requires > + dotencode > + fncache > + generaldelta > + revlogv1 > + sparserevlog > + store > + zstd-revlog > + > +upgrade from hgrc > + > + $ cat >> .hg/hgrc << EOF > + > [format] > + > revlog-compression=zstd > + > EOF > + $ hg debugupgraderepo --run > + upgrade will perform the following actions: > + > + requirements > + preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, > store, zstd-revlog > + > + beginning upgrade... > + repository locked and read-only > + creating temporary repository to stage migrated data: > $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob) > + (it is safe to interrupt this process any time before data migration > completes) > + migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in > changelog) > + migrating 297 bytes in store; 103 bytes tracked data > + migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes > tracked data) > + finished migrating 1 filelog revisions across 1 filelogs; change in > size: 0 bytes > + migrating 1 manifests containing 1 revisions (110 bytes in store; 45 > bytes tracked data) > + finished migrating 1 manifest revisions across 1 manifests; change in > size: 0 bytes > + migrating changelog containing 1 revisions (123 bytes in store; 58 > bytes tracked data) > + finished migrating 1 changelog revisions; change in size: 0 bytes > + finished migrating 3 total revisions; total change in store size: 0 > bytes > + copying phaseroots > + data fully migrated to temporary repository > + marking source repository as being upgraded; clients will be unable to > read from repository > + starting in-place swap of repository data > + replaced files will be backed up at > $TESTTMP/sparserevlogrepo/.hg/upgradebackup.*
Re: [PATCH 7 of 8 "] compression: introduce an official `zstd-revlog` requirement
On Tue, Apr 2, 2019 at 6:57 AM Pierre-Yves David < pierre-yves.da...@ens-lyon.org> wrote: > > > On 4/2/19 9:52 AM, Josef 'Jeff' Sipek wrote: > > On Sun, Mar 31, 2019 at 17:36:23 +0200, Pierre-Yves David wrote: > >> # HG changeset patch > >> # User Pierre-Yves David > >> # Date 1553707623 -3600 > >> # Wed Mar 27 18:27:03 2019 +0100 > >> # Node ID 2cfe9983fa92313d58f0420ec62f2341a810343e > >> # Parent 108e26fa0a97fe5342a1ce246cc4e4c185803454 > >> # EXP-Topic zstd-revlog > >> # Available At https://bitbucket.org/octobus/mercurial-devel/ > >> # hg pull https://bitbucket.org/octobus/mercurial-devel/ > -r 2cfe9983fa92 > >> compression: introduce an official `zstd-revlog` requirement > > > > Is the requirement for the compression algo or for the compression algo's > > use in revlog? > > The use of zstd in revlog > > > > > If the former, something like 'compression-' makes more sense. > > > > If the later, would it be better to call it 'revlog-compression-' > or > > something to that effect? > I agree with Jeff that the requirement name should be derived from the compression engine name. e.g. the zstd compression engine supporting revlogs will result in the "revlog-compression-zstd" requirement. That, or the compression engine itself advertises an attribute denoting the requirement for revlogs with that compression format. I think I like the latter better, as it means no special casing of specific string values in the requirements code - just special casing for `None`. Could you please try something along these lines? For clarity, the thing that is bothering me is the leaky implementation where the low-level requirements code has to know about zlib and zstd. All of this should be generic and derived from the registered compression engines: that's what the compression engine abstraction is for. > > > Either way, while a *human* knows that zstd is a compression algo, could > it > > make sense to make it easily parsable? I'm imagining a slightly better > > error messages when requirements fail, or just the ability to > > programmatically identify the algo. For example, instead of the current: > > > >abort: repository requires features unknown to this Mercurial: > foobar-revlog! > > > > hg could emit: > > > >abort: repository requires a compression algo unknown to this > Mercurial: foobar! > > I'm that longer version has much value. Most of our requirement has name > opaque to normal user. This is why we link to an explanatory pages. > > Once this series is in, I am planning to do some UI polish. Especially, > for version that know this requirement but have been compiled without > zstd support, we can issue a better message. > > > > >> > >> This requirement supersede `exp-compression-zstd`. However, we keep > support for > > > > s/supersede/supersedes/ :) > > > > Jeff. > > > > -- > Pierre-Yves David > ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 6 of 8 "] compression: introduce an official `format.revlog-compression` option
On Sun, Mar 31, 2019 at 8:39 AM Pierre-Yves David < pierre-yves.da...@ens-lyon.org> wrote: > # HG changeset patch > # User Pierre-Yves David > # Date 1553707614 -3600 > # Wed Mar 27 18:26:54 2019 +0100 > # Node ID 108e26fa0a97fe5342a1ce246cc4e4c185803454 > # Parent 28701199a78bdbab36aa422be0b4681941433823 > # EXP-Topic zstd-revlog > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 108e26fa0a97 > compression: introduce an official `format.revlog-compression` option > Queued parts 1-6. > > This option superseed the `experiment.format.compression` option. The value > currently supported are zlib (default) and zstd (if Mercurial was compiled > with > zstd support). > > The option gained an explicite reference to `revlog` since this is the > target > usage here. Different storage methods might requires different compression > strategies. > > In our tests, using zstd give a significant CPU usage improvement (both > compression and decompressing) while keeping similar repository size. > > Zstd as other interresting mode (dictionnaly, pre-text, etc…) that are > probably > worth exploring. However, just play switching from zlib to zstd provide a > large > benefit. > > diff --git a/mercurial/configitems.py b/mercurial/configitems.py > --- a/mercurial/configitems.py > +++ b/mercurial/configitems.py > @@ -553,9 +553,6 @@ coreconfigitem('experimental', 'extended > coreconfigitem('experimental', 'extendedheader.similarity', > default=False, > ) > -coreconfigitem('experimental', 'format.compression', > -default='zlib', > -) > coreconfigitem('experimental', 'graphshorten', > default=False, > ) > @@ -684,6 +681,10 @@ coreconfigitem('format', 'obsstore-versi > coreconfigitem('format', 'sparse-revlog', > default=True, > ) > +coreconfigitem('format', 'revlog-compression', > +default='zlib', > +alias=[('experimental', 'format.compression')] > +) > coreconfigitem('format', 'usefncache', > default=True, > ) > diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt > --- a/mercurial/help/config.txt > +++ b/mercurial/help/config.txt > @@ -866,6 +866,13 @@ https://www.mercurial-scm.org/wiki/Missi > Repositories with this on-disk format require Mercurial version 4.7 > > Enabled by default. > +``revlog-compression`` > +Compression algorithm used by revlog. Supported value are `zlib` and > `zstd`. > +The `zlib` engine is the historical default of Mercurial. `zstd` is a > newer > +format that is usually a net win over `zlib` operating faster at > better > +compression rate. Use `zstd` to reduce CPU usage. > + > +On some system, Mercurial installation may lack `zstd` supports. > Default is `zlib`. > > ``graph`` > - > diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py > --- a/mercurial/localrepo.py > +++ b/mercurial/localrepo.py > @@ -2920,10 +2920,10 @@ def newreporequirements(ui, createopts): > if ui.configbool('format', 'dotencode'): > requirements.add('dotencode') > > -compengine = ui.config('experimental', 'format.compression') > +compengine = ui.config('format', 'revlog-compression') > if compengine not in util.compengines: > raise error.Abort(_('compression engine %s defined by ' > -'experimental.format.compression not > available') % > +'format.revlog-compression not available') % >compengine, >hint=_('run "hg debuginstall" to list available > ' > 'compression engines')) > diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py > --- a/mercurial/upgrade.py > +++ b/mercurial/upgrade.py > @@ -332,7 +332,7 @@ class compressionengine(formatvariant): > > @classmethod > def fromconfig(cls, repo): > -return repo.ui.config('experimental', 'format.compression') > +return repo.ui.config('format', 'revlog-compression') > > @registerformatvariant > class compressionlevel(formatvariant): > diff --git a/tests/test-repo-compengines.t b/tests/test-repo-compengines.t > --- a/tests/test-repo-compengines.t > +++ b/tests/test-repo-compengines.t > @@ -21,8 +21,8 @@ A new repository uses zlib storage, whic > > Unknown compression engine to format.compression aborts > > - $ hg --config experimental.format.compression=unknown init unknown > - abort: compression engine unknown defined by > experimental.format.compression not available > + $ hg --config format.revlog-compression=unknown init unknown > + abort: compression engine unknown defined by format.revlog-compression > not available >(run "hg debuginstall" to list available compression engines) >[255] > > @@ -40,7 +40,7 @@ A requirement specifying an unknown comp > > #if zstd > > - $ hg --config experimental.format.compression=zstd init zstd > + $ hg --config
Re: [PATCH 3 of 8 "] compression: introduce a `storage.revlog.zlib.level` configuration
On Tue, Apr 2, 2019 at 12:29 AM Josef 'Jeff' Sipek wrote: > On Sun, Mar 31, 2019 at 17:36:19 +0200, Pierre-Yves David wrote: > ... > > compression: introduce a `storage.revlog.zlib.level` configuration > > > > This option control the zlib compression level used when compression > revlog > > chunk. > > > > This is also a good excuse to pave the way for a similar configuration > option > > for the zstd compression engine. Having a dedicated option for each > compression > > algorithm is useful because they don't support the same range of values. > > > > Using a higher zlib compression impact CPU consumption at compression > time, but > > does not directly affected decompression time. However dealing with small > > compressed chunk can directly help decompression and indirectly help > other > > revlog logic. > > > > I ran some basic test on repositories using different level. I am user > the > > s/user/using/ ? > > ... > > I also made some basic timing measurement. The "read" timing are > gathered using > > simple run of `hg perfrevlogrevisions`, the "write" measurement using `hg > > perfrevlogwrite` (restricted to the last 5000 revisions for netbeans and > > mozilla central). The timing are gathered on a generic machine, (not > one of > > our performance locked machine), so small variation might not be > meaningful. > > You did more than one measurement, so measurement -> measurements, and > timing -> timings? Alternatively, keep the singular but then make the > verbs > match: are -> is. > > Sorry to nit-pick, but since this text will end up in the commit > messages... > :) > > > However large trend remains relevant. > > > > Keep in mind that these number are not pure compression/decompression > time. > > s/number/numbers/ > > > They also involve the full revlog logic. In particular the difference in > chunk > > size has an impact on the delta chain structure, affecting performance > when > > writing or reading them. > > > > On read/write performance, the compression level has a bigger impact. > > Counter-intuitively, higher compression level raise better "write" > performance > > s/raise better/increase/ ? > > This actually confuses me a bit. Based on the table below, it looks like > higher compression level has non-linear effect on read/write performance. > Maybe I'm not understanding what you meant by 'raise "better"'. > > While I expect to see a "hump" in *write* performance (because high zlib > compression levels are such cpu hogs), I didn't expect to see one for > *read* > perfomance. I suppose the read hump could be explained by the shape of the > DAG, as you point out. > https://gregoryszorc.com/blog/2017/03/07/better-compression-with-zstandard/ has some nice charts graphing (de)compression speed versus compression levels for various compression formats. zlib and zstd decompression speed should be relatively linear on the decompression side. Exception is negative compression levels with zstd, which will be faster than positive levels. When Python comes into play, the read speed can be influenced by a number of factors, including the overhead of allocating the output buffer. Measuring performance of thousands of small operations quickly turns into measuring the efficiency/overhead of the Python bindings to the compression library and Python itself. One of the things we do with zstd revlogs is reuse the decompression context (self._dctx), whereas zlib revlogs call zlib.decompress() on every item. There is undoubtedly some overhead to constructing those objects and constructing decompressors to support large window sizes (read: higher compression levels) may introduce additional overhead. I dunno. FWIW the `hg perfrevlogchunks` command isolates the various "stages" of reading from revlogs and can be very useful for isolating the compression performance. It even has separate benchmarks for measuring zlib versus zstd compression! > > > for the large repositories in our tested setting. Maybe because the last > 5000 > > delta chain end up having a very different shape in this specific spot? > Or maybe > > because of a more general trend of better delta chains thanks to the > smaller > > chunk and snapshot. > > > > This series does not intend to change the default compression level. > However, > > these result call for a deeper analysis of this performance difference > in the > > future. > > > > Full data > > = > > > > repo level .hg/store size 00manifest.d read write > > > > mercurial 1 49,402,813 5,963,475 0.170159 53.250304 > > mercurial 6 47,197,397 5,875,730 0.182820 56.264320 > > mercurial 9 47,121,596 5,849,781 0.189219 56.293612 > > > > pypy 1 370,830,57228,462,425 2.679217 460.721984 > > pypy 6 340,112,31727,648,747 2.768691 467.537158 > > pypy 9 338,360,73627,639,003 2.763495 476.589918 > > > > netbeans 1
Re: [PATCH 5 of 8 "] compression: display compression level in debugformat
On Sun, Mar 31, 2019 at 8:39 AM Pierre-Yves David < pierre-yves.da...@ens-lyon.org> wrote: > # HG changeset patch > # User Pierre-Yves David > # Date 1553725731 -3600 > # Wed Mar 27 23:28:51 2019 +0100 > # Node ID 28701199a78bdbab36aa422be0b4681941433823 > # Parent bcc4ba4c53b44dc6013b89f8c85b0f1967dfaebb > # EXP-Topic zstd-revlog > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 28701199a78b > compression: display compression level in debugformat > > Now that we have options to control the compression level, we teach `hg > debugformat` about them. This is a useful information when comparing > repositories. > > Note that we have no trace of the compression level used to store existing > deltas. Actually, it would even varies from one delta to another. So we > display > the currently set value. > > diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py > --- a/mercurial/upgrade.py > +++ b/mercurial/upgrade.py > @@ -334,6 +334,39 @@ class compressionengine(formatvariant): > def fromconfig(cls, repo): > return repo.ui.config('experimental', 'format.compression') > > +@registerformatvariant > +class compressionlevel(formatvariant): > +name = 'compression-level' > +default = 'default' > + > +description = _('compression level') > + > +upgrademessage = _('revlog content will be recompressed') > + > +@classmethod > +def fromrepo(cls, repo): > +comp = compressionengine.fromrepo(repo) > +level = None > +if comp == 'zlib': > +level = repo.ui.configint('storage', 'revlog.zlib.level') > +elif comp == 'zstd': > +level = repo.ui.configint('storage', 'revlog.zstd.level') > +if level is None: > +return 'default' > +return str(level) > Changing this in flight to bytes(...) to appease Python 3. > + > +@classmethod > +def fromconfig(cls, repo): > +comp = compressionengine.fromconfig(repo) > +level = None > +if comp == 'zlib': > +level = repo.ui.configint('storage', 'revlog.zlib.level') > +elif comp == 'zstd': > +level = repo.ui.configint('storage', 'revlog.zstd.level') > +if level is None: > +return 'default' > +return str(level) > + > def finddeficiencies(repo): > """returns a list of deficiencies that the repo suffer from""" > deficiencies = [] > diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t > --- a/tests/test-upgrade-repo.t > +++ b/tests/test-upgrade-repo.t > @@ -52,37 +52,41 @@ An upgrade of a repository created with >$ hg init empty >$ cd empty >$ hg debugformat > - format-variant repo > - fncache:yes > - dotencode: yes > - generaldelta: yes > - sparserevlog: yes > - plain-cl-delta: yes > - compression:zlib > + format-variantrepo > + fncache: yes > + dotencode: yes > + generaldelta: yes > + sparserevlog: yes > + plain-cl-delta:yes > + compression: zlib > + compression-level: default >$ hg debugformat --verbose > - format-variant repo config default > - fncache:yesyes yes > - dotencode: yesyes yes > - generaldelta: yesyes yes > - sparserevlog: yesyes yes > - plain-cl-delta: yesyes yes > - compression:zlib zlibzlib > + format-variantrepo config default > + fncache: yesyes yes > + dotencode: yesyes yes > + generaldelta: yesyes yes > + sparserevlog: yesyes yes > + plain-cl-delta:yesyes yes > + compression: zlib zlibzlib > + compression-level: default default default >$ hg debugformat --verbose --config format.usefncache=no > - format-variant repo config default > - fncache:yes no yes > - dotencode: yes no yes > - generaldelta: yesyes yes > - sparserevlog: yesyes yes > - plain-cl-delta: yesyes yes > - compression:zlib zlibzlib > + format-variantrepo config default > + fncache: yes no yes > + dotencode: yes no yes > + generaldelta: yesyes yes > + sparserevlog: yesyes yes > + plain-cl-delta:yesyes yes > + compression: zlib zlibzlib > + compression-level: default default default >$ hg debugformat --verbose --config format.usefncache=no --color=debug > - format-variant repo config default > - [formatvariant.name.mismatchconfig|fncache: > ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| > no][formatvariant.default| yes] > - [formatvariant.name.mismatchconfig|dotencode: > ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| > no][formatvariant.default| yes] > -
D6164: wix: add a hook for a prebuild script to inject extra libraries
indygreg added a comment. I would prefer you fix them :) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
durin42 added a comment. In https://phab.mercurial-scm.org/D6164#90059, @indygreg wrote: > Was a newer version of this patch with the requested changes going to be uploaded? It's weird to see additional patches in the series without this one updated... You had indicated up-thread you were going to queue it, possibly with some in-flight tweaks. I had to rebase it as I was working on follow-ups, but I was merely waiting for you to land the patch as you'd indicated. Are you now saying you want me to fix things for you? That's fine, it's just not what you said. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6178: crecord: new keys g & G to navigate to the top and bottom respectively
arun marked an inline comment as done. arun added inline comments. INLINE COMMENTS > JordiGH wrote in crecord.py:1471 > We should find a better way to phrase this, since it's not about hunk. Maybe > just "first line" and "last line". Amended the patch. Simply top/bottom seems good as well. Can you have another look? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6178 To: arun, #hg-reviewers Cc: JordiGH, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 4 of 8 "] compression: introduce a `storage.revlog.zstd.level` configuration
On Sun, Mar 31, 2019 at 8:39 AM Pierre-Yves David < pierre-yves.da...@ens-lyon.org> wrote: > # HG changeset patch > # User Pierre-Yves David > # Date 1553708159 -3600 > # Wed Mar 27 18:35:59 2019 +0100 > # Node ID bcc4ba4c53b44dc6013b89f8c85b0f1967dfaebb > # Parent df7c537a8d07d6c1d4e7aa7604af30a57717bcf6 > # EXP-Topic zstd-revlog > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > bcc4ba4c53b4 > compression: introduce a `storage.revlog.zstd.level` configuration > > This option control the zstd compression level used when compressing revlog > chunk. The usage of zstd for revlog compression has not graduated from > experimental yet, but we intend to fix that soon. > > The option name for the compression level is more straight forward to > pick, so > this changesets comes first. Having a dedicated option for each > compression > engine is useful because they don't support the same range of values. > > I ran the same measurement as for the zlib compression level (in the parent > changesets). The variation in repository size is stay mostly in the same > (small) > range. The "read/write" performance see smallish variation, but are > overall much > better than zlib. Write performance show the same tend of having better > write > performance for when reaching high-end compression. > > Again, we don't intend to change the default zstd compression level > (currently: > 3) in this series. However this is worth investigating in the future. > > The Performance comparison of zlib vs zstd is quite impressive. The > repository > size stay in the same range, but the performance are much better in all > situations. > > Comparison summary > == > > We are looking at: > - performance range for zlib > - performance range for zstd > - comparison of default zstd (level-3) to default zlib (level 6) > - comparison of the slowest zstd time to the fastest zlib time > > Read performance: > - > | zlib | zstd | cmp | f2s > mercurial | 0.170159 - 0.189219 | 0.144127 - 0.149624 | 80% | 88% > pypy | 2.679217 - 2.768691 | 1.532317 - 1.705044 | 60% | 63% > netbeans | 122.477027 - 141.620281 | 72.996346 - 89.731560 | 58% | 73% > mozilla | 147.867662 - 170.572118 | 91.700995 - 105.853099 | 56% | 71% > > Write performance: > -- > | zlib | zstd | cmp | f2s > mercurial | 53.250304 - 56.2936129 | 40.877025 - 45.677286 | 75% | 86% > pypy | 460.721984 - 476.589918 | 270.545409 - 301.002219 | 63% | 65% > netbeans | 520.560316 - 715.930400 | 370.356311 - 428.329652 | 55% | 82% > mozilla | 739.803002 - 987.056093 | 505.152906 - 591.930683 | 57% | 80% > > Raw data > > > repo alg lvl .hg/store size 00manifest.d read write > > mercurial zlib 1 49,402,813 5,963,475 0.170159 53.250304 > mercurial zlib 6 47,197,397 5,875,730 0.182820 56.264320 > mercurial zlib 9 47,121,596 5,849,781 0.189219 56.293612 > > mercurial zstd 1 49,737,084 5,966,355 0.144127 40.877025 > mercurial zstd 3 48,961,867 5,895,208 0.146376 42.268142 > mercurial zstd 5 48,200,592 5,938,676 0.149624 43.162875 > mercurial zstd 10 47,833,520 5,913,353 0.145185 44.012489 > mercurial zstd 15 47,314,604 5,728,679 0.147686 45.677286 > mercurial zstd 20 47,330,502 5,830,539 0.145789 45.025407 > mercurial zstd 22 47,330,076 5,830,539 0.143996 44.690460 > > > pypy zlib 1 370,830,57228,462,425 2.679217 460.721984 > pypy zlib 6 340,112,31727,648,747 2.768691 467.537158 > pypy zlib 9 338,360,73627,639,003 2.763495 476.589918 > > pypy zstd 1 362,377,47927,916,214 1.532317 270.545409 > pypy zstd 3 354,137,69327,905,988 1.686718 294.951509 > pypy zstd 5 342,640,04327,655,774 1.705044 301.002219 > pypy zstd 10 334,224,32727,164,493 1.567287 285.186239 > pypy zstd 15 329,000,36326,645,965 1.637729 299.561332 > pypy zstd 20 324,534,03926,199,547 1.526813 302.149827 > pypy zstd 22 324,530,59526,198,932 1.525718 307.821218 > > > netbeans zlib 1 1,281,847,810 165,495,457 122.477027 520.560316 > netbeans zlib 6 1,205,284,353 159,161,207 139.876147 715.930400 > netbeans zlib 9 1,197,135,671 155,034,586 141.620281 678.297064 > > netbeans zstd 1 1,259,581,737 160,840,613 72.996346 370.356311 > netbeans zstd 3 1,232,978,122 157,691,551 81.622317 396.733087 > netbeans zstd 5 1,208,034,075 160,246,880 83.080549 364.342626 > netbeans zstd 10 1,188,624,176 156,083,417 79.323935 403.594602 > netbeans zstd 15 1,176,973,589 153,859,477 89.731560 428.329652 > netbeans zstd 20 1,162,958,258
D6178: crecord: new keys g & G to navigate to the top and bottom respectively
arun updated this revision to Diff 14623. arun edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6178?vs=14621=14623 REVISION DETAIL https://phab.mercurial-scm.org/D6178 AFFECTED FILES mercurial/crecord.py CHANGE DETAILS diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -1467,6 +1467,8 @@ pgup/pgdn [K/J] : go to previous/next item of same type right/left-arrow [l/h] : go to child item / parent item shift-left-arrow [H] : go to parent header / fold selected header + g : go to the top + G : go to the bottom f : fold / unfold item, hiding/revealing its children F : fold / unfold parent item and all of its ancestors ctrl-l : scroll the selected line to the top of the screen @@ -1505,6 +1507,45 @@ self.stdscr.refresh() self.stdscr.keypad(1) # allow arrow-keys to continue to function +def handlefirstlineevent(self): +""" +Handle 'g' to navigate to the top most file in the ncurses window. +""" +self.currentselecteditem = self.headerlist[0] +currentitem = self.currentselecteditem +# select the parent item recursively until we're at a header +while True: +nextitem = currentitem.parentitem() +if nextitem is None: +break +else: +currentitem = nextitem + +self.currentselecteditem = currentitem + +def handlelastlineevent(self): +""" +Handle 'G' to navigate to the bottom most file/hunk/line depending +on the whether the fold is active or not. + +If the bottom most file is folded, it navigates to that file and stops there. +If the bottom most file is unfolded, it navigates to the bottom most hunk in +that file and stops there. If the bottom most hunk is unfolded, it navigates to +the bottom most line in that hunk. +""" +currentitem = self.currentselecteditem +nextitem = currentitem.nextitem() +# select the child item recursively until we're at a footer +while nextitem is not None: +nextitem = currentitem.nextitem() +if nextitem is None: +break +else: +currentitem = nextitem + +self.currentselecteditem = currentitem +self.recenterdisplayedarea() + def confirmationwindow(self, windowtext): "display an informational window, then wait for and return a keypress." @@ -1725,6 +1766,10 @@ self.togglefolded(foldparent=True) elif keypressed in ["m"]: self.commitMessageWindow() +elif keypressed in ["g", "KEY_HOME"]: +self.handlefirstlineevent() +elif keypressed in ["G", "KEY_END"]: +self.handlelastlineevent() elif keypressed in ["?"]: self.helpwindow() self.stdscr.clear() To: arun, #hg-reviewers Cc: JordiGH, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6182: bundle2: handle compression in _forwardchunks
joerg.sonnenberger created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY _forwardchunks is used to compensate for getbundle protocol deficits. Since it transparently decodes the payload, it also needs to remove the corresponding compression parameter in case the server decides to send one. This the wire protocol part of issue 5990. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6182 AFFECTED FILES mercurial/bundle2.py tests/test-pull-bundle.t CHANGE DETAILS diff --git a/tests/test-pull-bundle.t b/tests/test-pull-bundle.t --- a/tests/test-pull-bundle.t +++ b/tests/test-pull-bundle.t @@ -120,6 +120,38 @@ * sending pullbundle "1.hg" (glob) $ rm repo/.hg/blackbox.log +Test pullbundle functionality for incoming + + $ cd repo + $ hg --config blackbox.track=debug --debug serve -p $HGPORT2 -d --pid-file=../repo.pid + listening at http://*:$HGPORT2/ (bound to $LOCALIP:$HGPORT2) (glob) (?) + $ cat ../repo.pid >> $DAEMON_PIDS + $ cd .. + $ hg clone http://localhost:$HGPORT2/ repo.pullbundle2a -r 0 + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + new changesets bbd179dfa0a7 (1 drafts) + updating to branch default + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cd repo.pullbundle2a + $ hg incoming -r ed1b79f46b9a + comparing with http://localhost:$HGPORT2/ + searching for changes + changeset: 1:ed1b79f46b9a + tag: tip + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: change foo + + $ cd .. + $ killdaemons.py + $ grep 'sending pullbundle ' repo/.hg/blackbox.log + * sending pullbundle "0.hg" (glob) + * sending pullbundle "1.hg" (glob) + $ rm repo/.hg/blackbox.log + Test recovery from misconfigured server sending no new data $ cd repo diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -834,12 +834,21 @@ if paramssize < 0: raise error.BundleValueError('negative bundle param size: %i' % paramssize) -yield _pack(_fstreamparamsize, paramssize) if paramssize: params = self._readexact(paramssize) self._processallparams(params) -yield params -assert self._compengine.bundletype()[1] == 'UN' +# The payload itself is decompressed below, so drop +# the compression parameter passed down to compensate. +outparams = [] +for p in params.split(' '): +k, v = p.split('=', 1) +if k.lower() != 'compression': +oparams.append(p) +outparams = ' '.join(outparams) +yield _pack(_fstreamparamsize, len(outparams)) +yield outparams +else: +yield _pack(_fstreamparamsize, paramssize) # From there, payload might need to be decompressed self._fp = self._compengine.decompressorreader(self._fp) emptycount = 0 To: joerg.sonnenberger, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6164: wix: add a hook for a prebuild script to inject extra libraries
indygreg requested changes to this revision. indygreg added a comment. This revision now requires changes to proceed. Was a newer version of this patch with the requested changes going to be uploaded? It's weird to see additional patches in the series without this one updated... REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6164 To: durin42, indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6178: crecord: new keys g & G to navigate to the top and bottom respectively
JordiGH added inline comments. INLINE COMMENTS > crecord.py:1471 > + g : go to the first hunk line > + G : go to the last hunk line >f : fold / unfold item, hiding/revealing its children We should find a better way to phrase this, since it's not about hunk. Maybe just "first line" and "last line". > crecord.py:1766 > +elif keypressed in ["G"]: > +self.handlelastlineevent() > elif keypressed in ["?"]: It would be nice to map these to Home and End (which by the way, also map on `less`). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6178 To: arun, #hg-reviewers Cc: JordiGH, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6178: crecord: new keys g & G to navigate to the top and bottom respectively
arun updated this revision to Diff 14621. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6178?vs=14620=14621 REVISION DETAIL https://phab.mercurial-scm.org/D6178 AFFECTED FILES mercurial/crecord.py CHANGE DETAILS diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -1467,6 +1467,8 @@ pgup/pgdn [K/J] : go to previous/next item of same type right/left-arrow [l/h] : go to child item / parent item shift-left-arrow [H] : go to parent header / fold selected header + g : go to the top + G : go to the bottom f : fold / unfold item, hiding/revealing its children F : fold / unfold parent item and all of its ancestors ctrl-l : scroll the selected line to the top of the screen @@ -1505,6 +1507,45 @@ self.stdscr.refresh() self.stdscr.keypad(1) # allow arrow-keys to continue to function +def handlefirstlineevent(self): +""" +Handle 'g' to navigate to the top most file in the ncurses window. +""" +self.currentselecteditem = self.headerlist[0] +currentitem = self.currentselecteditem +# select the parent item recursively until we're at a header +while True: +nextitem = currentitem.parentitem() +if nextitem is None: +break +else: +currentitem = nextitem + +self.currentselecteditem = currentitem + +def handlelastlineevent(self): +""" +Handle 'G' to navigate to the bottom most file/hunk/line depending +on the whether the fold is active or not. + +If the bottom most file is folded, it navigates to that file and stops there. +If the bottom most file is unfolded, it navigates to the bottom most hunk in +that file and stops there. If the bottom most hunk is unfolded, it navigates to +the bottom most line in that hunk. +""" +currentitem = self.currentselecteditem +nextitem = currentitem.nextitem() +# select the child item recursively until we're at a footer +while nextitem is not None: +nextitem = currentitem.nextitem() +if nextitem is None: +break +else: +currentitem = nextitem + +self.currentselecteditem = currentitem +self.recenterdisplayedarea() + def confirmationwindow(self, windowtext): "display an informational window, then wait for and return a keypress." @@ -1725,6 +1766,10 @@ self.togglefolded(foldparent=True) elif keypressed in ["m"]: self.commitMessageWindow() +elif keypressed in ["g"]: +self.handlefirstlineevent() +elif keypressed in ["G"]: +self.handlelastlineevent() elif keypressed in ["?"]: self.helpwindow() self.stdscr.clear() To: arun, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6178: crecord: new keys g & G to navigate to the top and bottom respectively
arun updated this revision to Diff 14620. arun edited the summary of this revision. arun retitled this revision from "crecord: new keys g & G to navigate to the top and bottom hunks respectively" to "crecord: new keys g & G to navigate to the top and bottom respectively". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6178?vs=14615=14620 REVISION DETAIL https://phab.mercurial-scm.org/D6178 AFFECTED FILES mercurial/crecord.py CHANGE DETAILS diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -1467,6 +1467,8 @@ pgup/pgdn [K/J] : go to previous/next item of same type right/left-arrow [l/h] : go to child item / parent item shift-left-arrow [H] : go to parent header / fold selected header + g : go to the first hunk line + G : go to the last hunk line f : fold / unfold item, hiding/revealing its children F : fold / unfold parent item and all of its ancestors ctrl-l : scroll the selected line to the top of the screen @@ -1505,6 +1507,45 @@ self.stdscr.refresh() self.stdscr.keypad(1) # allow arrow-keys to continue to function +def handlefirstlineevent(self): +""" +Handle 'g' to navigate to the top most file in the ncurses window. +""" +self.currentselecteditem = self.headerlist[0] +currentitem = self.currentselecteditem +# select the parent item recursively until we're at a header +while True: +nextitem = currentitem.parentitem() +if nextitem is None: +break +else: +currentitem = nextitem + +self.currentselecteditem = currentitem + +def handlelastlineevent(self): +""" +Handle 'G' to navigate to the bottom most file/hunk/line depending +on the whether the fold is active or not. + +If the bottom most file is folded, it navigates to that file and stops there. +If the bottom most file is unfolded, it navigates to the bottom most hunk in +that file and stops there. If the bottom most hunk is unfolded, it navigates to +the bottom most line in that hunk. +""" +currentitem = self.currentselecteditem +nextitem = currentitem.nextitem() +# select the child item recursively until we're at a footer +while nextitem is not None: +nextitem = currentitem.nextitem() +if nextitem is None: +break +else: +currentitem = nextitem + +self.currentselecteditem = currentitem +self.recenterdisplayedarea() + def confirmationwindow(self, windowtext): "display an informational window, then wait for and return a keypress." @@ -1725,6 +1766,10 @@ self.togglefolded(foldparent=True) elif keypressed in ["m"]: self.commitMessageWindow() +elif keypressed in ["g"]: +self.handlefirstlineevent() +elif keypressed in ["G"]: +self.handlelastlineevent() elif keypressed in ["?"]: self.helpwindow() self.stdscr.clear() To: arun, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6181: localrepo: rename crev in _filecommit() to cnode, since it's a node
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I know we often use "rev" generically, but here's it always a node, so it helps to be specific. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6181 AFFECTED FILES mercurial/localrepo.py CHANGE DETAILS diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2331,13 +2331,13 @@ #\- 2 --- 4as the merge base # -crev = manifest1.get(cfname) +cnode = manifest1.get(cfname) newfparent = fparent2 if manifest2: # branch merge -if fparent2 == nullid or crev is None: # copied on remote side +if fparent2 == nullid or cnode is None: # copied on remote side if cfname in manifest2: -crev = manifest2[cfname] +cnode= manifest2[cfname] newfparent = fparent1 # Here, we used to search backwards through history to try to find @@ -2349,10 +2349,10 @@ # expect this outcome it can be fixed, but this is the correct # behavior in this circumstance. -if crev: -self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(crev))) +if cnode: +self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(cnode))) meta["copy"] = cfname -meta["copyrev"] = hex(crev) +meta["copyrev"] = hex(cnode) fparent1, fparent2 = nullid, newfparent else: self.ui.warn(_("warning: can't find ancestor for '%s' " 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
D6163: copies: extract function for deciding whether to use changeset-centric algos
martinvonz added inline comments. INLINE COMMENTS > martinvonz wrote in copies.py:163 > I initially didn't have `use` and found it less clear. I also think "use > changeset-centric" sounds weird. Maybe just `changesetcentric` as you said > then, but that also seems unclear. It feels like we're working around > https://phab.mercurial-scm.org/D2010. I can accept that we don't want to > queue that, but I don't really like any of the shorter names either. Maybe > the current name is fine given the docstring? Or maybe there's another name that would work? Maybe `usecontextbasedalgo`? Or `shouldgetcopiesfromcontext`? Other suggestions? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6163 To: martinvonz, #hg-reviewers Cc: pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 8 "] util: extract compression code in `mercurial.utils.compression`
I updated the series to fix the typos you pointed out. It is visible on bitbucket if you are curious. I'll send a V2 when other people had a chance to comment on this. https://bitbucket.org/octobus/mercurial-devel/commits/all?search=1fe6a85%3A%3A3e015ee On 4/2/19 8:48 AM, Josef 'Jeff' Sipek wrote: On Sun, Mar 31, 2019 at 17:36:17 +0200, Pierre-Yves David wrote: ... diff --git a/mercurial/util.py b/mercurial/utils/compression.py copy from mercurial/util.py copy to mercurial/utils/compression.py --- a/mercurial/util.py +++ b/mercurial/utils/compression.py @@ -1,1555 +1,37 @@ -# util.py - Mercurial utility functions and platform specific implementations -# -# Copyright 2005 K. Thananchayan -# Copyright 2005-2007 Matt Mackall -# Copyright 2006 Vadim Gelfer +# util.py - Mercurial utility functions for compression Should this say compression.py instead? -- Pierre-Yves David ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6180: wix: add functionality to inject additional Features into installer
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is the last bit required to be able to glue extra configs etc into the installer. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6180 AFFECTED FILES contrib/packaging/hgpackaging/wix.py contrib/packaging/wix/build.py contrib/packaging/wix/mercurial.wxs CHANGE DETAILS diff --git a/contrib/packaging/wix/mercurial.wxs b/contrib/packaging/wix/mercurial.wxs --- a/contrib/packaging/wix/mercurial.wxs +++ b/contrib/packaging/wix/mercurial.wxs @@ -129,6 +129,11 @@ + + + + + diff --git a/contrib/packaging/wix/build.py b/contrib/packaging/wix/build.py --- a/contrib/packaging/wix/build.py +++ b/contrib/packaging/wix/build.py @@ -38,6 +38,9 @@ help='Extra script to run after creating virtualenv.') parser.add_argument('--extra-wxs', help='CSV of path_to_wxs_file=working_dir_for_wxs_file') +parser.add_argument('--extra-features', +help=('CSV of extra feature names to include ' + 'in the installer from the extra wxs files')) args = parser.parse_args() @@ -63,6 +66,8 @@ if args.extra_wxs: kwargs['extra_wxs'] = dict( thing.split("=") for thing in args.extra_wxs.split(',')) +if args.extra_features: +kwargs['extra_features'] = args.extra_features.split(',') if args.sign_sn or args.sign_cert: fn = build_signed_installer diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py --- a/contrib/packaging/hgpackaging/wix.py +++ b/contrib/packaging/hgpackaging/wix.py @@ -180,7 +180,8 @@ def build_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, msi_name='mercurial', version=None, post_build_fn=None, extra_prebuild_script=None, -extra_wxs:typing.Optional[typing.Dict[str,str]]=None): +extra_wxs:typing.Optional[typing.Dict[str,str]]=None, +extra_features:typing.Optional[typing.List[str]]=None): """Build a WiX MSI installer. ``source_dir`` is the path to the Mercurial source tree to use. @@ -252,6 +253,9 @@ defines['Version'] = version defines['Comments'] = 'Installs Mercurial version %s' % version defines['VCRedistSrcDir'] = str(hg_build_dir) +if extra_features: +assert all(';' not in f for f in extra_features) +defines['MercurialExtraFeatures'] = ';'.join(extra_features) run_candle(wix_path, build_dir, source, source_build_rel, defines=defines) @@ -294,7 +298,7 @@ name: str, version=None, subject_name=None, cert_path=None, cert_password=None, timestamp_url=None, extra_prebuild_script=None, - extra_wxs=None): + extra_wxs=None, extra_features=None): """Build an installer with signed executables.""" post_build_fn = make_post_build_signing_fn( @@ -308,7 +312,7 @@ msi_name=name.lower(), version=version, post_build_fn=post_build_fn, extra_prebuild_script=extra_prebuild_script, - extra_wxs=extra_wxs) + extra_wxs=extra_wxs, extra_features=extra_features) description = '%s %s' % (name, version) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6179: wix: add support for additional wxs files
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY As with my previous change for an --extra-prebuiild-script, I'm assuming this is predominantly useful in an enterprise environment and am only adding this to wix and not also to inno install scripts. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6179 AFFECTED FILES contrib/packaging/hgpackaging/wix.py contrib/packaging/wix/build.py CHANGE DETAILS diff --git a/contrib/packaging/wix/build.py b/contrib/packaging/wix/build.py --- a/contrib/packaging/wix/build.py +++ b/contrib/packaging/wix/build.py @@ -36,6 +36,8 @@ help='Version string to use') parser.add_argument('--extra-prebuild-script', help='Extra script to run after creating virtualenv.') +parser.add_argument('--extra-wxs', +help='CSV of path_to_wxs_file=working_dir_for_wxs_file') args = parser.parse_args() @@ -58,6 +60,9 @@ if args.extra_prebuild_script: kwargs['extra_prebuild_script'] = args.extra_prebuild_script +if args.extra_wxs: +kwargs['extra_wxs'] = dict( +thing.split("=") for thing in args.extra_wxs.split(',')) if args.sign_sn or args.sign_cert: fn = build_signed_installer diff --git a/contrib/packaging/hgpackaging/wix.py b/contrib/packaging/hgpackaging/wix.py --- a/contrib/packaging/hgpackaging/wix.py +++ b/contrib/packaging/hgpackaging/wix.py @@ -12,6 +12,7 @@ import re import subprocess import tempfile +import typing import xml.dom.minidom from .downloads import ( @@ -178,7 +179,8 @@ def build_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, msi_name='mercurial', version=None, post_build_fn=None, -extra_prebuild_script=None): +extra_prebuild_script=None, +extra_wxs:typing.Optional[typing.Dict[str,str]]=None): """Build a WiX MSI installer. ``source_dir`` is the path to the Mercurial source tree to use. @@ -190,6 +192,7 @@ Mercurial but before invoking WiX. It can be used to e.g. facilitate signing. It is passed the paths to the Mercurial source, build, and dist directories and the resolved Mercurial version. +``extra_wxs`` is a dict of {wxs_name: working_dir_for_wxs_build}. """ arch = 'x64' if r'\x64' in os.environ.get('LIB', '') else 'x86' @@ -231,6 +234,9 @@ wxs_source_dir = source_dir / rel_path run_candle(wix_path, build_dir, wxs, wxs_source_dir, defines=defines) +for source, rel_path in sorted((extra_wxs or {}).items()): +run_candle(wix_path, build_dir, source, rel_path, defines=defines) + # candle.exe doesn't like when we have an open handle on the file. # So use TemporaryDirectory() instead of NamedTemporaryFile(). with tempfile.TemporaryDirectory() as td: @@ -265,6 +271,11 @@ assert source.endswith('.wxs') args.append(str(build_dir / ('%s.wixobj' % source[:-4]))) +for source, rel_path in sorted((extra_wxs or {}).items()): +assert source.endswith('.wxs') +source = os.path.basename(source) +args.append(str(build_dir / ('%s.wixobj' % source[:-4]))) + args.extend([ str(build_dir / 'library.wixobj'), str(build_dir / 'mercurial.wixobj'), @@ -282,7 +293,8 @@ def build_signed_installer(source_dir: pathlib.Path, python_exe: pathlib.Path, name: str, version=None, subject_name=None, cert_path=None, cert_password=None, - timestamp_url=None, extra_prebuild_script=None): + timestamp_url=None, extra_prebuild_script=None, + extra_wxs=None): """Build an installer with signed executables.""" post_build_fn = make_post_build_signing_fn( @@ -295,7 +307,8 @@ info = build_installer(source_dir, python_exe=python_exe, msi_name=name.lower(), version=version, post_build_fn=post_build_fn, - extra_prebuild_script=extra_prebuild_script) + extra_prebuild_script=extra_prebuild_script, + extra_wxs=extra_wxs) description = '%s %s' % (name, version) To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 8 "] util: extract compression code in `mercurial.utils.compression`
On 4/2/19 8:48 AM, Josef 'Jeff' Sipek wrote: On Sun, Mar 31, 2019 at 17:36:17 +0200, Pierre-Yves David wrote: ... diff --git a/mercurial/util.py b/mercurial/utils/compression.py copy from mercurial/util.py copy to mercurial/utils/compression.py --- a/mercurial/util.py +++ b/mercurial/utils/compression.py @@ -1,1555 +1,37 @@ -# util.py - Mercurial utility functions and platform specific implementations -# -# Copyright 2005 K. Thananchayan -# Copyright 2005-2007 Matt Mackall -# Copyright 2006 Vadim Gelfer +# util.py - Mercurial utility functions for compression Should this say compression.py instead? indeed -- Pierre-Yves David ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 7 of 8 "] compression: introduce an official `zstd-revlog` requirement
On 4/2/19 9:52 AM, Josef 'Jeff' Sipek wrote: On Sun, Mar 31, 2019 at 17:36:23 +0200, Pierre-Yves David wrote: # HG changeset patch # User Pierre-Yves David # Date 1553707623 -3600 # Wed Mar 27 18:27:03 2019 +0100 # Node ID 2cfe9983fa92313d58f0420ec62f2341a810343e # Parent 108e26fa0a97fe5342a1ce246cc4e4c185803454 # EXP-Topic zstd-revlog # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 2cfe9983fa92 compression: introduce an official `zstd-revlog` requirement Is the requirement for the compression algo or for the compression algo's use in revlog? The use of zstd in revlog If the former, something like 'compression-' makes more sense. If the later, would it be better to call it 'revlog-compression-' or something to that effect? Either way, while a *human* knows that zstd is a compression algo, could it make sense to make it easily parsable? I'm imagining a slightly better error messages when requirements fail, or just the ability to programmatically identify the algo. For example, instead of the current: abort: repository requires features unknown to this Mercurial: foobar-revlog! hg could emit: abort: repository requires a compression algo unknown to this Mercurial: foobar! I'm that longer version has much value. Most of our requirement has name opaque to normal user. This is why we link to an explanatory pages. Once this series is in, I am planning to do some UI polish. Especially, for version that know this requirement but have been compiled without zstd support, we can issue a better message. This requirement supersede `exp-compression-zstd`. However, we keep support for s/supersede/supersedes/ :) Jeff. -- Pierre-Yves David ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 6 of 8 "] compression: introduce an official `format.revlog-compression` option
On 4/2/19 9:42 AM, Josef 'Jeff' Sipek wrote: On Sun, Mar 31, 2019 at 17:36:22 +0200, Pierre-Yves David wrote: ... compression: introduce an official `format.revlog-compression` option This option superseed the `experiment.format.compression` option. The value s/superseed/supersedes/ :) currently supported are zlib (default) and zstd (if Mercurial was compiled with zstd support). The option gained an explicite reference to `revlog` since this is the target s/explicite/explicit/ usage here. Different storage methods might requires different compression strategies. s/requires/require/ In our tests, using zstd give a significant CPU usage improvement (both compression and decompressing) while keeping similar repository size. Zstd as other interresting mode (dictionnaly, pre-text, etc…) that are probably I'm guessing here: s/dictionnaly/dictionary/ ? worth exploring. However, just play switching from zlib to zstd provide a large benefit. s/play/plain/ ... diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt --- a/mercurial/help/config.txt +++ b/mercurial/help/config.txt @@ -866,6 +866,13 @@ https://www.mercurial-scm.org/wiki/Missi Repositories with this on-disk format require Mercurial version 4.7 Enabled by default. +``revlog-compression`` +Compression algorithm used by revlog. Supported value are `zlib` and `zstd`. +The `zlib` engine is the historical default of Mercurial. `zstd` is a newer +format that is usually a net win over `zlib` operating faster at better +compression rate. Use `zstd` to reduce CPU usage. + +On some system, Mercurial installation may lack `zstd` supports. Default is `zlib`. This says that 'zlib' is the default - twice. Should it repeat itself like this? The first occurrence carry the information that zlib came before zstd (immutable fact). The second occurrence says that the -current- default is zlib (mutable fact). -- Pierre-Yves David ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 3 of 8 "] compression: introduce a `storage.revlog.zlib.level` configuration
On 4/2/19 9:29 AM, Josef 'Jeff' Sipek wrote: On Sun, Mar 31, 2019 at 17:36:19 +0200, Pierre-Yves David wrote: ... compression: introduce a `storage.revlog.zlib.level` configuration This option control the zlib compression level used when compression revlog chunk. This is also a good excuse to pave the way for a similar configuration option for the zstd compression engine. Having a dedicated option for each compression algorithm is useful because they don't support the same range of values. Using a higher zlib compression impact CPU consumption at compression time, but does not directly affected decompression time. However dealing with small compressed chunk can directly help decompression and indirectly help other revlog logic. I ran some basic test on repositories using different level. I am user the s/user/using/ ? ... I also made some basic timing measurement. The "read" timing are gathered using simple run of `hg perfrevlogrevisions`, the "write" measurement using `hg perfrevlogwrite` (restricted to the last 5000 revisions for netbeans and mozilla central). The timing are gathered on a generic machine, (not one of our performance locked machine), so small variation might not be meaningful. You did more than one measurement, so measurement -> measurements, and timing -> timings? Alternatively, keep the singular but then make the verbs match: are -> is. Sorry to nit-pick, but since this text will end up in the commit messages... :) However large trend remains relevant. Keep in mind that these number are not pure compression/decompression time. s/number/numbers/ They also involve the full revlog logic. In particular the difference in chunk size has an impact on the delta chain structure, affecting performance when writing or reading them. On read/write performance, the compression level has a bigger impact. Counter-intuitively, higher compression level raise better "write" performance s/raise better/increase/ ? This actually confuses me a bit. Based on the table below, it looks like higher compression level has non-linear effect on read/write performance. Maybe I'm not understanding what you meant by 'raise "better"'. While I expect to see a "hump" in *write* performance (because high zlib compression levels are such cpu hogs), I didn't expect to see one for *read* perfomance. I suppose the read hump could be explained by the shape of the DAG, as you point out. Yes, we not doing pure compression test here. This deserve an independant full array of of deeper testing. +``revlog.zlib.level`` +Zlib compression level used when storing data into the repository. Accepted +Value range from 1 (lowest compression) to 9 (highest compression). Zlib +default value is 6. I know this is very unlikely to change, but does it make sense to say what an external libarary's defaults are? I do not understand your question. -- Pierre-Yves David ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D6169: unshelve: disable unshelve during merge (issue5123)
navaneeth.suresh updated this revision to Diff 14616. navaneeth.suresh edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D6169?vs=14592=14616 REVISION DETAIL https://phab.mercurial-scm.org/D6169 AFFECTED FILES hgext/shelve.py tests/test-shelve.t CHANGE DETAILS diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -1087,3 +1087,46 @@ test (4|13):33f7f61e6c5e (re) $ cd .. + +Abort unshelve while merging (issue5123) +- + $ hg init issue5123 + $ cd issue5123 + $ echo > a + $ hg ci -Am a + adding a + $ hg co null + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ echo > b + $ hg ci -Am b + adding b + created new head + $ echo > c + $ hg add c + $ hg shelve + shelved as default + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg co 1 + 0 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ hg merge 0 + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + (branch merge, don't forget to commit) +-- successful merge with two parents + $ hg log -G + @ changeset: 1:406bf70c274f + tag: tip + parent: -1: + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: b + + @ changeset: 0:ada8c9eb8252 + user:test + date:Thu Jan 01 00:00:00 1970 + + summary: a + +-- trying to pull in the shelve bits +-- unshelve should abort otherwise, it'll eat my second parent. + $ hg unshelve + abort: cannot unshelve while merging + [255] diff --git a/hgext/shelve.py b/hgext/shelve.py --- a/hgext/shelve.py +++ b/hgext/shelve.py @@ -988,6 +988,12 @@ return unshelvecontinue(ui, repo, state, opts) elif len(shelved) > 1: raise error.Abort(_('can only unshelve one change at a time')) + +# abort unshelve while merging (issue5123) +parents = repo[None].parents() +if len(parents) > 1: +raise error.Abort(_('cannot unshelve while merging')) + elif not shelved: shelved = listshelves(repo) if not shelved: To: navaneeth.suresh, #hg-reviewers Cc: yuja, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 7 of 8 "] compression: introduce an official `zstd-revlog` requirement
On Sun, Mar 31, 2019 at 17:36:23 +0200, Pierre-Yves David wrote: > # HG changeset patch > # User Pierre-Yves David > # Date 1553707623 -3600 > # Wed Mar 27 18:27:03 2019 +0100 > # Node ID 2cfe9983fa92313d58f0420ec62f2341a810343e > # Parent 108e26fa0a97fe5342a1ce246cc4e4c185803454 > # EXP-Topic zstd-revlog > # Available At https://bitbucket.org/octobus/mercurial-devel/ > # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r > 2cfe9983fa92 > compression: introduce an official `zstd-revlog` requirement Is the requirement for the compression algo or for the compression algo's use in revlog? If the former, something like 'compression-' makes more sense. If the later, would it be better to call it 'revlog-compression-' or something to that effect? Either way, while a *human* knows that zstd is a compression algo, could it make sense to make it easily parsable? I'm imagining a slightly better error messages when requirements fail, or just the ability to programmatically identify the algo. For example, instead of the current: abort: repository requires features unknown to this Mercurial: foobar-revlog! hg could emit: abort: repository requires a compression algo unknown to this Mercurial: foobar! > > This requirement supersede `exp-compression-zstd`. However, we keep support > for s/supersede/supersedes/ :) Jeff. -- What is the difference between Mechanical Engineers and Civil Engineers? Mechanical Engineers build weapons, Civil Engineers build targets. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 6 of 8 "] compression: introduce an official `format.revlog-compression` option
On Sun, Mar 31, 2019 at 17:36:22 +0200, Pierre-Yves David wrote: ... > compression: introduce an official `format.revlog-compression` option > > This option superseed the `experiment.format.compression` option. The value s/superseed/supersedes/ :) > currently supported are zlib (default) and zstd (if Mercurial was compiled > with > zstd support). > > The option gained an explicite reference to `revlog` since this is the target s/explicite/explicit/ > usage here. Different storage methods might requires different compression > strategies. s/requires/require/ > > In our tests, using zstd give a significant CPU usage improvement (both > compression and decompressing) while keeping similar repository size. > > Zstd as other interresting mode (dictionnaly, pre-text, etc…) that are > probably I'm guessing here: s/dictionnaly/dictionary/ ? > worth exploring. However, just play switching from zlib to zstd provide a > large > benefit. s/play/plain/ ... > diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt > --- a/mercurial/help/config.txt > +++ b/mercurial/help/config.txt > @@ -866,6 +866,13 @@ https://www.mercurial-scm.org/wiki/Missi > Repositories with this on-disk format require Mercurial version 4.7 > > Enabled by default. > +``revlog-compression`` > +Compression algorithm used by revlog. Supported value are `zlib` and > `zstd`. > +The `zlib` engine is the historical default of Mercurial. `zstd` is a > newer > +format that is usually a net win over `zlib` operating faster at better > +compression rate. Use `zstd` to reduce CPU usage. > + > +On some system, Mercurial installation may lack `zstd` supports. Default > is `zlib`. This says that 'zlib' is the default - twice. Should it repeat itself like this? Jeff. -- Don't drink and derive. Alcohol and algebra don't mix. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 3 of 8 "] compression: introduce a `storage.revlog.zlib.level` configuration
On Sun, Mar 31, 2019 at 17:36:19 +0200, Pierre-Yves David wrote: ... > compression: introduce a `storage.revlog.zlib.level` configuration > > This option control the zlib compression level used when compression revlog > chunk. > > This is also a good excuse to pave the way for a similar configuration option > for the zstd compression engine. Having a dedicated option for each > compression > algorithm is useful because they don't support the same range of values. > > Using a higher zlib compression impact CPU consumption at compression time, > but > does not directly affected decompression time. However dealing with small > compressed chunk can directly help decompression and indirectly help other > revlog logic. > > I ran some basic test on repositories using different level. I am user the s/user/using/ ? ... > I also made some basic timing measurement. The "read" timing are gathered > using > simple run of `hg perfrevlogrevisions`, the "write" measurement using `hg > perfrevlogwrite` (restricted to the last 5000 revisions for netbeans and > mozilla central). The timing are gathered on a generic machine, (not one of > our performance locked machine), so small variation might not be meaningful. You did more than one measurement, so measurement -> measurements, and timing -> timings? Alternatively, keep the singular but then make the verbs match: are -> is. Sorry to nit-pick, but since this text will end up in the commit messages... :) > However large trend remains relevant. > > Keep in mind that these number are not pure compression/decompression time. s/number/numbers/ > They also involve the full revlog logic. In particular the difference in chunk > size has an impact on the delta chain structure, affecting performance when > writing or reading them. > > On read/write performance, the compression level has a bigger impact. > Counter-intuitively, higher compression level raise better "write" performance s/raise better/increase/ ? This actually confuses me a bit. Based on the table below, it looks like higher compression level has non-linear effect on read/write performance. Maybe I'm not understanding what you meant by 'raise "better"'. While I expect to see a "hump" in *write* performance (because high zlib compression levels are such cpu hogs), I didn't expect to see one for *read* perfomance. I suppose the read hump could be explained by the shape of the DAG, as you point out. > for the large repositories in our tested setting. Maybe because the last 5000 > delta chain end up having a very different shape in this specific spot? Or > maybe > because of a more general trend of better delta chains thanks to the smaller > chunk and snapshot. > > This series does not intend to change the default compression level. However, > these result call for a deeper analysis of this performance difference in the > future. > > Full data > = > > repo level .hg/store size 00manifest.d read write > > mercurial 1 49,402,813 5,963,475 0.170159 53.250304 > mercurial 6 47,197,397 5,875,730 0.182820 56.264320 > mercurial 9 47,121,596 5,849,781 0.189219 56.293612 > > pypy 1 370,830,57228,462,425 2.679217 460.721984 > pypy 6 340,112,31727,648,747 2.768691 467.537158 > pypy 9 338,360,73627,639,003 2.763495 476.589918 > > netbeans 1 1,281,847,810 165,495,457 122.477027 520.560316 > netbeans 6 1,205,284,353 159,161,207 139.876147 715.930400 > netbeans 9 1,197,135,671 155,034,586 141.620281 678.297064 > > mozilla1 2,775,497,186 298,527,987 147.867662 751.263721 > mozilla6 2,596,856,420 286,597,671 170.572118 987.056093 > mozilla9 2,587,542,494 287,018,264 163.622338 739.803002 ... > diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt > --- a/mercurial/help/config.txt > +++ b/mercurial/help/config.txt > @@ -1881,6 +1881,11 @@ category impact performance and reposito > This option is enabled by default. When disabled, it also disables the > related ``storage.revlog.reuse-external-delta-parent`` option. > > +``revlog.zlib.level`` > +Zlib compression level used when storing data into the repository. > Accepted > +Value range from 1 (lowest compression) to 9 (highest compression). Zlib > +default value is 6. I know this is very unlikely to change, but does it make sense to say what an external libarary's defaults are? Thanks for doing this! :) Jeff. -- Reality is merely an illusion, albeit a very persistent one. - Albert Einstein ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 1 of 8 "] util: extract compression code in `mercurial.utils.compression`
On Sun, Mar 31, 2019 at 17:36:17 +0200, Pierre-Yves David wrote: ... > diff --git a/mercurial/util.py b/mercurial/utils/compression.py > copy from mercurial/util.py > copy to mercurial/utils/compression.py > --- a/mercurial/util.py > +++ b/mercurial/utils/compression.py > @@ -1,1555 +1,37 @@ > -# util.py - Mercurial utility functions and platform specific implementations > -# > -# Copyright 2005 K. Thananchayan > -# Copyright 2005-2007 Matt Mackall > -# Copyright 2006 Vadim Gelfer > +# util.py - Mercurial utility functions for compression Should this say compression.py instead? Jeff. -- I think there is a world market for maybe five computers. - Thomas Watson, chairman of IBM, 1943. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel