D3092: simplestore: shore up lookup errors
martinvonz added a comment. > When revisions or nodes can't be resolved, we're expected to raise > an error.LookupError. When I ported code from revlog.py, I failed > to realize that "LookupError" in that module is aliased to > error.LookupError. I thought we were using the builtin LookupError > instead. I've also recently been confused by that. Perhaps we should even rename error.LookupError to something else and avoid shadowing the builtin? StoreLookupError, perhaps? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3092 To: indygreg, #hg-reviewers Cc: martinvonz, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3085: children: support specifying revision by revset
martinvonz added a comment. In https://phab.mercurial-scm.org/D3085#49796, @indygreg wrote: > It would be nice to have tests for these changes to ensure we don't regress... > > But progress is progress. I spent about a minute or two trying to find a good test to update while writing https://phab.mercurial-scm.org/D3084, but there didn't even seem to be one for `hg heads `, so I was lazy. Thanks for making me check tests for `hg children`, because that was actually easy - I've just sent https://phab.mercurial-scm.org/D3120. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3085 To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3120: tests: add test for `hg children -r `
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Should have been part of https://phab.mercurial-scm.org/D3085. Feel free to fold it into that commit. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3120 AFFECTED FILES tests/test-children.t CHANGE DETAILS diff --git a/tests/test-children.t b/tests/test-children.t --- a/tests/test-children.t +++ b/tests/test-children.t @@ -63,11 +63,11 @@ hg children at revision 2 (other head) $ hg children - $ for i in null 0 1 2 3; do - > echo "hg children -r $i" + $ for i in null 0 1 2 3 '2^'; do + > echo "hg children -r '$i'" > hg children -r $i > done - hg children -r null + hg children -r 'null' changeset: 0:4df8521a7374 user:test date:Thu Jan 01 00:00:00 1970 + @@ -80,20 +80,26 @@ date:Thu Jan 01 00:00:03 1970 + summary: 3 - hg children -r 0 + hg children -r '0' changeset: 1:708c093edef0 user:test date:Thu Jan 01 00:00:01 1970 + summary: 1 - hg children -r 1 + hg children -r '1' changeset: 2:8f5eea5023c2 user:test date:Thu Jan 01 00:00:02 1970 + summary: 2 - hg children -r 2 - hg children -r 3 + hg children -r '2' + hg children -r '3' + hg children -r '2^' + changeset: 2:8f5eea5023c2 + user:test + date:Thu Jan 01 00:00:02 1970 + + summary: 2 + hg children -r 0 file0 (should be 2) $ hg children -r 0 file0 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
D3118: commands: document the layering violation in `manifest --all`
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This commit fixes the last test failures when using the simple store extension! It turns out that `hg manifest --all` locks the repo and scans for revlogs. This feature was added by https://phab.mercurial-scm.org/rHG71938479eff93aabc8da2df053e77e9d8d8e1844 in 2011. I am debating changing the behavior. But that can occur in another commit. As part of debugging this, I realized that test-manifest.t is the only meaningful tester of `hg manifest --all` and that test was improperly disabled when bundlerepos aren't supported. The test is testing manifest behavior, not whether you can `hg pull` from a bundle. So I changed the test to `hg unbundle` instead. FWIW, I wasted a non-trivial amount of time tracking down this failure. I thought the issue involved Git, which is why I refactored the test to be more deterministic. Never in my mind would I have guessed that code in `hg manifest` would scan revlogs. I should have looked there to begin with. Doh. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3118 AFFECTED FILES mercurial/commands.py tests/test-convert-git.t tests/test-manifest.t CHANGE DETAILS diff --git a/tests/test-manifest.t b/tests/test-manifest.t --- a/tests/test-manifest.t +++ b/tests/test-manifest.t @@ -1,5 +1,3 @@ -#require repobundlerepo - Source bundle was generated with the following script: # hg init @@ -12,7 +10,13 @@ # hg ci -Amb -d'1 0' $ hg init - $ hg -q pull "$TESTDIR/bundles/test-manifest.hg" + $ hg unbundle "$TESTDIR/bundles/test-manifest.hg" + adding changesets + adding manifests + adding file changes + added 2 changesets with 3 changes to 3 files + new changesets b73562a03cfe:5bdc995175ba + (run 'hg update' to get a working copy) The next call is expected to return nothing: @@ -64,9 +68,9 @@ l $ hg manifest --all - a - b/a - l + a (no-reposimplestore !) + b/a (no-reposimplestore !) + l (no-reposimplestore !) The next two calls are expected to abort: diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t --- a/tests/test-convert-git.t +++ b/tests/test-convert-git.t @@ -881,7 +881,7 @@ $ hg convert -q git-repo6 no-submodules --config convert.git.skipsubmodules=True $ hg -R no-submodules manifest --all - .gitmodules-renamed + .gitmodules-renamed (no-reposimplestore !) convert using a different remote prefix $ git init git-repo7 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3492,6 +3492,8 @@ raise error.Abort(_("can't specify a revision with --all")) res = [] +# TODO this is a massive layering violation. It assumes the repo is +# backed by revlogs with a well-defined naming scheme. prefix = "data/" suffix = ".i" plen = len(prefix) To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3119: commands: don't violate storage abstractions in `manifest --all`
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Previously, we asked the store to emit its data files. For modern repos, this would use fncache to resolve the set of files then would stat() each file. For my copy of the mozilla-unified repository, this took 3.3-10s depending on the state of my filesystem cache to render 449,790 items. The previous behavior was a massive layering violation because it assumed tracked files would have specific filenames in specific directories. Alternate storage backends would violate this assumption. The new behavior scans the changelog entries for the set of files changed by each commit. It aggregates them into a set and then sorts and prints the result. This reliably takes ~16.3s on my machine. ~80% of the time is spent in zlib decompression. The performance regression is unfortunate. If we want to claw it back, we can create a proper storage API to query for the set of tracked files. I'm not opposed to doing that. But I'm in no hurry because I suspect ~0 people care about the performance of `hg manifest --all`. .. perf:: `hg manifest --all` is likely slower due to changing its implementation to respect storage interface boundaries. If you are impacted by this regression in a meaningful way, please make noise on the development mailing list and it can be dealt with. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3119 AFFECTED FILES mercurial/commands.py tests/test-convert-git.t tests/test-manifest.t CHANGE DETAILS diff --git a/tests/test-manifest.t b/tests/test-manifest.t --- a/tests/test-manifest.t +++ b/tests/test-manifest.t @@ -68,9 +68,9 @@ l $ hg manifest --all - a (no-reposimplestore !) - b/a (no-reposimplestore !) - l (no-reposimplestore !) + a + b/a + l The next two calls are expected to abort: diff --git a/tests/test-convert-git.t b/tests/test-convert-git.t --- a/tests/test-convert-git.t +++ b/tests/test-convert-git.t @@ -881,7 +881,7 @@ $ hg convert -q git-repo6 no-submodules --config convert.git.skipsubmodules=True $ hg -R no-submodules manifest --all - .gitmodules-renamed (no-reposimplestore !) + .gitmodules-renamed convert using a different remote prefix $ git init git-repo7 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3491,19 +3491,13 @@ if rev or node: raise error.Abort(_("can't specify a revision with --all")) -res = [] -# TODO this is a massive layering violation. It assumes the repo is -# backed by revlogs with a well-defined naming scheme. -prefix = "data/" -suffix = ".i" -plen = len(prefix) -slen = len(suffix) -with repo.lock(): -for fn, b, size in repo.store.datafiles(): -if size != 0 and fn[-slen:] == suffix and fn[:plen] == prefix: -res.append(fn[plen:-slen]) +res = set() +for rev in repo: +ctx = repo[rev] +res |= set(ctx.files()) + ui.pager('manifest') -for f in res: +for f in sorted(res): fm.startitem() fm.write("path", '%s\n', f) fm.end() To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3115: tests: `hg init` after resetting HGRCPATH
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Otherwise extensions loaded via --extra-config-opt could prevent access to the repo by introducing requirements file. This does mean that custom extensions loaded in this way won't impact this test. I'm fine with that. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3115 AFFECTED FILES tests/test-hgrc.t CHANGE DETAILS diff --git a/tests/test-hgrc.t b/tests/test-hgrc.t --- a/tests/test-hgrc.t +++ b/tests/test-hgrc.t @@ -1,11 +1,11 @@ -hide outer repo - $ hg init - Use hgrc within $TESTTMP $ HGRCPATH=`pwd`/hgrc $ export HGRCPATH +hide outer repo + $ hg init + Use an alternate var for scribbling on hgrc to keep check-code from complaining about the important settings we may be overwriting: To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3116: simplestore: correctly implement flag processors
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY There were a couple of bugs around the implementation of flags processing with the simple store. After these changes, test-flagprocessor.t now passes! test-flagprocessor.t was also updated to include explicit test coverage that pushed data is as expected on the server. The test extension used by test-flagprocessor.t has been updated so it monkeypatches the object returned from repo.file() instead of monkeypatching filelog.filelog. This allows it to work with extensions that return custom types from repo.file(). The monkeypatching is rather hacky and probably is performance prohibitive for real repos. We should probably come up with a better mechanism for registering flag processors so monkeypatching isn't needed. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3116 AFFECTED FILES tests/flagprocessorext.py tests/simplestorerepo.py tests/test-flagprocessor.t CHANGE DETAILS diff --git a/tests/test-flagprocessor.t b/tests/test-flagprocessor.t --- a/tests/test-flagprocessor.t +++ b/tests/test-flagprocessor.t @@ -88,6 +88,44 @@ adding file changes added 7 changesets with 7 changes to 7 files +Ensure the data got to the server OK + + $ cd ../server + $ hg cat -r 6e48f4215d24 noop + [NOOP] + $ hg debugdata noop 0 + [NOOP] + + $ hg cat -r 6e48f4215d24 base64 + [BASE64] + $ hg debugdata base64 0 + W0JBU0U2NF0K (no-eol) + + $ hg cat -r 6e48f4215d24 gzip + [GZIP] + $ hg debugdata gzip 0 + x\x9c\x8bv\x8f\xf2\x0c\x88\xe5\x02\x00\x08\xc8\x01\xfd (no-eol) (esc) + + $ hg cat -r 6e48f4215d24 noop-base64 + [NOOP][BASE64] + $ hg debugdata noop-base64 0 + W05PT1BdW0JBU0U2NF0K (no-eol) + + $ hg cat -r 6e48f4215d24 noop-gzip + [NOOP][GZIP] + $ hg debugdata noop-gzip 0 + x\x9c\x8b\xf6\xf3\xf7\x0f\x88\x8dv\x8f\xf2\x0c\x88\xe5\x02\x00\x1dH\x03\xf1 (no-eol) (esc) + + $ hg cat -r 6e48f4215d24 base64-gzip + [BASE64][GZIP] + $ hg debugdata base64-gzip 0 + eJyLdnIMdjUziY12j/IMiOUCACLBBDo= (no-eol) + + $ hg cat -r 6e48f4215d24 base64-gzip-noop + [BASE64][GZIP][NOOP] + $ hg debugdata base64-gzip-noop 0 + eJyLdnIMdjUziY12j/IMiI328/cPiOUCAESjBi4= (no-eol) + # Initialize new client (not cloning) and setup extension $ cd .. $ hg init client2 @@ -197,6 +235,7 @@ $ echo '[BASE64]a-bit-longer-branching' > base64 $ hg commit -q -m branching +#if repobundlerepo $ hg bundle --base 1 bundle.hg 4 changesets found $ hg --config extensions.strip= strip -r 2 --no-backup --force -q @@ -253,6 +292,7 @@ 1 files changed, 1 insertions(+), 0 deletions(-) $ rm bundle.hg bundle-again.hg +#endif # TEST: hg status diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py --- a/tests/simplestorerepo.py +++ b/tests/simplestorerepo.py @@ -243,6 +243,10 @@ if flags == 0: return text, True +if flags & ~revlog.REVIDX_KNOWN_FLAGS: +raise error.RevlogError(_("incompatible revision flag '%#x'") % +(flags & ~revlog.REVIDX_KNOWN_FLAGS)) + validatehash = True # Depending on the operation (read or write), the order might be # reversed due to non-commutative transforms. @@ -405,15 +409,13 @@ return 0, 0 def add(self, text, meta, transaction, linkrev, p1, p2): -transaction.addbackup(self._indexpath) - if meta or text.startswith(b'\1\n'): text = filelog.packmeta(meta, text) return self.addrevision(text, transaction, linkrev, p1, p2) def addrevision(self, text, transaction, linkrev, p1, p2, node=None, -flags=0): +flags=revlog.REVIDX_DEFAULT_FLAGS, cachedelta=None): validatenode(p1) validatenode(p2) @@ -430,15 +432,21 @@ if validatehash: self.checkhash(rawtext, node, p1=p1, p2=p2) +return self._addrawrevision(node, rawtext, transaction, linkrev, p1, p2, +flags) + +def _addrawrevision(self, node, rawtext, transaction, link, p1, p2, flags): +transaction.addbackup(self._indexpath) + path = b'/'.join([self._storepath, hex(node)]) -self._svfs.write(path, text) +self._svfs.write(path, rawtext) self._indexdata.append({ b'node': node, b'p1': p1, b'p2': p2, -b'linkrev': linkrev, +b'linkrev': link, b'flags': flags, }) @@ -457,6 +465,7 @@ for node, p1, p2, linknode, deltabase, delta, flags in deltas: linkrev = linkmapper(linknode) +flags = flags or revlog.REVIDX_DEFAULT_FLAGS nodes.append(node) @@ -469,7 +478,8 @@ else: text = mdiff.patch(self.revision(deltabase), delta) -
D3111: tests: use unbundle in test-symlink-os-yes-fs-no.py
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The test (which should probably be rewritten as a .t test - the test was initially authored in 2009 and this may have predated some test harness features allowing us to implement it as a .t test) is verifying symlink behavior with regards to working directory operations. How it pulls bundle data into a repo is not relevant. So we can switch from pull to unbundle so we can support environments where bundlerepos don't work. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3111 AFFECTED FILES tests/test-symlink-os-yes-fs-no.py tests/test-symlink-os-yes-fs-no.py.out CHANGE DETAILS diff --git a/tests/test-symlink-os-yes-fs-no.py.out b/tests/test-symlink-os-yes-fs-no.py.out --- a/tests/test-symlink-os-yes-fs-no.py.out +++ b/tests/test-symlink-os-yes-fs-no.py.out @@ -1,16 +1,12 @@ -requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets d326ae2d01ee -updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved -requesting all changes adding changesets adding manifests adding file changes added 1 changesets with 4 changes to 4 files new changesets d326ae2d01ee -updating to branch default 4 files updated, 0 files merged, 0 files removed, 0 files unresolved diff --git a/tests/test-symlink-os-yes-fs-no.py b/tests/test-symlink-os-yes-fs-no.py --- a/tests/test-symlink-os-yes-fs-no.py +++ b/tests/test-symlink-os-yes-fs-no.py @@ -21,10 +21,11 @@ # hide outer repo hg.peer(u, {}, '.', create=True) -# clone with symlink support -hg.clone(u, {}, BUNDLEPATH, 'test0') +# unbundle with symlink support +hg.peer(u, {}, 'test0', create=True) repo = hg.repository(u, 'test0') +commands.unbundle(u, repo, BUNDLEPATH, update=True) # wait a bit, or the status call wont update the dirstate time.sleep(1) @@ -52,6 +53,8 @@ repo = hg.repository(u, 'test0') commands.status(u, repo) -# try cloning a repo which contains symlinks +# try unbundling a repo which contains symlinks u = uimod.ui.load() -hg.clone(u, {}, BUNDLEPATH, 'test1') + +repo = hg.repository(u, 'test1', create=True) +commands.unbundle(u, repo, BUNDLEPATH, update=True) To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3109: tests: use `hg unbundle` in test-setdiscovery.t
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is testing how discovery between 2 well-defined repos works, not that `hg pull` works with bundles. Switch to `hg unbundle` so it works in environments where bundlerepos aren't supported. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3109 AFFECTED FILES tests/test-setdiscovery.t CHANGE DETAILS diff --git a/tests/test-setdiscovery.t b/tests/test-setdiscovery.t --- a/tests/test-setdiscovery.t +++ b/tests/test-setdiscovery.t @@ -512,8 +512,12 @@ $ hg -R r2 bundle -qa $TESTDIR/bundles/issue4438-r2.hg #else use existing bundles: - $ hg clone -q $TESTDIR/bundles/issue4438-r1.hg r1 - $ hg clone -q $TESTDIR/bundles/issue4438-r2.hg r2 + $ hg init r1 + $ hg -R r1 -q unbundle $TESTDIR/bundles/issue4438-r1.hg + $ hg -R r1 -q up + $ hg init r2 + $ hg -R r2 -q unbundle $TESTDIR/bundles/issue4438-r2.hg + $ hg -R r2 -q up #endif Set iteration order could cause wrong and unstable results - fixed in 73cfaa348650: To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3113: tests: disable test-keyword.t with simple store
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The keyword extension is hooking into repo.file() and defining its own filelog class. It will likely require a more formal storage interface before keywords are usable with alternate storage backends. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3113 AFFECTED FILES tests/test-keyword.t CHANGE DETAILS diff --git a/tests/test-keyword.t b/tests/test-keyword.t --- a/tests/test-keyword.t +++ b/tests/test-keyword.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + Run kwdemo outside a repo $ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo [extensions] To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3110: tests: disable `hg clone --stream` test with simple store
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY We mass disabled stream clone tests in a previous commit. Looks like one was missed. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3110 AFFECTED FILES tests/test-http-bundle1.t CHANGE DETAILS diff --git a/tests/test-http-bundle1.t b/tests/test-http-bundle1.t --- a/tests/test-http-bundle1.t +++ b/tests/test-http-bundle1.t @@ -380,14 +380,16 @@ server has pull-based clones disabled [255] +#if no-reposimplestore ... but keep stream clones working $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone streaming all changes * files to transfer, * of data (glob) transferred * in * seconds (* KB/sec) (glob) searching for changes no changes found +#endif ... and also keep partial clones and pulls working $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3114: tests: work around potential repo incompatibility
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY test-run-tests.t invokes run-tests.py. But custom extensions providing new repo requirements may be in play and may not get inherited by the new run-tests.py. We ensure our repo is created with a vanilla config to mitigate extension-caused badness. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3114 AFFECTED FILES tests/test-run-tests.t CHANGE DETAILS diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t --- a/tests/test-run-tests.t +++ b/tests/test-run-tests.t @@ -558,7 +558,12 @@ Verify that we can try other ports === - $ hg init inuse + +Extensions aren't inherited by the invoked run-tests.py. An extension +introducing a repository requirement could cause this to fail. So we force +HGRCPATH to get a clean environment. + + $ HGRCPATH= hg init inuse $ hg serve -R inuse -p $HGPORT -d --pid-file=blocks.pid $ cat blocks.pid >> $DAEMON_PIDS $ cat > test-serve-inuse.t
D3107: tests: conditionalize test-commandserver.t based on extra extensions
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY If running with extra extensions we get an output difference. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3107 AFFECTED FILES tests/test-commandserver.t CHANGE DETAILS diff --git a/tests/test-commandserver.t b/tests/test-commandserver.t --- a/tests/test-commandserver.t +++ b/tests/test-commandserver.t @@ -189,6 +189,8 @@ > foo = bar > EOF +#if no-extraextensions + >>> from hgclient import check, readchannel, runcommand, sep >>> @check ... def localhgrc(server): @@ -222,6 +224,7 @@ ui.interactive=False ui.mergemarkers=detailed ui.nontty=true +#endif $ rm -R foo To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3112: tests: conditionalize test-treemanifest.t
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Parts of the test were assuming the use of revlogs with fnstore path encoding. Other parts of the test assumed we could create repos with different store encodings and that stream clone bundles worked. Make all of this conditional on running a revlog repo. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3112 AFFECTED FILES tests/test-treemanifest.t CHANGE DETAILS diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t --- a/tests/test-treemanifest.t +++ b/tests/test-treemanifest.t @@ -474,7 +474,12 @@ Test files for a subdirectory. +#if reporevlogstore $ rm -r .hg/store/meta/~2e_a +#endif +#if reposimplestore + $ rm -r .hg/store/meta/._a +#endif $ hg files -r . b b/bar/fruits.txt b/bar/orange/fly/gnat.py @@ -490,7 +495,12 @@ Test files with just includes and excludes. +#if reporevlogstore $ rm -r .hg/store/meta/~2e_a +#endif +#if reposimplestore + $ rm -r .hg/store/meta/._a +#endif $ rm -r .hg/store/meta/b/bar/orange/fly $ rm -r .hg/store/meta/b/foo/apple/bees $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees @@ -502,7 +512,12 @@ Test files for a subdirectory, excluding a directory within it. +#if reporevlogstore $ rm -r .hg/store/meta/~2e_a +#endif +#if reposimplestore + $ rm -r .hg/store/meta/._a +#endif $ rm -r .hg/store/meta/b/foo $ hg files -r . -X path:b/foo b b/bar/fruits.txt @@ -518,7 +533,12 @@ Test files for a sub directory, including only a directory within it, and including an unrelated directory. +#if reporevlogstore $ rm -r .hg/store/meta/~2e_a +#endif +#if reposimplestore + $ rm -r .hg/store/meta/._a +#endif $ rm -r .hg/store/meta/b/foo $ hg files -r . -I path:b/bar/orange -I path:a b b/bar/orange/fly/gnat.py @@ -532,7 +552,12 @@ Test files for a pattern, including a directory, and excluding a directory within that. +#if reporevlogstore $ rm -r .hg/store/meta/~2e_a +#endif +#if reposimplestore + $ rm -r .hg/store/meta/._a +#endif $ rm -r .hg/store/meta/b/foo $ rm -r .hg/store/meta/b/bar/orange $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange @@ -601,20 +626,20 @@ b/@1: parent-directory manifest refers to unknown revision f065da70369e b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b b/@3: parent-directory manifest refers to unknown revision 367152e6af28 - warning: orphan data file 'meta/b/bar/00manifest.i' - warning: orphan data file 'meta/b/bar/orange/00manifest.i' - warning: orphan data file 'meta/b/bar/orange/fly/00manifest.i' - warning: orphan data file 'meta/b/foo/00manifest.i' - warning: orphan data file 'meta/b/foo/apple/00manifest.i' - warning: orphan data file 'meta/b/foo/apple/bees/00manifest.i' + warning: orphan data file 'meta/b/bar/00manifest.i' (reporevlogstore !) + warning: orphan data file 'meta/b/bar/orange/00manifest.i' (reporevlogstore !) + warning: orphan data file 'meta/b/bar/orange/fly/00manifest.i' (reporevlogstore !) + warning: orphan data file 'meta/b/foo/00manifest.i' (reporevlogstore !) + warning: orphan data file 'meta/b/foo/apple/00manifest.i' (reporevlogstore !) + warning: orphan data file 'meta/b/foo/apple/bees/00manifest.i' (reporevlogstore !) crosschecking files in changesets and manifests b/bar/fruits.txt@0: in changeset but not in manifest b/bar/orange/fly/gnat.py@0: in changeset but not in manifest b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest b/foo/apple/bees/flower.py@0: in changeset but not in manifest checking files 8 files, 4 changesets, 18 total revisions - 6 warnings encountered! + 6 warnings encountered! (reporevlogstore !) 9 integrity errors encountered! (first damaged changeset appears to be 0) [1] @@ -669,6 +694,8 @@ Tree manifest revlogs exist. $ find deepclone/.hg/store/meta | sort deepclone/.hg/store/meta + deepclone/.hg/store/meta/._a (reposimplestore !) + deepclone/.hg/store/meta/._a/00manifest.i (reposimplestore !) deepclone/.hg/store/meta/b deepclone/.hg/store/meta/b/00manifest.i deepclone/.hg/store/meta/b/bar @@ -683,8 +710,8 @@ deepclone/.hg/store/meta/b/foo/apple/00manifest.i deepclone/.hg/store/meta/b/foo/apple/bees deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i - deepclone/.hg/store/meta/~2e_a - deepclone/.hg/store/meta/~2e_a/00manifest.i + deepclone/.hg/store/meta/~2e_a (reporevlogstore !) + deepclone/.hg/store/meta/~2e_a/00manifest.i (reporevlogstore !) Verify passes. $ cd deepclone $ hg verify @@ -696,6 +723,7 @@ 8 files, 4 changesets, 18 total revisions $ cd .. +#if reporevlogstore Create clones using old repo formats to use in later tests $ hg clone --config format.usestore=False \ > --config experimental.changegroup3=True \
D3095: simplestore: use a custom store for the simple store repo
indygreg created this revision. Herald added a reviewer: durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Before, we used the default store, which was based on fncache and dotencode. After attempting to port tests to work with the simple store, I realized that fncache was more trouble than it is worth. This commit implements a proper store type for the simple repo - one that isn't based off fncache. This causes a number of new test failures because of tests expecting the full fncache store filename encoding. I may extend the store format in a subsequent commit to take the filename encoding parts of fncache that we can take (basically everything except hash encoding, since that isn't reversible). But for now, let's use encoded store. As part of this, we implement proper requirements support for repos created with the simple store. This should have been done from the beginning, as a requirement is needed to lock out clients that don't understand a storage format. A new hghave feature advertising the presence of fncache in repos has been added. Most tests touching the fncache are now conditional on that feature. Other tests have added the optional repo requirement to output. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3095 AFFECTED FILES tests/hghave.py tests/simplestorerepo.py tests/test-clone.t tests/test-convert.t tests/test-fncache.t tests/test-hardlinks.t tests/test-hook.t tests/test-inherit-mode.t tests/test-init.t tests/test-narrow-clone-no-ellipsis.t tests/test-narrow-clone.t tests/test-narrow.t tests/test-repo-compengines.t tests/test-sparse-requirement.t tests/test-strip.t tests/test-subrepo-deep-nested-change.t tests/test-subrepo-recursion.t tests/test-treemanifest.t CHANGE DETAILS diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t --- a/tests/test-treemanifest.t +++ b/tests/test-treemanifest.t @@ -557,6 +557,7 @@ checking files 8 files, 4 changesets, 18 total revisions +#if repofncache Dirlogs are included in fncache $ grep meta/.A/00manifest.i .hg/store/fncache meta/.A/00manifest.i @@ -581,6 +582,7 @@ adding meta/b/foo/apple/00manifest.i adding meta/b/foo/apple/bees/00manifest.i 16 items added, 0 removed from fncache +#endif Finish first server $ killdaemons.py diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t --- a/tests/test-subrepo-recursion.t +++ b/tests/test-subrepo-recursion.t @@ -466,7 +466,6 @@ linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) linking [ <=>] 11\r (no-eol) (esc) (reposimplestore !) linking [<=> ] 12\r (no-eol) (esc) (reposimplestore !) - linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) #else $ hg clone -U . ../empty @@ -498,7 +497,6 @@ linking [<=> ] 12\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 14\r (no-eol) (esc) (reposimplestore !) - linking [ <=>] 15\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo) [ ] 0/3\r (no-eol) (esc) @@ -515,7 +513,6 @@ linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !) linking [<=>] 8\r (no-eol) (esc) (reposimplestore !) - linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) diff --git a/tests/test-subrepo-deep-nested-change.t b/tests/test-subrepo-deep-nested-change.t --- a/tests/test-subrepo-deep-nested-change.t +++ b/tests/test-subrepo-deep-nested-change.t @@ -34,7 +34,6 @@ linking [<=>] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) - linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) \r (no-eol) (esc) updating
D3098: tests: don't drop global hgrc
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Various tests are failing when the simple store extension is loaded because the test overrides HGRCPATH and preempts loading of extensions that were injected via --extra-config-opt. In most cases, it is acceptable to always load the global HGRCPATH. So this commit changes a couple of tests so the global HGRCPATH is still pulled in. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3098 AFFECTED FILES tests/test-command-template.t tests/test-wireproto.t CHANGE DETAILS diff --git a/tests/test-wireproto.t b/tests/test-wireproto.t --- a/tests/test-wireproto.t +++ b/tests/test-wireproto.t @@ -114,10 +114,7 @@ HTTP without the httpheader capability: - $ HGRCPATH="`pwd`/repo/.hgrc" - $ export HGRCPATH - $ CAP=httpheader - $ . "$TESTDIR/notcapable" + $ CAP=httpheader . "$TESTDIR/notcapable" $ hg serve -R repo -p $HGPORT2 -d --pid-file=hg2.pid -E error2.log -A access2.log $ cat hg2.pid >> $DAEMON_PIDS diff --git a/tests/test-command-template.t b/tests/test-command-template.t --- a/tests/test-command-template.t +++ b/tests/test-command-template.t @@ -284,7 +284,8 @@ so it can be included in hgrc - $ cat <<'EOF' > myhgrc + $ cat < myhgrc + > %include $HGRCPATH > %include map-simple > [templates] > foo = "{changeset}" To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3100: tests: port test-convert-filemap.t to simple store
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3100 AFFECTED FILES tests/test-convert-filemap.t CHANGE DETAILS diff --git a/tests/test-convert-filemap.t b/tests/test-convert-filemap.t --- a/tests/test-convert-filemap.t +++ b/tests/test-convert-filemap.t @@ -283,14 +283,23 @@ > exclude dir/subdir > include dir/subdir/file3 > EOF +#if reporevlogstore $ rm source/.hg/store/data/dir/file3.i $ rm source/.hg/store/data/dir/file4.i +#endif +#if reposimplestore + $ rm -rf source/.hg/store/data/dir/file3 + $ rm -rf source/.hg/store/data/dir/file4 +#endif $ hg -q convert --filemap renames.fmap --datesort source dummydest - abort: data/dir/file3.i@e96dce0bc6a2: no match found! + abort: data/dir/file3.i@e96dce0bc6a2: no match found! (reporevlogstore !) + abort: data/dir/file3/index@e96dce0bc6a2: no node! (reposimplestore !) [255] $ hg -q convert --filemap renames.fmap --datesort --config convert.hg.ignoreerrors=1 source renames.repo - ignoring: data/dir/file3.i@e96dce0bc6a2: no match found - ignoring: data/dir/file4.i@6edd55f559cd: no match found + ignoring: data/dir/file3.i@e96dce0bc6a2: no match found (reporevlogstore !) + ignoring: data/dir/file4.i@6edd55f559cd: no match found (reporevlogstore !) + ignoring: data/dir/file3/index@e96dce0bc6a2: no node (reposimplestore !) + ignoring: data/dir/file4/index@6edd55f559cd: no node (reposimplestore !) $ hg up -q -R renames.repo $ glog -R renames.repo @ 4 "8: change foo" files: foo2 To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3106: tests: conditionalize test-bundle.t
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This test is massive and could probably be split up. This change essentially requires the revlog store for stream clone tests and support for bundlerepos for various tests operating on bundle files. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3106 AFFECTED FILES tests/test-bundle.t CHANGE DETAILS diff --git a/tests/test-bundle.t b/tests/test-bundle.t --- a/tests/test-bundle.t +++ b/tests/test-bundle.t @@ -77,6 +77,8 @@ checking files 0 files, 0 changesets, 0 total revisions +#if repobundlerepo + Pull full.hg into test (using --cwd) $ hg --cwd test pull ../full.hg @@ -257,6 +259,8 @@ changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=bundle:empty+full.hg (run 'hg heads' to see heads, 'hg merge' to merge) +#endif + Cannot produce streaming clone bundles with "hg bundle" $ hg -R test bundle -t packed1 packed.hg @@ -266,6 +270,8 @@ packed1 is produced properly +#if reporevlogstore + $ hg -R test debugcreatestreamclonebundle packed.hg writing 2664 bytes for 6 files bundle requirements: generaldelta, revlogv1 @@ -377,6 +383,8 @@ abort: cannot apply stream clone bundle on non-empty repo [255] +#endif + Create partial clones $ rm -r empty @@ -394,6 +402,8 @@ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd partial +#if repobundlerepo + Log -R full.hg in partial $ hg -R bundle://../full.hg log -T phases @@ -528,13 +538,18 @@ $ hg -R bundle://../does-not-exist.hg outgoing ../partial2 abort: *../does-not-exist.hg* (glob) [255] + +#endif + $ cd .. hide outer repo $ hg init Direct clone from bundle (all-history) +#if repobundlerepo + $ hg clone full.hg full-clone requesting all changes adding changesets @@ -616,7 +631,7 @@ $ cd .. -test for 540d1059c802 +#endif test for 540d1059c802 @@ -638,7 +653,10 @@ searching for changes 1 changesets found - $ cd ../orig + $ cd .. + +#if repobundlerepo + $ cd orig $ hg incoming ../bundle.hg comparing with ../bundle.hg searching for changes @@ -667,6 +685,8 @@ [255] $ cd .. +#endif + test to bundle revisions on the newly created branch (issue3828): $ hg -q clone -U test test-clone @@ -677,8 +697,10 @@ $ hg -q outgoing ../test-clone 9:b4f5acb1ee27 $ hg -q bundle --branch foo foo.hg ../test-clone +#if repobundlerepo $ hg -R foo.hg -q log -r "bundle()" 9:b4f5acb1ee27 +#endif $ cd .. @@ -694,9 +716,11 @@ full history bundle, refuses to verify non-local repo +#if repobundlerepo $ hg -R all.hg verify abort: cannot verify bundle or remote repos [255] +#endif but, regular verify must continue to work @@ -707,6 +731,7 @@ checking files 2 files, 2 changesets, 2 total revisions +#if repobundlerepo diff against bundle $ hg init b @@ -721,6 +746,7 @@ -2 -3 $ cd .. +#endif bundle single branch @@ -779,6 +805,7 @@ bundling: x 3/3 files (100.00%) bundle2-output-part: "cache:rev-branch-cache" streamed payload +#if repobundlerepo == Test for issue3441 $ hg clone -q -r0 . part2 @@ -789,6 +816,7 @@ crosschecking files in changesets and manifests checking files 4 files, 3 changesets, 5 total revisions +#endif == Test bundling no commits @@ -848,6 +876,8 @@ date:Thu Jan 01 00:00:00 1970 + summary: 0 + +#if repobundlerepo $ hg bundle --base 1 -r 3 ../update2bundled.hg 1 changesets found $ hg strip -r 3 @@ -869,3 +899,4 @@ $ hg update -R ../update2bundled.hg -r 0 0 files updated, 0 files merged, 2 files removed, 0 files unresolved +#endif To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3104: simplestore: back up index when adding a revision
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This ensures that transaction rollback reverts the index to its previous state. This fixed a few test failures due to `hg verify` complaining about a reference to an undefined changeset revision. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3104 AFFECTED FILES tests/simplestorerepo.py tests/test-clone.t tests/test-subrepo-recursion.t CHANGE DETAILS diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t --- a/tests/test-subrepo-recursion.t +++ b/tests/test-subrepo-recursion.t @@ -466,6 +466,7 @@ linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) linking [ <=>] 11\r (no-eol) (esc) (reposimplestore !) linking [<=> ] 12\r (no-eol) (esc) (reposimplestore !) + linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) #else $ hg clone -U . ../empty @@ -497,6 +498,8 @@ linking [<=> ] 12\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) linking [ <=> ] 14\r (no-eol) (esc) (reposimplestore !) + linking [ <=>] 15\r (no-eol) (esc) (reposimplestore !) + linking [<=> ] 16\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo) [ ] 0/3\r (no-eol) (esc) @@ -513,6 +516,7 @@ linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !) linking [<=>] 8\r (no-eol) (esc) (reposimplestore !) + linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) diff --git a/tests/test-clone.t b/tests/test-clone.t --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -104,7 +104,8 @@ linking: 15 (reposimplestore !) linking: 16 (reposimplestore !) linking: 17 (reposimplestore !) - linked 17 files (reposimplestore !) + linking: 18 (reposimplestore !) + linked 18 files (reposimplestore !) #else $ hg --debug clone -U . ../c --config progress.debug=true linking: 1 @@ -125,7 +126,8 @@ copying: 15 (reposimplestore !) copying: 16 (reposimplestore !) copying: 17 (reposimplestore !) - copied 17 files (reposimplestore !) + copying: 18 (reposimplestore !) + copied 18 files (reposimplestore !) #endif $ cd ../c diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py --- a/tests/simplestorerepo.py +++ b/tests/simplestorerepo.py @@ -405,6 +405,8 @@ return 0, 0 def add(self, text, meta, transaction, linkrev, p1, p2): +transaction.addbackup(self._indexpath) + if meta or text.startswith(b'\1\n'): text = filelog.packmeta(meta, text) To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3099: tests: disable test-static-http.t with simple store
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It /should/ be possible to support repos statically hosted on HTTP servers with alternate stores. But it's more trouble than it is worth right now. Let's just disable the test. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3099 AFFECTED FILES tests/test-static-http.t CHANGE DETAILS diff --git a/tests/test-static-http.t b/tests/test-static-http.t --- a/tests/test-static-http.t +++ b/tests/test-static-http.t @@ -1,4 +1,4 @@ -#require killdaemons +#require killdaemons no-reposimplestore $ hg clone http://localhost:$HGPORT/ copy abort: * (glob) To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3105: tests: require revlog store with test-repair-strip.t
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This test is doing a number of low-level things with revlogs. Mark it as requiring the revlog store. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3105 AFFECTED FILES tests/test-repair-strip.t CHANGE DETAILS diff --git a/tests/test-repair-strip.t b/tests/test-repair-strip.t --- a/tests/test-repair-strip.t +++ b/tests/test-repair-strip.t @@ -1,4 +1,4 @@ -#require unix-permissions no-root +#require unix-permissions no-root reporevlogstore $ cat > $TESTTMP/dumpjournal.py < import sys To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3103: tests: disable shallow narrow tests with simple store
indygreg created this revision. Herald added a reviewer: durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I think these are failing because of issues with flags processing in the simple store. Let's revisit this later. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3103 AFFECTED FILES tests/test-narrow-shallow-merges.t tests/test-narrow-shallow.t CHANGE DETAILS diff --git a/tests/test-narrow-shallow.t b/tests/test-narrow-shallow.t --- a/tests/test-narrow-shallow.t +++ b/tests/test-narrow-shallow.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + $ . "$TESTDIR/narrow-library.sh" $ hg init master diff --git a/tests/test-narrow-shallow-merges.t b/tests/test-narrow-shallow-merges.t --- a/tests/test-narrow-shallow-merges.t +++ b/tests/test-narrow-shallow-merges.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + $ . "$TESTDIR/narrow-library.sh" create full repo To: indygreg, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3097: verify: allow suppressing warnings about extra files
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The verifier issues warnings when the set of files in .hg/store doesn't align with the set of files that are advertised via repo.file(f).files() for all files seen in ctx.files() changelog traversal. This logic is reasonable for a default implementation. But some stores may have extra files whose presence is harmless. Or those stores may not have the same transaction rollback semantics that unlink files as other stores. This commit adds support for disabling the warning for orphaned files. The simple store extension has been taught to set this flag. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3097 AFFECTED FILES mercurial/verify.py tests/simplestorerepo.py CHANGE DETAILS diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py --- a/tests/simplestorerepo.py +++ b/tests/simplestorerepo.py @@ -35,6 +35,7 @@ pycompat, revlog, store, +verify, ) # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for @@ -656,9 +657,17 @@ return simplestore(path, vfstype) +def verifierinit(orig, self, *args, **kwargs): +orig(self, *args, **kwargs) + +# We don't care that files in the store don't align with what is +# advertised. So suppress these warnings. +self.warnorphanstorefiles = False + def extsetup(ui): localrepo.featuresetupfuncs.add(featuresetup) extensions.wrapfunction(localrepo, 'newreporequirements', newreporequirements) extensions.wrapfunction(store, 'store', makestore) +extensions.wrapfunction(verify.verifier, '__init__', verifierinit) diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -52,6 +52,7 @@ self.fncachewarned = False # developer config: verify.skipflags self.skipflags = repo.ui.configint('verify', 'skipflags') +self.warnorphanstorefiles = True def warn(self, msg): self.ui.warn(msg + "\n") @@ -294,8 +295,9 @@ if not dir and subdirnodes: ui.progress(_('checking'), None) -for f in sorted(storefiles): -self.warn(_("warning: orphan data file '%s'") % f) +if self.warnorphanstorefiles: +for f in sorted(storefiles): +self.warn(_("warning: orphan data file '%s'") % f) return filenodes @@ -369,8 +371,10 @@ try: storefiles.remove(ff) except KeyError: -self.warn(_(" warning: revlog '%s' not in fncache!") % ff) -self.fncachewarned = True +if self.warnorphanstorefiles: +self.warn(_(" warning: revlog '%s' not in fncache!") % + ff) +self.fncachewarned = True self.checklog(fl, f, lr) seen = {} @@ -481,7 +485,8 @@ short(node), f) ui.progress(_('checking'), None) -for f in sorted(storefiles): -self.warn(_("warning: orphan data file '%s'") % f) +if self.warnorphanstorefiles: +for f in sorted(storefiles): +self.warn(_("warning: orphan data file '%s'") % f) return len(files), revisions To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3101: tests: disable test-audit-path.t with simple store
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY The simple store is using a primitive filename encoding scheme. Many tests in this file fail. So let's disable it for now. At some point, we should support a mode where we can run tests without fnstore or dotencode and have all tests assuming use of these filename encoding mechanisms be conditional on their usage. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3101 AFFECTED FILES tests/test-audit-path.t CHANGE DETAILS diff --git a/tests/test-audit-path.t b/tests/test-audit-path.t --- a/tests/test-audit-path.t +++ b/tests/test-audit-path.t @@ -1,3 +1,7 @@ +The simple store doesn't escape paths robustly and can't store paths +with periods, etc. So much of this test fails with it. +#require no-reposimplestore + $ hg init audit of .hg To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3094: verify: drop "revlog" from warning message
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Not all stores may be backed by revlogs. Switch to a more generic error message. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3094 AFFECTED FILES mercurial/verify.py tests/test-repair-strip.t tests/test-treemanifest.t tests/test-verify.t CHANGE DETAILS diff --git a/tests/test-verify.t b/tests/test-verify.t --- a/tests/test-verify.t +++ b/tests/test-verify.t @@ -116,7 +116,7 @@ $ rm .hg/store/00changelog.* $ rm .hg/store/00manifest.* $ hg verify -q - warning: orphan revlog 'data/file.i' + warning: orphan data file 'data/file.i' 1 warnings encountered! $ cp -R .hg/store-full/. .hg/store @@ -296,7 +296,7 @@ crosschecking files in changesets and manifests checking files a@1: broken revlog! (index data/a.i is corrupted) - warning: orphan revlog 'data/a.i' + warning: orphan data file 'data/a.i' 1 files, 2 changesets, 0 total revisions 1 warnings encountered! 1 integrity errors encountered! diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t --- a/tests/test-treemanifest.t +++ b/tests/test-treemanifest.t @@ -599,12 +599,12 @@ b/@1: parent-directory manifest refers to unknown revision f065da70369e b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b b/@3: parent-directory manifest refers to unknown revision 367152e6af28 - warning: orphan revlog 'meta/b/bar/00manifest.i' - warning: orphan revlog 'meta/b/bar/orange/00manifest.i' - warning: orphan revlog 'meta/b/bar/orange/fly/00manifest.i' - warning: orphan revlog 'meta/b/foo/00manifest.i' - warning: orphan revlog 'meta/b/foo/apple/00manifest.i' - warning: orphan revlog 'meta/b/foo/apple/bees/00manifest.i' + warning: orphan data file 'meta/b/bar/00manifest.i' + warning: orphan data file 'meta/b/bar/orange/00manifest.i' + warning: orphan data file 'meta/b/bar/orange/fly/00manifest.i' + warning: orphan data file 'meta/b/foo/00manifest.i' + warning: orphan data file 'meta/b/foo/apple/00manifest.i' + warning: orphan data file 'meta/b/foo/apple/bees/00manifest.i' crosschecking files in changesets and manifests b/bar/fruits.txt@0: in changeset but not in manifest b/bar/orange/fly/gnat.py@0: in changeset but not in manifest diff --git a/tests/test-repair-strip.t b/tests/test-repair-strip.t --- a/tests/test-repair-strip.t +++ b/tests/test-repair-strip.t @@ -62,7 +62,7 @@ b@?: rev 1 points to nonexistent changeset 2 (expected 1) b@?: 736c29771fba not in manifests - warning: orphan revlog 'data/c.i' + warning: orphan data file 'data/c.i' 2 files, 2 changesets, 3 total revisions 2 warnings encountered! 2 integrity errors encountered! diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -295,7 +295,7 @@ if not dir and subdirnodes: ui.progress(_('checking'), None) for f in sorted(storefiles): -self.warn(_("warning: orphan revlog '%s'") % f) +self.warn(_("warning: orphan data file '%s'") % f) return filenodes @@ -482,6 +482,6 @@ ui.progress(_('checking'), None) for f in sorted(storefiles): -self.warn(_("warning: orphan revlog '%s'") % f) +self.warn(_("warning: orphan data file '%s'") % f) return len(files), revisions To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3102: tests: skip test-hgweb-bundle.t if we don't support bundlerepos
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3102 AFFECTED FILES tests/test-hgweb-bundle.t CHANGE DETAILS diff --git a/tests/test-hgweb-bundle.t b/tests/test-hgweb-bundle.t --- a/tests/test-hgweb-bundle.t +++ b/tests/test-hgweb-bundle.t @@ -1,4 +1,4 @@ -#require serve +#require serve repobundlerepo $ hg init server $ cd server To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3093: store: make file filtering during walk configurable
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Previously, the walking mechanism assumed the use of revlogs for storage. Making the file filter configurable will enable custom stores to override _walk() so it recognizes additional files. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3093 AFFECTED FILES mercurial/store.py CHANGE DETAILS diff --git a/mercurial/store.py b/mercurial/store.py --- a/mercurial/store.py +++ b/mercurial/store.py @@ -319,6 +319,9 @@ _data = ('data meta 00manifest.d 00manifest.i 00changelog.d 00changelog.i' ' phaseroots obsstore') +def isrevlog(f, kind, st): +return kind == stat.S_IFREG and f[-2:] in ('.i', '.d') + class basicstore(object): '''base class for local repository stores''' def __init__(self, path, vfstype): @@ -333,7 +336,7 @@ def join(self, f): return self.path + '/' + encodedir(f) -def _walk(self, relpath, recurse): +def _walk(self, relpath, recurse, filefilter=isrevlog): '''yields (unencoded, encoded, size)''' path = self.path if relpath: @@ -347,7 +350,7 @@ p = visit.pop() for f, kind, st in readdir(p, stat=True): fp = p + '/' + f -if kind == stat.S_IFREG and f[-2:] in ('.d', '.i'): +if filefilter(f, kind, st): n = util.pconvert(fp[striplen:]) l.append((decodedir(n), n, st.st_size)) elif kind == stat.S_IFDIR and recurse: To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3092: simplestore: shore up lookup errors
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY When revisions or nodes can't be resolved, we're expected to raise an error.LookupError. When I ported code from revlog.py, I failed to realize that "LookupError" in that module is aliased to error.LookupError. I thought we were using the builtin LookupError instead. This commit switches us to error.LookupError. It also fixes rev() to raise error.LookupError instead of KeyError. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3092 AFFECTED FILES tests/simplestorerepo.py CHANGE DETAILS diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py --- a/tests/simplestorerepo.py +++ b/tests/simplestorerepo.py @@ -152,8 +152,10 @@ def rev(self, node): validatenode(node) -# Will raise KeyError. -self._indexbynode[node] +try: +self._indexbynode[node] +except KeyError: +raise error.LookupError(node, self._indexpath, _('no node')) for rev, entry in self._indexbyrev.items(): if entry[b'node'] == node: @@ -171,11 +173,8 @@ return self.node(node) if len(node) == 20: -try: -self.rev(node) -return node -except LookupError: -pass +self.rev(node) +return node try: rev = int(node) @@ -196,10 +195,10 @@ rawnode = bin(node) self.rev(rawnode) return rawnode -except (TypeError, LookupError): +except TypeError: pass -raise LookupError(node, self._path, _('invalid lookup input')) +raise error.LookupError(node, self._path, _('invalid lookup input')) def linkrev(self, rev): validaterev(rev) @@ -280,8 +279,6 @@ if node == nullid: return b'' -self._indexbynode[node] - rev = self.rev(node) flags = self.flags(rev) To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3091: tests: extract dumprevlog tests to own file
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY And mark the test as requiring the revlog store. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3091 AFFECTED FILES tests/test-contrib-dumprevlog.t tests/test-contrib.t CHANGE DETAILS diff --git a/tests/test-contrib.t b/tests/test-contrib.t --- a/tests/test-contrib.t +++ b/tests/test-contrib.t @@ -2,108 +2,6 @@ $ CONTRIBDIR="$TESTDIR/../contrib" -Prepare repo-a: - - $ hg init repo-a - $ cd repo-a - - $ echo this is file a > a - $ hg add a - $ hg commit -m first - - $ echo adding to file a >> a - $ hg commit -m second - - $ echo adding more to file a >> a - $ hg commit -m third - - $ hg verify - checking changesets - checking manifests - crosschecking files in changesets and manifests - checking files - 1 files, 3 changesets, 3 total revisions - -Dumping revlog of file a to stdout: - - $ $PYTHON "$CONTRIBDIR/dumprevlog" .hg/store/data/a.i - file: .hg/store/data/a.i - node: 183d2312b35066fb6b3b449b84efc370d50993d0 - linkrev: 0 - parents: - length: 15 - -start- - this is file a - - -end- - node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b - linkrev: 1 - parents: 183d2312b35066fb6b3b449b84efc370d50993d0 - length: 32 - -start- - this is file a - adding to file a - - -end- - node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1 - linkrev: 2 - parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b - length: 54 - -start- - this is file a - adding to file a - adding more to file a - - -end- - -Dump all revlogs to file repo.dump: - - $ find .hg/store -name "*.i" | sort | xargs $PYTHON "$CONTRIBDIR/dumprevlog" > ../repo.dump - $ cd .. - -Undumping into repo-b: - - $ hg init repo-b - $ cd repo-b - $ $PYTHON "$CONTRIBDIR/undumprevlog" < ../repo.dump - .hg/store/00changelog.i - .hg/store/00manifest.i - .hg/store/data/a.i - $ cd .. - -Rebuild fncache with clone --pull: - - $ hg clone --pull -U repo-b repo-c - requesting all changes - adding changesets - adding manifests - adding file changes - added 3 changesets with 3 changes to 1 files - new changesets de1da620e7d8:46946d278c50 - -Verify: - - $ hg -R repo-c verify - checking changesets - checking manifests - crosschecking files in changesets and manifests - checking files - 1 files, 3 changesets, 3 total revisions - -Compare repos: - - $ hg -R repo-c incoming repo-a - comparing with repo-a - searching for changes - no changes found - [1] - - $ hg -R repo-a incoming repo-c - comparing with repo-c - searching for changes - no changes found - [1] - Test simplemerge command: $ cp "$CONTRIBDIR/simplemerge" . diff --git a/tests/test-contrib-dumprevlog.t b/tests/test-contrib-dumprevlog.t new file mode 100644 --- /dev/null +++ b/tests/test-contrib-dumprevlog.t @@ -0,0 +1,101 @@ +#require reporevlogstore + + $ CONTRIBDIR="$TESTDIR/../contrib" + + $ hg init repo-a + $ cd repo-a + + $ echo this is file a > a + $ hg add a + $ hg commit -m first + + $ echo adding to file a >> a + $ hg commit -m second + + $ echo adding more to file a >> a + $ hg commit -m third + $ hg verify + checking changesets + checking manifests + crosschecking files in changesets and manifests + checking files + 1 files, 3 changesets, 3 total revisions + +Dumping revlog of file a to stdout: + $ $PYTHON "$CONTRIBDIR/dumprevlog" .hg/store/data/a.i + file: .hg/store/data/a.i + node: 183d2312b35066fb6b3b449b84efc370d50993d0 + linkrev: 0 + parents: + length: 15 + -start- + this is file a + + -end- + node: b1047953b6e6b633c0d8197eaa5116fbdfd3095b + linkrev: 1 + parents: 183d2312b35066fb6b3b449b84efc370d50993d0 + length: 32 + -start- + this is file a + adding to file a + + -end- + node: 8c4fd1f7129b8cdec6c7f58bf48fb5237a4030c1 + linkrev: 2 + parents: b1047953b6e6b633c0d8197eaa5116fbdfd3095b + length: 54 + -start- + this is file a + adding to file a + adding more to file a + + -end- + +Dump all revlogs to file repo.dump: + + $ find .hg/store -name "*.i" | sort | xargs $PYTHON "$CONTRIBDIR/dumprevlog" > ../repo.dump + $ cd .. + +Undumping into repo-b: + + $ hg init repo-b + $ cd repo-b + $ $PYTHON "$CONTRIBDIR/undumprevlog" < ../repo.dump + .hg/store/00changelog.i + .hg/store/00manifest.i + .hg/store/data/a.i + $ cd .. + +Rebuild fncache with clone --pull: + + $ hg clone --pull -U repo-b repo-c + requesting all changes + adding changesets + adding manifests + adding file changes + added 3 changesets with 3 changes to 1 files + new changesets de1da620e7d8:46946d278c50 + +Verify:
D3090: tests: skip test-censor.t when using simple store
indygreg created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Censor assumes the use of revlogs. Proper censor support for non-revlog storage will require a better abstraction in the storage layer to remove data. Let's skip the censor tests until we have something in place. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3090 AFFECTED FILES tests/test-censor.t CHANGE DETAILS diff --git a/tests/test-censor.t b/tests/test-censor.t --- a/tests/test-censor.t +++ b/tests/test-censor.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + $ cat >> $HGRCPATH < [extensions] > censor= To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3084: heads: add support for specying branches by revset
This revision was automatically updated to reflect the committed changes. Closed by commit rHG924258526b12: heads: add support for specying branches by revset (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3084?vs=7658=7670 REVISION DETAIL https://phab.mercurial-scm.org/D3084 AFFECTED FILES mercurial/commands.py CHANGE DETAILS diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2648,7 +2648,8 @@ heads = [repo[h] for h in heads] if branchrevs: -branches = set(repo[br].branch() for br in branchrevs) +branches = set(repo[r].branch() + for r in scmutil.revrange(repo, branchrevs)) heads = [h for h in heads if h.branch() in branches] if opts.get('active') and branchrevs: To: martinvonz, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3078: revset: use revsymbol() for checking if a symbol is valid
This revision was automatically updated to reflect the committed changes. Closed by commit rHGe32dfff71529: revset: use revsymbol() for checking if a symbol is valid (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3078?vs=7652=7664 REVISION DETAIL https://phab.mercurial-scm.org/D3078 AFFECTED FILES mercurial/debugcommands.py mercurial/revset.py mercurial/scmutil.py tests/test-revset.t CHANGE DETAILS diff --git a/tests/test-revset.t b/tests/test-revset.t --- a/tests/test-revset.t +++ b/tests/test-revset.t @@ -54,7 +54,7 @@ > args = map(nodemod.bin, args) > expr = revsetlang.formatspec(fmt, list(args)) > if ui.verbose: - > tree = revsetlang.parse(expr, lookup=repo.__contains__) + > tree = revsetlang.parse(expr, lookup=revset.lookupfn(repo)) > ui.note(revsetlang.prettyformat(tree), b"\n") > if opts["optimize"]: > opttree = revsetlang.optimize(revsetlang.analyze(tree)) diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -433,6 +433,13 @@ hexfunc = short return '%d:%s' % (rev, hexfunc(node)) +def isrevsymbol(repo, symbol): +try: +revsymbol(repo, symbol) +return True +except error.RepoLookupError: +return False + def revsymbol(repo, symbol): """Returns a context given a single revision symbol (as string). diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2170,6 +2170,9 @@ # hook for extensions to execute code on the optimized tree pass +def lookupfn(repo): +return lambda symbol: scmutil.isrevsymbol(repo, symbol) + def match(ui, spec, repo=None): """Create a matcher for a single revision spec""" return matchany(ui, [spec], repo=repo) @@ -2189,7 +2192,7 @@ raise error.ParseError(_("empty query")) lookup = None if repo: -lookup = repo.__contains__ +lookup = lookupfn(repo) if len(specs) == 1: tree = revsetlang.parse(specs[0], lookup) else: diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -2210,7 +2210,7 @@ treebystage = {} printedtree = None -tree = revsetlang.parse(expr, lookup=repo.__contains__) +tree = revsetlang.parse(expr, lookup=revset.lookupfn(repo)) for n, f in stages: treebystage[n] = tree = f(tree) if n in showalways or (n in showchanged and tree != printedtree): To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3085: children: support specifying revision by revset
This revision was automatically updated to reflect the committed changes. Closed by commit rHG3c5331915f0b: children: support specifying revision by revset (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3085?vs=7659=7671 REVISION DETAIL https://phab.mercurial-scm.org/D3085 AFFECTED FILES hgext/children.py CHANGE DETAILS diff --git a/hgext/children.py b/hgext/children.py --- a/hgext/children.py +++ b/hgext/children.py @@ -22,6 +22,7 @@ logcmdutil, pycompat, registrar, +scmutil, ) templateopts = cmdutil.templateopts @@ -59,11 +60,11 @@ """ opts = pycompat.byteskwargs(opts) rev = opts.get('rev') +ctx = scmutil.revsingle(repo, rev) if file_: -fctx = repo.filectx(file_, changeid=rev) +fctx = repo.filectx(file_, changeid=ctx.rev()) childctxs = [fcctx.changectx() for fcctx in fctx.children()] else: -ctx = repo[rev] childctxs = ctx.children() displayer = logcmdutil.changesetdisplayer(ui, repo, opts) To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3080: localrepo: use revsymbol in lookupbranch() too
This revision was automatically updated to reflect the committed changes. Closed by commit rHG92171562c7f3: localrepo: use revsymbol in lookupbranch() too (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3080?vs=7654=7666 REVISION DETAIL https://phab.mercurial-scm.org/D3080 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 @@ -1023,7 +1023,7 @@ if key in self.branchmap(): return key -return self[key].branch() +return scmutil.revsymbol(self, key).branch() def known(self, nodes): cl = self.changelog To: martinvonz, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3083: perf: make perfmanifest and perfnodelookup work with revsets
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5bcd5859b505: perf: make perfmanifest and perfnodelookup work with revsets (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3083?vs=7657=7669 REVISION DETAIL https://phab.mercurial-scm.org/D3083 AFFECTED FILES contrib/perf.py CHANGE DETAILS diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -767,7 +767,7 @@ @command('perfchangeset', formatteropts) def perfchangeset(ui, repo, rev, **opts): timer, fm = gettimer(ui, opts) -n = repo[rev].node() +n = scmutil.revsingle(repo, rev).node() def d(): repo.changelog.read(n) #repo.changelog._cache = None @@ -853,7 +853,7 @@ timer, fm = gettimer(ui, opts) import mercurial.revlog mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg -n = repo[rev].node() +n = scmutil.revsingle(repo, rev).node() cl = mercurial.revlog.revlog(getsvfs(repo), "00changelog.i") def d(): cl.rev(n) To: martinvonz, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3082: context: use revsymbol() in "merge.preferancestor" code
This revision was automatically updated to reflect the committed changes. Closed by commit rHGa6014392837e: context: use revsymbol() in merge.preferancestor code (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3082?vs=7656=7668 REVISION DETAIL https://phab.mercurial-scm.org/D3082 AFFECTED FILES mercurial/context.py CHANGE DETAILS diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -631,7 +631,7 @@ # experimental config: merge.preferancestor for r in self._repo.ui.configlist('merge', 'preferancestor'): try: -ctx = changectx(self._repo, r) +ctx = scmutil.revsymbol(self._repo, r) except error.RepoLookupError: continue anc = ctx.node() To: martinvonz, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3081: wireproto: use repo.lookup() for lookup command
This revision was automatically updated to reflect the committed changes. Closed by commit rHGac666c5c2e0c: wireproto: use repo.lookup() for lookup command (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3081?vs=7655=7667 REVISION DETAIL https://phab.mercurial-scm.org/D3081 AFFECTED FILES mercurial/wireproto.py CHANGE DETAILS diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -1014,8 +1014,8 @@ def lookup(repo, proto, key): try: k = encoding.tolocal(key) -c = repo[k] -r = c.hex() +n = repo.lookup(k) +r = hex(n) success = 1 except Exception as inst: r = stringutil.forcebytestr(inst) To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3079: localrepo: drop "remote" argument from lookupbranch() (API)
This revision was automatically updated to reflect the committed changes. Closed by commit rHGfdd22bf6398f: localrepo: drop remote argument from lookupbranch() (API) (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3079?vs=7653=7665 REVISION DETAIL https://phab.mercurial-scm.org/D3079 AFFECTED FILES mercurial/localrepo.py mercurial/repository.py CHANGE DETAILS diff --git a/mercurial/repository.py b/mercurial/repository.py --- a/mercurial/repository.py +++ b/mercurial/repository.py @@ -446,7 +446,7 @@ def lookup(key): """Resolve the node for a revision.""" -def lookupbranch(key, remote=None): +def lookupbranch(key): """Look up the branch name of the given revision or branch name.""" def known(nodes): diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1019,13 +1019,11 @@ def lookup(self, key): return scmutil.revsymbol(self, key).node() -def lookupbranch(self, key, remote=None): -repo = remote or self -if key in repo.branchmap(): +def lookupbranch(self, key): +if key in self.branchmap(): return key -repo = (remote and remote.local()) and remote or self -return repo[key].branch() +return self[key].branch() def known(self, nodes): cl = self.changelog To: martinvonz, #hg-reviewers, indygreg Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3085: children: support specifying revision by revset
indygreg added a comment. It would be nice to have tests for these changes to ensure we don't regress... But progress is progress. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3085 To: martinvonz, #hg-reviewers Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3081: wireproto: use repo.lookup() for lookup command
indygreg accepted this revision. indygreg added a comment. This revision is now accepted and ready to land. The fact that this wasn't using `lookup()` is mind numbing. What the wire protocol command handlers should be doing in many cases is calling `repo.peer().()`. Now you can see how bad the wire protocol code is :/ REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3081 To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3078: revset: use revsymbol() for checking if a symbol is valid
indygreg accepted this revision. indygreg added a comment. This revision is now accepted and ready to land. I'm accepting this because it seems correct. But I'd really appreciate @yuya's review on this because I'm not sure if the change to `revset.matchany()` has unintended consequences. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3078 To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D1944: wireproto: provide accessors for client capabilities
indygreg requested changes to this revision. indygreg added a comment. This revision now requires changes to proceed. I'm OK with the general approach. But this requires a handful of changes before it can be accepted. For protocol version 2, I plan to send client capabilities as part of the command request. Now that we are using CBOR for command requests, it will be trivial to add client capabilities to the request. We will redundantly send capabilities as part of multiple requests. But since we can have an active compression context in use across command requests, the wire overhead will be negligible. So I'm not worried about the overhead. I care more about making server-side command handlers stateless, as that will make it easier to implement alternate servers. INLINE COMMENTS > wireprotocol.txt:391-393 > +If the server announces support for the ``protocaps`` capability, the client > +should issue a ``protocaps`` command after the initial handshake to annonunce > +its own capabilities. The client capabilities are persistent. This should be in the `SSH Version 1 Transport` section below, because I don't intent to carry this stateful feature forward to protocol version 2. Also, the new capability should be documented in the capabilities section in this document. > wireproto.py:845-847 > +if proto.name in (wireprototypes.SSHV1, wireprototypes.SSHV2): > +# Advertise support for the ssh-only protocaps command > +caps.append('protocaps') The protocol handler class in `wireprotoserver.py` now has an `addcapabilities()` that should be used for adding transport-specific capabilities. Please use it. > wireproto.py:1015 > > +@wireprotocommand('protocaps', 'caps', permission='pull') > +def protocaps(repo, proto, caps): Please define this as `transportpolicy=POLICY_V1_ONLY`. Also, please add documentation for the new command to `wireprotocol.txt`. > wireproto.py:1017-1018 > +def protocaps(repo, proto, caps): > +if proto.name in (wireprototypes.SSHV1, wireprototypes.SSHV2): > +repo._protocaps = set(caps.split(' ')) > +return bytesresponse('OK') The transport filtering isn't necessary if this is implemented differently. Yes, we could expose the command to HTTP. It shouldn't matter. Also, please set this on `proto` instead because it is the most appropriate place to define this. The protocol handler's lifetime is per connection for SSH and per-request for HTTP. The repository instance can outlive the HTTP request and the HTTP/SSH connection and it therefore isn't an appropriate place. > wireprotoserver.py:586 > self._args = args > +self._protocaps = None > Please remove this, as we won't carry this implementation forward to version 2. > wireprotoserver.py:603-606 > +if self._protocaps is None: > +value = decodevaluefromheaders(self._req, r'X-HgProto') > +self._protocaps = set(value.split(' ')) > +return self._protocaps And have this return an empty set for now. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D1944 To: joerg.sonnenberger, #hg-reviewers, indygreg Cc: indygreg, mharbison72, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3080: localrepo: use revsymbol in lookupbranch() too
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY lookupbranch() takes a string that comes from the CLI, so scmutil.revsymbol() is appropriate for looking it up. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3080 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 @@ -1023,7 +1023,7 @@ if key in self.branchmap(): return key -return self[key].branch() +return scmutil.revsymbol(self, key).branch() def known(self, nodes): cl = self.changelog 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
D3079: localrepo: drop "remote" argument from lookupbranch() (API)
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY According to `hg grep --all lookupbranch`, the "remote" argument has never been used ever since it was introduced in https://phab.mercurial-scm.org/rHGca739acf1a98f8c9ce889f798d0cd26344c6c3dd (commands: add more robust support for 'hg log -b' (issue2078), 2010-04-12). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3079 AFFECTED FILES mercurial/localrepo.py mercurial/repository.py CHANGE DETAILS diff --git a/mercurial/repository.py b/mercurial/repository.py --- a/mercurial/repository.py +++ b/mercurial/repository.py @@ -446,7 +446,7 @@ def lookup(key): """Resolve the node for a revision.""" -def lookupbranch(key, remote=None): +def lookupbranch(key): """Look up the branch name of the given revision or branch name.""" def known(nodes): diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -1019,13 +1019,11 @@ def lookup(self, key): return scmutil.revsymbol(self, key).node() -def lookupbranch(self, key, remote=None): -repo = remote or self -if key in repo.branchmap(): +def lookupbranch(self, key): +if key in self.branchmap(): return key -repo = (remote and remote.local()) and remote or self -return repo[key].branch() +return self[key].branch() def known(self, nodes): cl = self.changelog 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
D3087: bookmarks: calculateupdate() returns a bookmark, not a rev
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This changes the inaccurate/unclear documentation and also changes the code so "node" now contains a binary nodeid. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3087 AFFECTED FILES mercurial/bookmarks.py mercurial/destutil.py CHANGE DETAILS diff --git a/mercurial/destutil.py b/mercurial/destutil.py --- a/mercurial/destutil.py +++ b/mercurial/destutil.py @@ -55,10 +55,10 @@ def _destupdatebook(repo, clean): """decide on an update destination from active bookmark""" # we also move the active bookmark, if any -activemark = None -node, movemark = bookmarks.calculateupdate(repo.ui, repo, None) -if node is not None: -activemark = node +node = None +activemark, movemark = bookmarks.calculateupdate(repo.ui, repo, None) +if activemark is not None: +node = repo.lookup(activemark) return node, movemark, activemark def _destupdatebranch(repo, clean): diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -349,8 +349,8 @@ return heads def calculateupdate(ui, repo, checkout): -'''Return a tuple (targetrev, movemarkfrom) indicating the rev to -check out and where to move the active bookmark from, if needed.''' +'''Return a tuple (activemark, movemarkfrom) indicating the active bookmark +and where to move the active bookmark from, if needed.''' movemarkfrom = None if checkout is None: activemark = repo._activebookmark 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
D3081: wireproto: use repo.lookup() for lookup command
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I'm trying to reduce use of repo[] and this seems like an obvious place to use repo.lookup(). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3081 AFFECTED FILES mercurial/wireproto.py CHANGE DETAILS diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -1014,8 +1014,8 @@ def lookup(repo, proto, key): try: k = encoding.tolocal(key) -c = repo[k] -r = c.hex() +n = repo.lookup(k) +r = hex(n) success = 1 except Exception as inst: r = stringutil.forcebytestr(inst) 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
D3083: perf: make perfmanifest and perfnodelookup work with revsets
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY They were using repo[rev], which only works with a single symbol (e.g. "." or "my-bookmark"), not general revsets. Switch them to scmutil.revsingle() so they can also be used with e.g. ".^". I don't actually care about these commands, but I want to remove uses of repo[]. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3083 AFFECTED FILES contrib/perf.py CHANGE DETAILS diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -767,7 +767,7 @@ @command('perfchangeset', formatteropts) def perfchangeset(ui, repo, rev, **opts): timer, fm = gettimer(ui, opts) -n = repo[rev].node() +n = scmutil.revsingle(repo, rev).node() def d(): repo.changelog.read(n) #repo.changelog._cache = None @@ -853,7 +853,7 @@ timer, fm = gettimer(ui, opts) import mercurial.revlog mercurial.revlog._prereadsize = 2**24 # disable lazy parser in old hg -n = repo[rev].node() +n = scmutil.revsingle(repo, rev).node() cl = mercurial.revlog.revlog(getsvfs(repo), "00changelog.i") def d(): cl.rev(n) 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
D3082: context: use revsymbol() in "merge.preferancestor" code
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3082 AFFECTED FILES mercurial/context.py CHANGE DETAILS diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -631,7 +631,7 @@ # experimental config: merge.preferancestor for r in self._repo.ui.configlist('merge', 'preferancestor'): try: -ctx = changectx(self._repo, r) +ctx = scmutil.revsymbol(self._repo, r) except error.RepoLookupError: continue anc = ctx.node() 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
D3086: pull: pass rev to check out as integer to postincoming()
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I don't know if there's ever been a need for it to be a string (it's been like that since https://phab.mercurial-scm.org/rHG02f40b2ece3f1b607593a340fdd711919f4a8042 (commands: use rev from remote repo when updating as part of a pull, 2009-10-21)). I'm soon going to require it to be an integer, so let's fix this first. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3086 AFFECTED FILES mercurial/commands.py CHANGE DETAILS diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4034,7 +4034,7 @@ brev = None if checkout: -checkout = "%d" % repo.changelog.rev(checkout) +checkout = repo.changelog.rev(checkout) # order below depends on implementation of # hg.addbranchrevs(). opts['bookmark'] is ignored, 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
D3088: extdatasource: use repo.lookup() for converting to node
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY It's unclear what we want to support here. Perhaps it should just be nodeids? It doesn't make much sense to share revnums between repos, and bookmarks are probably too unstable. I used repo.lookup() to preserve the current behavior. We can change later if we want to. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3088 AFFECTED FILES mercurial/scmutil.py CHANGE DETAILS diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -1134,7 +1134,7 @@ k = encoding.tolocal(k) try: -data[repo[k].rev()] = encoding.tolocal(v) +data[revsingle(repo, k).rev()] = encoding.tolocal(v) except (error.LookupError, error.RepoLookupError): pass # we ignore data for nodes that don't exist locally finally: 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
D3085: children: support specifying revision by revset
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Same reason as the previous patch. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3085 AFFECTED FILES hgext/children.py CHANGE DETAILS diff --git a/hgext/children.py b/hgext/children.py --- a/hgext/children.py +++ b/hgext/children.py @@ -22,6 +22,7 @@ logcmdutil, pycompat, registrar, +scmutil, ) templateopts = cmdutil.templateopts @@ -59,11 +60,11 @@ """ opts = pycompat.byteskwargs(opts) rev = opts.get('rev') +ctx = scmutil.revsingle(repo, rev) if file_: -fctx = repo.filectx(file_, changeid=rev) +fctx = repo.filectx(file_, changeid=ctx.rev()) childctxs = [fcctx.changectx() for fcctx in fctx.children()] else: -ctx = repo[rev] childctxs = ctx.children() displayer = logcmdutil.changesetdisplayer(ui, repo, opts) 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
mercurial@37285: 99 new changesets
99 new changesets in mercurial: https://www.mercurial-scm.org/repo/hg/rev/03ff17a4bf53 changeset: 37187:03ff17a4bf53 user:Pulkit Goyal <7895pul...@gmail.com> date:Fri Feb 09 13:39:15 2018 +0530 summary: infinitepush: move the extension to core from fb-hgext https://www.mercurial-scm.org/repo/hg/rev/de4c2f3af97f changeset: 37188:de4c2f3af97f user:Pulkit Goyal <7895pul...@gmail.com> date:Sat Feb 03 17:54:55 2018 +0530 summary: infinitepush: remove backupcommands.py https://www.mercurial-scm.org/repo/hg/rev/b377b7dfe682 changeset: 37189:b377b7dfe682 user:Pulkit Goyal <7895pul...@gmail.com> date:Sat Feb 03 17:59:49 2018 +0530 summary: infinitepush: drop the logic related to inhibit extension https://www.mercurial-scm.org/repo/hg/rev/ecdd8c3044de changeset: 37190:ecdd8c3044de user:Pulkit Goyal <7895pul...@gmail.com> date:Thu Feb 08 17:09:24 2018 +0530 summary: infinitepush: delete the hack to load the extension after remotenames https://www.mercurial-scm.org/repo/hg/rev/2fdc827f76ec changeset: 37191:2fdc827f76ec user:Pulkit Goyal <7895pul...@gmail.com> date:Thu Feb 08 17:12:53 2018 +0530 summary: infinitepush: delete the bundle2 part ordering related to pushrebase https://www.mercurial-scm.org/repo/hg/rev/e702ca152b33 changeset: 37192:e702ca152b33 user:Pulkit Goyal <7895pul...@gmail.com> date:Thu Feb 08 17:18:28 2018 +0530 summary: infinitepush: remove wrapping around bundle2._addpartsfromopts() https://www.mercurial-scm.org/repo/hg/rev/5a9692d0d6fc changeset: 37193:5a9692d0d6fc user:Pulkit Goyal <7895pul...@gmail.com> date:Thu Feb 08 17:27:47 2018 +0530 summary: infinitepush: drop the scratchbookmarksparttype bundle2 part https://www.mercurial-scm.org/repo/hg/rev/320b1f95f676 changeset: 37194:320b1f95f676 user:Pulkit Goyal <7895pul...@gmail.com> date:Fri Feb 09 13:36:50 2018 +0530 summary: infinitepush: drop `--list-remote`, `--remote-path` flags to bookmark cmd https://www.mercurial-scm.org/repo/hg/rev/3be6f435db4f changeset: 37195:3be6f435db4f user:Pulkit Goyal <7895pul...@gmail.com> date:Fri Feb 09 13:50:16 2018 +0530 summary: infinitepush: drop error handling while pushing to svn server https://www.mercurial-scm.org/repo/hg/rev/14acab54e08b changeset: 37196:14acab54e08b user:Pulkit Goyal <7895pul...@gmail.com> date:Fri Feb 09 13:56:09 2018 +0530 summary: infinitepush: drop hack related to --to, --create flags of remotenames-ext https://www.mercurial-scm.org/repo/hg/rev/7fa00a6f8180 changeset: 37197:7fa00a6f8180 user:Pulkit Goyal <7895pul...@gmail.com> date:Fri Feb 09 14:02:03 2018 +0530 summary: infinitepush: drop logic related to treemanifest extension https://www.mercurial-scm.org/repo/hg/rev/78c2e9418278 changeset: 37198:78c2e9418278 user:Pulkit Goyal <7895pul...@gmail.com> date:Fri Feb 09 14:16:03 2018 +0530 summary: infinitepush: drop the `--create` flag to push command https://www.mercurial-scm.org/repo/hg/rev/c5687ce3b411 changeset: 37199:c5687ce3b411 user:Pulkit Goyal <7895pul...@gmail.com> date:Fri Feb 09 15:49:46 2018 +0530 summary: infinitepush: drop the `--to` flag to push and use `-B` instead https://www.mercurial-scm.org/repo/hg/rev/8b5d7ef81066 changeset: 37200:8b5d7ef81066 user:Pulkit Goyal <7895pul...@gmail.com> date:Tue Mar 27 18:04:05 2018 +0530 summary: infinitepush: delete infinitepush.fillmetadatabranchpattern config option https://www.mercurial-scm.org/repo/hg/rev/aa015dd92591 changeset: 37201:aa015dd92591 user:Pulkit Goyal <7895pul...@gmail.com> date:Fri Mar 30 12:49:50 2018 -0700 summary: infinitepush: delete infinitepushcommands.py and related tests https://www.mercurial-scm.org/repo/hg/rev/95cc57a74363 changeset: 37202:95cc57a74363 user:Pulkit Goyal <7895pul...@gmail.com> date:Wed Mar 21 19:23:10 2018 +0530 summary: infinitepush: drop the wrapping of update command on client side https://www.mercurial-scm.org/repo/hg/rev/f083e7fd6313 changeset: 37203:f083e7fd6313 user:Pulkit Goyal <7895pul...@gmail.com> date:Fri Mar 30 12:50:06 2018 -0700 summary: infinitepush: delete the non-forward-move flag for hg push https://www.mercurial-scm.org/repo/hg/rev/0d6c12668691 changeset: 37204:0d6c12668691 user:Pulkit Goyal <7895pul...@gmail.com> date:Tue Mar 27 14:15:42 2018 +0530 summary: inifnitepush: use utils.{stringutil|procutil}.* instead of util.* https://www.mercurial-scm.org/repo/hg/rev/e5cd0ef5c362 changeset: 37205:e5cd0ef5c362 user:Pulkit Goyal <7895pul...@gmail.com> date:Tue Mar 27 17:19:02 2018 +0530 summary: infinitepush: don't wrap bundle2.processparts while calling `hg unbundle` https://www.mercurial-scm.org/repo/hg/rev/571f25dae740 changeset:
[PATCH 1 of 2] copies: create and use _loose_next function for _related
# HG changeset patch # User Gábor Stefanik# Date 1522848489 -7200 # Wed Apr 04 15:28:09 2018 +0200 # Node ID d72ca973100a1f1a4451a7d1efdc3e43ebc2912e # Parent 656ac240f39284eec4435d25c01d71056aa4e8a5 copies: create and use _loose_next function for _related _loose_next is going to be a variant of the next function that tries to follow grafts and similar relationship when the regular next raises StopIteration. This is needed for bug 5834. diff -r 656ac240f392 -r d72ca973100a mercurial/copies.py --- a/mercurial/copies.py Sat Mar 24 01:30:50 2018 -0400 +++ b/mercurial/copies.py Wed Apr 04 15:28:09 2018 +0200 @@ -731,6 +731,12 @@ return copies, {}, {}, {}, {} +def _loose_next(g): +try: +return next(g), g +except StopIteration: +raise + def _related(f1, f2, limit): """return True if f1 and f2 filectx have a common ancestor @@ -748,16 +754,16 @@ f1r, f2r = f1.linkrev(), f2.linkrev() if f1r is None: -f1 = next(g1) +f1, g1 = _loose_next(g1) if f2r is None: -f2 = next(g2) +f1, g1 = _loose_next(g1) while True: f1r, f2r = f1.linkrev(), f2.linkrev() if f1r > f2r: -f1 = next(g1) +f1, g1 = _loose_next(g1) elif f2r > f1r: -f2 = next(g2) +f1, g1 = _loose_next(g1) elif f1 == f2: return f1 # a match elif f1r == f2r or f1r < limit or f2r < limit: This message, including its attachments, is confidential and the property of NNG Llc. For more information please read NNG's email policy here: https://www.nng.com/email-policy/ By responding to this email you accept the email policy. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[Bug 5835] New: hg tag --remove does not actually remove the tag when there is a conflict with closed heads
https://bz.mercurial-scm.org/show_bug.cgi?id=5835 Bug ID: 5835 Summary: hg tag --remove does not actually remove the tag when there is a conflict with closed heads Product: Mercurial Version: unspecified Hardware: PC OS: Mac OS Status: UNCONFIRMED Severity: feature Priority: wish Component: Mercurial Assignee: bugzi...@mercurial-scm.org Reporter: s...@farley.io CC: mercurial-devel@mercurial-scm.org Imagine a repo with only a few open branches (but more importantly) many closed branches that have never been merged. There is a corner case (working on a proof-of-concept repo to reproduce but leaving this here for now) where removing the tag (even on every open head) does not actually remove the tag. The problem seems to be how we resolve the 'tag merge' in the case of conflicts. In this particular case, I would think closed heads are weighted less than, say, default or other open heads. There is a possibility that there is a minor bug in the pseudo-merge code but I will need to investigate more. -- 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
D3039: tests: conditionalize tests based on presence of custom extensions
This revision was automatically updated to reflect the committed changes. Closed by commit rHG4e6a6d0dccee: tests: conditionalize tests based on presence of custom extensions (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3039?vs=7643=7644 REVISION DETAIL https://phab.mercurial-scm.org/D3039 AFFECTED FILES tests/helpers-testrepo.sh tests/hghave.py tests/run-tests.py tests/test-basic.t tests/test-debugextensions.t tests/test-extension.t tests/test-globalopts.t tests/test-help.t CHANGE DETAILS diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -44,6 +44,10 @@ summary summarize working directory state updateupdate working directory (or switch revisions) +Extra extensions will be printed in help output in a non-reliable order since +the extension is unknown. +#if no-extraextensions + $ hg help Mercurial Distributed SCM @@ -283,6 +287,8 @@ win32mbcs allow the use of MBCS paths with problematic encodings zeroconf discover and advertise repositories on the local network +#endif + Verify that deprecated extensions are included if --verbose: $ hg -v help extensions | grep children @@ -816,6 +822,8 @@ Test that default list of commands omits extension commands +#if no-extraextensions + $ hg help Mercurial Distributed SCM @@ -903,6 +911,7 @@ (use 'hg help -v' to show built-in aliases and global options) +#endif Test list of internal help commands diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t --- a/tests/test-globalopts.t +++ b/tests/test-globalopts.t @@ -289,6 +289,8 @@ Testing -h/--help: +#if no-extraextensions + $ hg -h Mercurial Distributed SCM @@ -372,8 +374,6 @@ (use 'hg help -v' to show built-in aliases and global options) - - $ hg --help Mercurial Distributed SCM @@ -457,5 +457,7 @@ (use 'hg help -v' to show built-in aliases and global options) +#endif + Not tested: --debugger diff --git a/tests/test-extension.t b/tests/test-extension.t --- a/tests/test-extension.t +++ b/tests/test-extension.t @@ -867,9 +867,11 @@ Show extensions: (note that mq force load strip, also checking it's not loaded twice) +#if no-extraextensions $ hg debugextensions mq strip +#endif For extensions, which name matches one of its commands, help message should ask '-v -e' to get list of built-in aliases diff --git a/tests/test-debugextensions.t b/tests/test-debugextensions.t --- a/tests/test-debugextensions.t +++ b/tests/test-debugextensions.t @@ -1,4 +1,6 @@ +#if no-extraextensions $ hg debugextensions +#endif $ debugpath=`pwd`/extwithoutinfos.py @@ -19,6 +21,10 @@ > ext2 = `pwd`/extwithinfos.py > EOF + $ for extension in $HGTESTEXTRAEXTENSIONS; do + > echo "$extension=!" >> $HGRCPATH + > done + $ hg debugextensions ext1 (untested!) ext2 (3.2.1!) diff --git a/tests/test-basic.t b/tests/test-basic.t --- a/tests/test-basic.t +++ b/tests/test-basic.t @@ -1,5 +1,6 @@ Create a repository: +#if no-extraextensions $ hg config devel.all-warnings=true devel.default-date=0 0 @@ -13,6 +14,8 @@ web.address=localhost web\.ipv6=(?:True|False) (re) web.server-header=testing stub value +#endif + $ hg init t $ cd t diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1070,6 +1070,17 @@ env["HGENCODINGMODE"] = "strict" env['HGIPV6'] = str(int(self._useipv6)) +extraextensions = [] +for opt in self._extraconfigopts: +section, key = opt.encode('utf-8').split(b'.', 1) +if section != 'extensions': +continue +name = key.split(b'=', 1)[0] +extraextensions.append(name) + +if extraextensions: +env['HGTESTEXTRAEXTENSIONS'] = b' '.join(extraextensions) + # LOCALIP could be ::1 or 127.0.0.1. Useful for tests that require raw # IP addresses. env['LOCALIP'] = self._localip() diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -718,6 +718,10 @@ except (ImportError, AttributeError): return False +@check('extraextensions', 'whether tests are running with extra extensions') +def has_extraextensions(): +return 'HGTESTEXTRAEXTENSIONS' in os.environ + def getrepofeatures(): """Obtain set of repository features in use. diff --git a/tests/helpers-testrepo.sh b/tests/helpers-testrepo.sh --- a/tests/helpers-testrepo.sh +++ b/tests/helpers-testrepo.sh @@ -9,6 +9,13 @@ # The mercurial source repository was typically orignally cloned with the # system mercurial installation, and may require extensions or settings from # the system installation. + +if [ -n $HGTESTEXTRAEXTENSIONS ]; then +for extension in
D3064: tests: disable tests for advanced clone features with simple store
This revision was automatically updated to reflect the committed changes. Closed by commit rHG36b2a304216c: tests: disable tests for advanced clone features with simple store (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3064?vs=7607=7651 REVISION DETAIL https://phab.mercurial-scm.org/D3064 AFFECTED FILES tests/test-clone-uncompressed.t tests/test-clonebundles.t tests/test-http-bundle1.t tests/test-http.t tests/test-ssh-bundle1.t tests/test-ssh.t tests/test-stream-bundle-v2.t CHANGE DETAILS diff --git a/tests/test-stream-bundle-v2.t b/tests/test-stream-bundle-v2.t --- a/tests/test-stream-bundle-v2.t +++ b/tests/test-stream-bundle-v2.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + Test creating a consuming stream bundle v2 $ getmainid() { diff --git a/tests/test-ssh.t b/tests/test-ssh.t --- a/tests/test-ssh.t +++ b/tests/test-ssh.t @@ -56,6 +56,8 @@ clone remote via stream +#if no-reposimplestore + $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --stream ssh://user@dummy/remote local-stream streaming all changes 4 files to transfer, 602 bytes of data @@ -92,6 +94,8 @@ $ cd .. $ rm -rf local-stream stream2 +#endif + clone remote via pull $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local @@ -530,9 +534,9 @@ Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio - Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio - Got arguments 1:user@dummy 2:hg -R remote serve --stdio - Got arguments 1:user@dummy 2:hg -R remote serve --stdio + Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !) + Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !) + Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !) Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R local serve --stdio diff --git a/tests/test-ssh-bundle1.t b/tests/test-ssh-bundle1.t --- a/tests/test-ssh-bundle1.t +++ b/tests/test-ssh-bundle1.t @@ -66,6 +66,8 @@ clone remote via stream +#if no-reposimplestore + $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" --stream ssh://user@dummy/remote local-stream streaming all changes 4 files to transfer, 602 bytes of data @@ -102,6 +104,8 @@ $ cd .. $ rm -rf local-stream stream2 +#endif + clone remote via pull $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote local @@ -499,9 +503,9 @@ Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio - Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio - Got arguments 1:user@dummy 2:hg -R remote serve --stdio - Got arguments 1:user@dummy 2:hg -R remote serve --stdio + Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !) + Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !) + Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !) Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio Got arguments 1:user@dummy 2:hg -R remote serve --stdio Got arguments 1:user@dummy 2:hg -R local serve --stdio diff --git a/tests/test-http.t b/tests/test-http.t --- a/tests/test-http.t +++ b/tests/test-http.t @@ -26,6 +26,7 @@ clone via stream +#if no-reposimplestore $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1 streaming all changes 6 files to transfer, 606 bytes of data @@ -40,6 +41,7 @@ crosschecking files in changesets and manifests checking files 4 files, 1 changesets, 4 total revisions +#endif try to clone via stream, should use pull instead @@ -213,14 +215,18 @@ 5fed3813f7f5 $ hg id http://user@localhost:$HGPORT2/ 5fed3813f7f5 + +#if no-reposimplestore $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1 streaming all changes 7 files to transfer, 916 bytes of data transferred * bytes in * seconds (*/sec) (glob) searching for changes no changes found updating to branch default 5 files updated, 0 files merged, 0 files removed, 0 files unresolved +#endif + --pull should override server's preferuncompressed $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1 requesting all changes @@ -239,16 +245,16 @@ abort: HTTP Error 403: no [255] - $ hg -R dest tag -r tip top - $ hg -R dest push http://user:pass@localhost:$HGPORT2/ + $ hg -R dest-pull tag -r tip top + $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ pushing to http://user:***@localhost:$HGPORT2/
D3063: tests: skip largefiles and lfs tests when using simple store
This revision was automatically updated to reflect the committed changes. Closed by commit rHGf4e84dfc06fd: tests: skip largefiles and lfs tests when using simple store (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3063?vs=7606=7650 REVISION DETAIL https://phab.mercurial-scm.org/D3063 AFFECTED FILES tests/test-largefiles-cache.t tests/test-largefiles-misc.t tests/test-largefiles-small-disk.t tests/test-largefiles-update.t tests/test-largefiles-wireproto.t tests/test-largefiles.t tests/test-lfconvert.t tests/test-lfs-bundle.t tests/test-lfs-largefiles.t tests/test-lfs-serve-access.t tests/test-lfs-serve.t tests/test-lfs-test-server.t tests/test-lfs.t CHANGE DETAILS diff --git a/tests/test-lfs.t b/tests/test-lfs.t --- a/tests/test-lfs.t +++ b/tests/test-lfs.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + # Initial setup $ cat >> $HGRCPATH << EOF diff --git a/tests/test-lfs-test-server.t b/tests/test-lfs-test-server.t --- a/tests/test-lfs-test-server.t +++ b/tests/test-lfs-test-server.t @@ -1,3 +1,4 @@ +#require no-reposimplestore #testcases git-server hg-server #if git-server diff --git a/tests/test-lfs-serve.t b/tests/test-lfs-serve.t --- a/tests/test-lfs-serve.t +++ b/tests/test-lfs-serve.t @@ -1,5 +1,5 @@ #testcases lfsremote-on lfsremote-off -#require serve +#require serve no-reposimplestore This test splits `hg serve` with and without using the extension into separate tests cases. The tests are broken down as follows, where "LFS"/"No-LFS" diff --git a/tests/test-lfs-serve-access.t b/tests/test-lfs-serve-access.t --- a/tests/test-lfs-serve-access.t +++ b/tests/test-lfs-serve-access.t @@ -1,4 +1,4 @@ -#require serve +#require serve no-reposimplestore $ cat >> $HGRCPATH < [extensions] diff --git a/tests/test-lfs-largefiles.t b/tests/test-lfs-largefiles.t --- a/tests/test-lfs-largefiles.t +++ b/tests/test-lfs-largefiles.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + This tests the interaction between the largefiles and lfs extensions, and conversion from largefiles -> lfs. diff --git a/tests/test-lfs-bundle.t b/tests/test-lfs-bundle.t --- a/tests/test-lfs-bundle.t +++ b/tests/test-lfs-bundle.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + In this test, we want to test LFS bundle application on both LFS and non-LFS repos. diff --git a/tests/test-lfconvert.t b/tests/test-lfconvert.t --- a/tests/test-lfconvert.t +++ b/tests/test-lfconvert.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + $ USERCACHE="$TESTTMP/cache"; export USERCACHE $ mkdir "${USERCACHE}" $ cat >> $HGRCPATH < criple.py
D3061: tests: conditionalize test output for simple store
This revision was automatically updated to reflect the committed changes. Closed by commit rHGe82a59bfc5e8: tests: conditionalize test output for simple store (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3061?vs=7604=7649 REVISION DETAIL https://phab.mercurial-scm.org/D3061 AFFECTED FILES tests/test-clone.t tests/test-convert-hg-source.t tests/test-narrow.t CHANGE DETAILS diff --git a/tests/test-narrow.t b/tests/test-narrow.t --- a/tests/test-narrow.t +++ b/tests/test-narrow.t @@ -127,8 +127,12 @@ The following changeset(s) or their ancestors have local changes not on the remote: * (glob) saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob) - deleting data/d0/f.i + deleting data/d0/f.i (reporevlogstore !) + deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !) + deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !) + deleting data/d0/f/index (reposimplestore !) deleting meta/d0/00manifest.i (tree !) + $ hg log -T "{node|short}: {desc} {outsidenarrow}\n" *: local change to d3 (glob) *: add d10/f outsidenarrow (glob) @@ -154,8 +158,12 @@ searching for changes looking for local changes to affected paths saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob) - deleting data/d0/f.i + deleting data/d0/f.i (reporevlogstore !) + deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !) + deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !) + deleting data/d0/f/index (reposimplestore !) deleting meta/d0/00manifest.i (tree !) + Updates off of stripped commit if necessary $ hg co -r 'desc("local change to d3")' -q $ echo local change >> d6/f @@ -169,7 +177,10 @@ * (glob) 2 files updated, 0 files merged, 0 files removed, 0 files unresolved saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob) - deleting data/d3/f.i + deleting data/d3/f.i (reporevlogstore !) + deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !) + deleting data/d3/f/99fa7136105a15e2045ce3d9152e4837c5349e4d (reposimplestore !) + deleting data/d3/f/index (reposimplestore !) deleting meta/d3/00manifest.i (tree !) $ hg log -T '{desc}\n' -r . add d10/f @@ -189,7 +200,10 @@ * (glob) 0 files updated, 0 files merged, 1 files removed, 0 files unresolved saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob) - deleting data/d3/f.i + deleting data/d3/f.i (reporevlogstore !) + deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !) + deleting data/d3/f/5ce0767945cbdbca3b924bb9fbf5143f72ab40ac (reposimplestore !) + deleting data/d3/f/index (reposimplestore !) deleting meta/d3/00manifest.i (tree !) $ hg id @@ -209,7 +223,9 @@ comparing with ssh://user@dummy/master searching for changes looking for local changes to affected paths - deleting data/d0/f.i + deleting data/d0/f.i (reporevlogstore !) + deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !) + deleting data/d0/f/index (reposimplestore !) deleting meta/d0/00manifest.i (tree !) $ hg tracked $ hg files @@ -265,7 +281,9 @@ comparing with ssh://user@dummy/master searching for changes looking for local changes to affected paths - deleting data/d6/f.i + deleting data/d6/f.i (reporevlogstore !) + deleting data/d6/f/7339d30678f451ac8c3f38753beeb4cf2e1655c7 (reposimplestore !) + deleting data/d6/f/index (reposimplestore !) deleting meta/d6/00manifest.i (tree !) $ hg tracked I path:d0 @@ -285,7 +303,7 @@ comparing with ssh://user@dummy/master searching for changes looking for local changes to affected paths - deleting data/d3/f.i + deleting data/d3/f.i (reporevlogstore !) $ hg tracked I path:d0 I path:d3 @@ -303,7 +321,7 @@ comparing with ssh://user@dummy/master searching for changes looking for local changes to affected paths - deleting data/d0/f.i + deleting data/d0/f.i (reporevlogstore !) deleting meta/d0/00manifest.i (tree !) $ hg tracked I path:d3 diff --git a/tests/test-convert-hg-source.t b/tests/test-convert-hg-source.t --- a/tests/test-convert-hg-source.t +++ b/tests/test-convert-hg-source.t @@ -169,7 +169,12 @@ break it +#if reporevlogstore $ rm .hg/store/data/b.* +#endif +#if reposimplestore + $ rm .hg/store/data/b/* +#endif $ cd .. $ hg --config convert.hg.ignoreerrors=True convert broken fixed initializing destination fixed repository diff --git a/tests/test-clone.t b/tests/test-clone.t --- a/tests/test-clone.t +++ b/tests/test-clone.t @@ -94,7 +94,18 @@ linking: 6 linking: 7 linking: 8 - linked 8 files + linked 8 files (reporevlogstore !) + linking: 9
D3060: tests: disallow using simple store repo with bundlerepo
This revision was automatically updated to reflect the committed changes. Closed by commit rHG45a4799174a1: tests: disallow using simple store repo with bundlerepo (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3060?vs=7635=7648 REVISION DETAIL https://phab.mercurial-scm.org/D3060 AFFECTED FILES tests/hghave.py tests/simplestorerepo.py tests/test-manifest.t tests/test-mq-pull-from-bundle.t tests/test-narrow-strip.t tests/test-obsolete.t tests/test-shelve.t tests/test-treemanifest.t CHANGE DETAILS diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t --- a/tests/test-treemanifest.t +++ b/tests/test-treemanifest.t @@ -325,6 +325,8 @@ rev linkrev nodeid p1 p2 0 4 064927a0648a 1 5 25ecb8cb8618 + +#if repobundlerepo $ hg incoming .hg/strip-backup/* comparing with .hg/strip-backup/*-backup.hg (glob) searching for changes @@ -334,6 +336,8 @@ date:Thu Jan 01 00:00:00 1970 + summary: modify dir1/a +#endif + $ hg unbundle .hg/strip-backup/* adding changesets adding manifests diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -771,10 +771,12 @@ $ hg shelve shelved as default 0 files updated, 0 files merged, 1 files removed, 0 files unresolved +#if repobundlerepo $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()' o 4 changes to: commit stuff shelve@localhost | ~ +#endif $ hg log -G --template '{rev} {desc|firstline} {author}' @ 3 commit stuff test | diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -1244,6 +1244,7 @@ o 0:4b34ecfb0d56 (draft) [ ] A +#if repobundlerepo $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg comparing with ../repo-bundleoverlay searching for changes @@ -1256,6 +1257,7 @@ |/ o 0:4b34ecfb0d56 (draft) [ ] A +#endif #if serve diff --git a/tests/test-narrow-strip.t b/tests/test-narrow-strip.t --- a/tests/test-narrow-strip.t +++ b/tests/test-narrow-strip.t @@ -130,6 +130,8 @@ $ hg strip 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) + +#if repobundlerepo $ hg incoming .hg/strip-backup/*-backup.hg comparing with .hg/strip-backup/*-backup.hg (glob) changeset: 0:* (glob) @@ -161,3 +163,4 @@ added 3 changesets with 2 changes to 1 files (+1 heads) new changesets *:* (glob) (run 'hg heads' to see heads, 'hg merge' to merge) +#endif diff --git a/tests/test-mq-pull-from-bundle.t b/tests/test-mq-pull-from-bundle.t --- a/tests/test-mq-pull-from-bundle.t +++ b/tests/test-mq-pull-from-bundle.t @@ -1,3 +1,5 @@ +#require repobundlerepo + $ cat <> $HGRCPATH > [extensions] > mq= diff --git a/tests/test-manifest.t b/tests/test-manifest.t --- a/tests/test-manifest.t +++ b/tests/test-manifest.t @@ -1,3 +1,5 @@ +#require repobundlerepo + Source bundle was generated with the following script: # hg init diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py --- a/tests/simplestorerepo.py +++ b/tests/simplestorerepo.py @@ -24,6 +24,7 @@ ) from mercurial import ( ancestor, +bundlerepo, error, filelog, mdiff, @@ -587,6 +588,9 @@ if not repo.local(): return +if isinstance(repo, bundlerepo.bundlerepository): +raise error.Abort(_('cannot use simple store with bundlerepo')) + class simplestorerepo(repo.__class__): def file(self, f): return filestorage(self.svfs, f) diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -731,12 +731,13 @@ """ # Default list provided by core. features = { +'bundlerepo', 'revlogstore', } # Features that imply other features. implies = { -'simplestore': ['-revlogstore'], +'simplestore': ['-revlogstore', '-bundlerepo'], } for override in os.environ.get('HGREPOFEATURES', '').split(' '): @@ -765,3 +766,7 @@ @check('reposimplestore', 'repository using simple storage extension') def has_reposimplestore(): return 'simplestore' in getrepofeatures() + +@check('repobundlerepo', 'whether we can open bundle files as repos') +def has_repobundlerepo(): +return 'bundlerepo' in getrepofeatures() To: indygreg, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3056: tests: disable test-revlog-v2 when using simple store
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb09a25d74592: tests: disable test-revlog-v2 when using simple store (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3056?vs=7632=7647 REVISION DETAIL https://phab.mercurial-scm.org/D3056 AFFECTED FILES tests/test-revlog-v2.t CHANGE DETAILS diff --git a/tests/test-revlog-v2.t b/tests/test-revlog-v2.t --- a/tests/test-revlog-v2.t +++ b/tests/test-revlog-v2.t @@ -1,3 +1,5 @@ +#require reporevlogstore + A repo with unknown revlogv2 requirement string cannot be opened $ hg init invalidreq To: indygreg, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3040: tests: skip some tests when using simple store
This revision was automatically updated to reflect the committed changes. Closed by commit rHG0611c954da90: tests: skip some tests when using simple store (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3040?vs=7566=7645 REVISION DETAIL https://phab.mercurial-scm.org/D3040 AFFECTED FILES tests/test-generaldelta.t tests/test-unionrepo.t CHANGE DETAILS diff --git a/tests/test-unionrepo.t b/tests/test-unionrepo.t --- a/tests/test-unionrepo.t +++ b/tests/test-unionrepo.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + Test unionrepo functionality Create one repository diff --git a/tests/test-generaldelta.t b/tests/test-generaldelta.t --- a/tests/test-generaldelta.t +++ b/tests/test-generaldelta.t @@ -1,3 +1,5 @@ +#require no-reposimplestore + Check whether size of generaldelta revlog is not bigger than its regular equivalent. Test would fail if generaldelta was naive implementation of parentdelta: third manifest revision would be fully To: indygreg, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3039: tests: conditionalize tests based on presence of custom extensions
indygreg updated this revision to Diff 7643. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3039?vs=7597=7643 REVISION DETAIL https://phab.mercurial-scm.org/D3039 AFFECTED FILES tests/helpers-testrepo.sh tests/hghave.py tests/run-tests.py tests/test-basic.t tests/test-debugextensions.t tests/test-extension.t tests/test-globalopts.t tests/test-help.t CHANGE DETAILS diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -44,6 +44,10 @@ summary summarize working directory state updateupdate working directory (or switch revisions) +Extra extensions will be printed in help output in a non-reliable order since +the extension is unknown. +#if no-extraextensions + $ hg help Mercurial Distributed SCM @@ -283,6 +287,8 @@ win32mbcs allow the use of MBCS paths with problematic encodings zeroconf discover and advertise repositories on the local network +#endif + Verify that deprecated extensions are included if --verbose: $ hg -v help extensions | grep children @@ -816,6 +822,8 @@ Test that default list of commands omits extension commands +#if no-extraextensions + $ hg help Mercurial Distributed SCM @@ -903,6 +911,7 @@ (use 'hg help -v' to show built-in aliases and global options) +#endif Test list of internal help commands diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t --- a/tests/test-globalopts.t +++ b/tests/test-globalopts.t @@ -289,6 +289,8 @@ Testing -h/--help: +#if no-extraextensions + $ hg -h Mercurial Distributed SCM @@ -372,8 +374,6 @@ (use 'hg help -v' to show built-in aliases and global options) - - $ hg --help Mercurial Distributed SCM @@ -457,5 +457,7 @@ (use 'hg help -v' to show built-in aliases and global options) +#endif + Not tested: --debugger diff --git a/tests/test-extension.t b/tests/test-extension.t --- a/tests/test-extension.t +++ b/tests/test-extension.t @@ -867,9 +867,11 @@ Show extensions: (note that mq force load strip, also checking it's not loaded twice) +#if no-extraextensions $ hg debugextensions mq strip +#endif For extensions, which name matches one of its commands, help message should ask '-v -e' to get list of built-in aliases diff --git a/tests/test-debugextensions.t b/tests/test-debugextensions.t --- a/tests/test-debugextensions.t +++ b/tests/test-debugextensions.t @@ -1,4 +1,6 @@ +#if no-extraextensions $ hg debugextensions +#endif $ debugpath=`pwd`/extwithoutinfos.py @@ -19,6 +21,10 @@ > ext2 = `pwd`/extwithinfos.py > EOF + $ for extension in $HGTESTEXTRAEXTENSIONS; do + > echo "$extension=!" >> $HGRCPATH + > done + $ hg debugextensions ext1 (untested!) ext2 (3.2.1!) diff --git a/tests/test-basic.t b/tests/test-basic.t --- a/tests/test-basic.t +++ b/tests/test-basic.t @@ -1,5 +1,6 @@ Create a repository: +#if no-extraextensions $ hg config devel.all-warnings=true devel.default-date=0 0 @@ -13,6 +14,8 @@ web.address=localhost web\.ipv6=(?:True|False) (re) web.server-header=testing stub value +#endif + $ hg init t $ cd t diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -1070,6 +1070,17 @@ env["HGENCODINGMODE"] = "strict" env['HGIPV6'] = str(int(self._useipv6)) +extraextensions = [] +for opt in self._extraconfigopts: +section, key = opt.encode('utf-8').split(b'.', 1) +if section != 'extensions': +continue +name = key.split(b'=', 1)[0] +extraextensions.append(name) + +if extraextensions: +env['HGTESTEXTRAEXTENSIONS'] = b' '.join(extraextensions) + # LOCALIP could be ::1 or 127.0.0.1. Useful for tests that require raw # IP addresses. env['LOCALIP'] = self._localip() diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -718,6 +718,10 @@ except (ImportError, AttributeError): return False +@check('extraextensions', 'whether tests are running with extra extensions') +def has_extraextensions(): +return 'HGTESTEXTRAEXTENSIONS' in os.environ + def getrepofeatures(): """Obtain set of repository features in use. diff --git a/tests/helpers-testrepo.sh b/tests/helpers-testrepo.sh --- a/tests/helpers-testrepo.sh +++ b/tests/helpers-testrepo.sh @@ -9,6 +9,13 @@ # The mercurial source repository was typically orignally cloned with the # system mercurial installation, and may require extensions or settings from # the system installation. + +if [ -n $HGTESTEXTRAEXTENSIONS ]; then +for extension in $HGTESTEXTRAEXTENSIONS; do +extraoptions="$extraoptions --config extensions.$extension=!" +done +fi + syshg () { ( syshgenv @@ -48,6 +55,6 @@ alias
D3039: tests: conditionalize tests based on presence of custom extensions
durin42 added inline comments. INLINE COMMENTS > run-tests.py:1075 > +for opt in self._extraconfigopts: > +section, key = opt.encode('utf-8').split(b'.', 1) > +name = key.split(b'=', 1)[0] S I'm dumb and misread this the last couple of times. Should this be doing if section != 'extensions': continue? Other than that this is what I was proposing, and I'm not sure how I misread it so badly before. :( REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3039 To: indygreg, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
[PATCH 2 of 2] copies: clean up _related logic
# HG changeset patch # User Gábor Stefanik# Date 1522848882 -7200 # Wed Apr 04 15:34:42 2018 +0200 # Node ID 084ee003f2f3cb4d51129c4f1bb63e1ff4db14d0 # Parent d72ca973100a1f1a4451a7d1efdc3e43ebc2912e copies: clean up _related logic The limit parameter was never actually used, since the only way the 4th case could be reached was if f1r and f2r converged. The new code makes this clear, and additionally reduces the conditional block to just 3 cases. diff -r d72ca973100a -r 084ee003f2f3 mercurial/copies.py --- a/mercurial/copies.py Wed Apr 04 15:28:09 2018 +0200 +++ b/mercurial/copies.py Wed Apr 04 15:34:42 2018 +0200 @@ -737,7 +737,7 @@ except StopIteration: raise -def _related(f1, f2, limit): +def _related(f1, f2): """return True if f1 and f2 filectx have a common ancestor Walk back to common ancestor to see if the two files originate @@ -764,10 +764,8 @@ f1, g1 = _loose_next(g1) elif f2r > f1r: f1, g1 = _loose_next(g1) -elif f1 == f2: -return f1 # a match -elif f1r == f2r or f1r < limit or f2r < limit: -return False # copy no longer relevant +else: # f1 and f2 point to files in the same linkrev +return f1 == f2 # true if they point to the same file except StopIteration: return False @@ -835,7 +833,7 @@ c2 = getdstfctx(of, mdst[of]) # c2 might be a plain new file on added on destination side that is # unrelated to the droids we are looking for. -cr = _related(oc, c2, tca.rev()) +cr = _related(oc, c2) if cr and (of == f or of == c2.path()): # non-divergent if backwards: data['copy'][of] = f This message, including its attachments, is confidential and the property of NNG Llc. For more information please read NNG's email policy here: https://www.nng.com/email-policy/ By responding to this email you accept the email policy. ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3039: tests: conditionalize tests based on presence of custom extensions
indygreg added a comment. In https://phab.mercurial-scm.org/D3039#49612, @durin42 wrote: > In https://phab.mercurial-scm.org/D3039#49575, @indygreg wrote: > > > In https://phab.mercurial-scm.org/D3039#49541, @durin42 wrote: > > > > > Could this be more tightly integrated with --extra-config-opt? > > > > > > What do you mean by that? > > > Broadly, I'm wondering why we're adding support for an environment variable that's duplicating the functionality of --extra-config-opt, when the latter can already be used for this, and maybe we could get the test runner to read the --extra-config-opts and expose those somehow to hghave. Does that make sense? Am I talking crazy? So you are advocating for a more generic solution? This patch already exposes the list of extensions as an environment variable. So you want the list of extra options to be exposed instead? One reason I didn't do that is complexity: I don't want to have to parse config options from bash. It was easier to just set the list of extensions. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3039 To: indygreg, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3077: simplestorerepo: avoid shadowing dict in list comprehension over dict
This revision was automatically updated to reflect the committed changes. Closed by commit rHGac88fdd8a19b: simplestorerepo: avoid shadowing dict in list comprehension over dict (authored by durin42, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3077?vs=7637=7642 REVISION DETAIL https://phab.mercurial-scm.org/D3077 AFFECTED FILES tests/simplestorerepo.py CHANGE DETAILS diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py --- a/tests/simplestorerepo.py +++ b/tests/simplestorerepo.py @@ -480,14 +480,14 @@ def headrevs(self): # Assume all revisions are heads by default. -ishead = {rev: True for rev in self._indexbyrev} +revishead = {rev: True for rev in self._indexbyrev} for rev, entry in self._indexbyrev.items(): # Unset head flag for all seen parents. ishead[self.rev(entry[b'p1'])] = False ishead[self.rev(entry[b'p2'])] = False -return [rev for rev, ishead in sorted(ishead.items()) +return [rev for rev, ishead in sorted(revishead.items()) if ishead] def heads(self, start=None, stop=None): To: durin42, #hg-reviewers, indygreg Cc: pulkit, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3030: tests: conditionalize tests based on presence of revlogs for files
This revision was automatically updated to reflect the committed changes. Closed by commit rHGcbc4425e81b5: tests: conditionalize tests based on presence of revlogs for files (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3030?vs=7596=7639 REVISION DETAIL https://phab.mercurial-scm.org/D3030 AFFECTED FILES tests/hghave.py tests/simplestorerepo.py tests/test-clone.t tests/test-contrib-perf.t tests/test-convert.t tests/test-copy.t tests/test-hardlinks.t tests/test-http-proxy.t tests/test-push-warn.t tests/test-relink.t tests/test-strip.t tests/test-subrepo-deep-nested-change.t tests/test-subrepo-recursion.t tests/test-upgrade-repo.t CHANGE DETAILS 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 @@ -1,3 +1,5 @@ +#require no-reposimplestore + $ cat >> $HGRCPATH << EOF > [extensions] > share = diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t --- a/tests/test-subrepo-recursion.t +++ b/tests/test-subrepo-recursion.t @@ -462,6 +462,11 @@ linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) linking [<=>] 8\r (no-eol) (esc) + linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) + linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) + linking [ <=>] 11\r (no-eol) (esc) (reposimplestore !) + linking [<=> ] 12\r (no-eol) (esc) (reposimplestore !) + linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) #else $ hg clone -U . ../empty @@ -487,6 +492,13 @@ linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) linking [<=>] 8\r (no-eol) (esc) + linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) + linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) + linking [ <=>] 11\r (no-eol) (esc) (reposimplestore !) + linking [<=> ] 12\r (no-eol) (esc) (reposimplestore !) + linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) + linking [ <=> ] 14\r (no-eol) (esc) (reposimplestore !) + linking [ <=>] 15\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo) [ ] 0/3\r (no-eol) (esc) @@ -501,6 +513,9 @@ linking [<=>] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) + linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !) + linking [<=>] 8\r (no-eol) (esc) (reposimplestore !) + linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) \r (no-eol) (esc) archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) diff --git a/tests/test-subrepo-deep-nested-change.t b/tests/test-subrepo-deep-nested-change.t --- a/tests/test-subrepo-deep-nested-change.t +++ b/tests/test-subrepo-deep-nested-change.t @@ -34,6 +34,7 @@ linking [<=>] 4\r (no-eol) (esc) linking [ <=> ] 5\r (no-eol) (esc) linking [ <=> ] 6\r (no-eol) (esc) + linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !) \r (no-eol) (esc) \r (no-eol) (esc) updating [===>] 1/1\r (no-eol) (esc) @@ -60,6 +61,9 @@ linking [ <=> ] 6\r (no-eol) (esc) linking [ <=> ] 7\r (no-eol) (esc) linking [<=>] 8\r (no-eol) (esc) + linking [ <=> ] 9\r (no-eol)
D3043: narrow: pass node into revlog.revision()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG8cf97e0e1730: narrow: pass node into revlog.revision() (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3043?vs=7569=7641 REVISION DETAIL https://phab.mercurial-scm.org/D3043 AFFECTED FILES hgext/narrow/narrowchangegroup.py CHANGE DETAILS diff --git a/hgext/narrow/narrowchangegroup.py b/hgext/narrow/narrowchangegroup.py --- a/hgext/narrow/narrowchangegroup.py +++ b/hgext/narrow/narrowchangegroup.py @@ -350,8 +350,9 @@ p2 = node.nullrev else: p1, p2 = sorted(local(p) for p in linkparents) +n = revlog.node(rev) yield ellipsisdata( -self, rev, revlog, p1, p2, revlog.revision(rev), linknode) +self, rev, revlog, p1, p2, revlog.revision(n), linknode) extensions.wrapfunction(changegroup.cg1packer, 'revchunk', revchunk) def deltaparent(orig, self, revlog, rev, p1, p2, prev): To: indygreg, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3041: changegroup: remove "revlog" from error message
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5859800edfc5: changegroup: remove revlog from error message (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3041?vs=7567=7640 REVISION DETAIL https://phab.mercurial-scm.org/D3041 AFFECTED FILES mercurial/changegroup.py CHANGE DETAILS diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py --- a/mercurial/changegroup.py +++ b/mercurial/changegroup.py @@ -758,7 +758,8 @@ for i, fname in enumerate(sorted(changedfiles)): filerevlog = repo.file(fname) if not filerevlog: -raise error.Abort(_("empty or missing revlog for %s") % fname) +raise error.Abort(_("empty or missing file data for %s") % + fname) linkrevnodes = linknodes(filerevlog, fname) # Lookup for filenodes, we collected the linkrev nodes above in the To: indygreg, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3029: tests: add test extension implementing custom filelog storage
This revision was automatically updated to reflect the committed changes. Closed by commit rHGd257c5f2a940: tests: add test extension implementing custom filelog storage (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3029?vs=7634=7638 REVISION DETAIL https://phab.mercurial-scm.org/D3029 AFFECTED FILES tests/simplestorerepo.py CHANGE DETAILS diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py new file mode 100644 --- /dev/null +++ b/tests/simplestorerepo.py @@ -0,0 +1,589 @@ +# simplestorerepo.py - Extension that swaps in alternate repository storage. +# +# Copyright 2018 Gregory Szorc+# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2 or any later version. + +from __future__ import absolute_import + +from mercurial.i18n import _ +from mercurial.node import ( +bin, +hex, +nullid, +nullrev, +) +from mercurial.thirdparty import ( +cbor, +) +from mercurial import ( +ancestor, +error, +filelog, +mdiff, +pycompat, +revlog, +) + +# Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for +# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should +# be specifying the version(s) of Mercurial they are tested with, or +# leave the attribute unspecified. +testedwith = 'ships-with-hg-core' + +def validatenode(node): +if isinstance(node, int): +raise ValueError('expected node; got int') + +if len(node) != 20: +raise ValueError('expected 20 byte node') + +def validaterev(rev): +if not isinstance(rev, int): +raise ValueError('expected int') + +class filestorage(object): +"""Implements storage for a tracked path. + +Data is stored in the VFS in a directory corresponding to the tracked +path. + +Index data is stored in an ``index`` file using CBOR. + +Fulltext data is stored in files having names of the node. +""" + +def __init__(self, svfs, path): +self._svfs = svfs +self._path = path + +self._storepath = b'/'.join([b'data', path]) +self._indexpath = b'/'.join([self._storepath, b'index']) + +indexdata = self._svfs.tryread(self._indexpath) +if indexdata: +indexdata = cbor.loads(indexdata) + +self._indexdata = indexdata or [] +self._indexbynode = {} +self._indexbyrev = {} +self.index = [] +self._refreshindex() + +# This is used by changegroup code :/ +self._generaldelta = True +self.storedeltachains = False + +self.version = 1 + +def _refreshindex(self): +self._indexbynode.clear() +self._indexbyrev.clear() +self.index = [] + +for i, entry in enumerate(self._indexdata): +self._indexbynode[entry[b'node']] = entry +self._indexbyrev[i] = entry + +self._indexbynode[nullid] = { +b'node': nullid, +b'p1': nullid, +b'p2': nullid, +b'linkrev': nullrev, +b'flags': 0, +} + +self._indexbyrev[nullrev] = { +b'node': nullid, +b'p1': nullid, +b'p2': nullid, +b'linkrev': nullrev, +b'flags': 0, +} + +for i, entry in enumerate(self._indexdata): +p1rev, p2rev = self.parentrevs(self.rev(entry[b'node'])) + +# start, length, rawsize, chainbase, linkrev, p1, p2, node +self.index.append((0, 0, 0, -1, entry[b'linkrev'], p1rev, p2rev, + entry[b'node'])) + +self.index.append((0, 0, 0, -1, -1, -1, -1, nullid)) + +def __len__(self): +return len(self._indexdata) + +def __iter__(self): +return iter(range(len(self))) + +def revs(self, start=0, stop=None): +step = 1 +if stop is not None: +if start > stop: +step = -1 + +stop += step +else: +stop = len(self) + +return range(start, stop, step) + +def parents(self, node): +validatenode(node) + +if node not in self._indexbynode: +raise KeyError('unknown node') + +entry = self._indexbynode[node] + +return entry[b'p1'], entry[b'p2'] + +def parentrevs(self, rev): +p1, p2 = self.parents(self._indexbyrev[rev][b'node']) +return self.rev(p1), self.rev(p2) + +def rev(self, node): +validatenode(node) + +# Will raise KeyError. +self._indexbynode[node] + +for rev, entry in self._indexbyrev.items(): +if entry[b'node'] == node: +return rev + +raise error.ProgrammingError('this should not occur') + +def node(self, rev): +validaterev(rev) + +return self._indexbyrev[rev][b'node'] + +def lookup(self, node):
D3077: simplestorerepo: avoid shadowing dict in list comprehension over dict
durin42 created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Caught by pyflakes. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3077 AFFECTED FILES tests/simplestorerepo.py CHANGE DETAILS diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py --- a/tests/simplestorerepo.py +++ b/tests/simplestorerepo.py @@ -480,14 +480,14 @@ def headrevs(self): # Assume all revisions are heads by default. -ishead = {rev: True for rev in self._indexbyrev} +revishead = {rev: True for rev in self._indexbyrev} for rev, entry in self._indexbyrev.items(): # Unset head flag for all seen parents. ishead[self.rev(entry[b'p1'])] = False ishead[self.rev(entry[b'p2'])] = False -return [rev for rev, ishead in sorted(ishead.items()) +return [rev for rev, ishead in sorted(revishead.items()) if ishead] def heads(self, start=None, stop=None): To: durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3039: tests: conditionalize tests based on presence of custom extensions
durin42 added a comment. In https://phab.mercurial-scm.org/D3039#49575, @indygreg wrote: > In https://phab.mercurial-scm.org/D3039#49541, @durin42 wrote: > > > Could this be more tightly integrated with --extra-config-opt? > > > What do you mean by that? Broadly, I'm wondering why we're adding support for an environment variable that's duplicating the functionality of --extra-config-opt, when the latter can already be used for this, and maybe we could get the test runner to read the --extra-config-opts and expose those somehow to hghave. Does that make sense? Am I talking crazy? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3039 To: indygreg, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3029: tests: add test extension implementing custom filelog storage
durin42 added inline comments. INLINE COMMENTS > indygreg wrote in simplestorerepo.py:35-44 > Why? > > The point of these functions is to help validate the interface. There are > surprisingly few failures in core due to this type checking. > > Manifests and changelog, however, failure in several places. But our use of > revisions and nodes in filelogs is surprisingly consistent. I just wish this could be done with a typechecker instead of these functions. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3029 To: indygreg, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3059: tests: use `hg unbundle` instead of `hg pull` in some tests
This revision was automatically updated to reflect the committed changes. Closed by commit rHG5d10f41ddcc4: tests: use `hg unbundle` instead of `hg pull` in some tests (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3059?vs=7633=7636 REVISION DETAIL https://phab.mercurial-scm.org/D3059 AFFECTED FILES tests/test-branches.t tests/test-bundle-type.t tests/test-keyword.t tests/test-merge-symlinks.t tests/test-rebase-conflicts.t tests/test-strip.t tests/test-treemanifest.t CHANGE DETAILS diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t --- a/tests/test-treemanifest.t +++ b/tests/test-treemanifest.t @@ -334,9 +334,7 @@ date:Thu Jan 01 00:00:00 1970 + summary: modify dir1/a - $ hg pull .hg/strip-backup/* - pulling from .hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg - searching for changes + $ hg unbundle .hg/strip-backup/* adding changesets adding manifests adding file changes diff --git a/tests/test-strip.t b/tests/test-strip.t --- a/tests/test-strip.t +++ b/tests/test-strip.t @@ -215,13 +215,11 @@ cache:rev-branch-cache -- {} phase-heads -- {} 264128213d290d868c54642d13aeaa3675551a78 draft - $ hg pull .hg/strip-backup/* - pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg - searching for changes + $ hg unbundle .hg/strip-backup/* adding changesets adding manifests adding file changes - added 1 changesets with 0 changes to 0 files (+1 heads) + added 1 changesets with 0 changes to 1 files (+1 heads) new changesets 264128213d29 (run 'hg heads' to see heads, 'hg merge' to merge) $ rm .hg/strip-backup/* @@ -1107,9 +1105,7 @@ summary: commitA - $ hg pull -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg - pulling from $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg - searching for changes + $ hg unbundle -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg adding changesets adding manifests adding file changes diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t --- a/tests/test-rebase-conflicts.t +++ b/tests/test-rebase-conflicts.t @@ -148,16 +148,17 @@ Check that the right ancestors is used while rebasing a merge (issue4041) - $ hg clone "$TESTDIR/bundles/issue4041.hg" issue4041 - requesting all changes + $ hg init issue4041 + $ cd issue4041 + $ hg unbundle "$TESTDIR/bundles/issue4041.hg" adding changesets adding manifests adding file changes added 11 changesets with 8 changes to 3 files (+1 heads) new changesets 24797d4f68de:2f2496ddf49d - updating to branch default + (run 'hg heads' to see heads) + $ hg up default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ cd issue4041 $ hg log -G ochangeset: 10:2f2496ddf49d |\ branch: f1 diff --git a/tests/test-merge-symlinks.t b/tests/test-merge-symlinks.t --- a/tests/test-merge-symlinks.t +++ b/tests/test-merge-symlinks.t @@ -31,7 +31,7 @@ $ hg init t $ cd t - $ hg -q pull "$TESTDIR/bundles/test-merge-symlinks.hg" + $ hg -q unbundle "$TESTDIR/bundles/test-merge-symlinks.hg" $ hg up -C 3 3 files updated, 0 files merged, 0 files removed, 0 files unresolved diff --git a/tests/test-keyword.t b/tests/test-keyword.t --- a/tests/test-keyword.t +++ b/tests/test-keyword.t @@ -118,14 +118,14 @@ hg ci -m addsym -u mercurial hg bundle --base null ../test-keyword.hg - $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg - pulling from *test-keyword.hg (glob) - requesting all changes + $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets a2392c293916 + (run 'hg update' to get a working copy) + $ hg up a2392c293916 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 'expand $Id$' > a diff --git a/tests/test-bundle-type.t b/tests/test-bundle-type.t --- a/tests/test-bundle-type.t +++ b/tests/test-bundle-type.t @@ -13,9 +13,7 @@ 1 changesets found $ cd ../t2 - $ hg pull ../b1 - pulling from ../b1 - requesting all changes + $ hg unbundle ../b1 adding changesets adding manifests adding file changes @@ -32,7 +30,7 @@ $ hg init t3 $ cd t3 - $ hg -q pull ../b1 + $ hg -q unbundle ../b1 $ hg bundle -a -t unknown out.hg abort: unknown is not a recognized bundle specification (see 'hg help bundlespec' for supported values for --type) diff --git a/tests/test-branches.t b/tests/test-branches.t --- a/tests/test-branches.t +++ b/tests/test-branches.t @@ -86,9 +86,7 @@ $ hg init test-invalid-branch-name $ cd test-invalid-branch-name - $ hg pull -u "$TESTDIR"/bundles/test-invalid-branch-name.hg - pulling from *test-invalid-branch-name.hg (glob) - requesting all changes + $ hg
D3059: tests: use `hg unbundle` instead of `hg pull` in some tests
durin42 added a comment. Answered my own question, a couple of callsites are left. :) REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3059 To: indygreg, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3060: tests: disallow using simple store repo with bundlerepo
indygreg updated this revision to Diff 7635. indygreg edited the summary of this revision. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3060?vs=7603=7635 REVISION DETAIL https://phab.mercurial-scm.org/D3060 AFFECTED FILES tests/hghave.py tests/simplestorerepo.py tests/test-manifest.t tests/test-mq-pull-from-bundle.t tests/test-narrow-strip.t tests/test-obsolete.t tests/test-shelve.t tests/test-treemanifest.t CHANGE DETAILS diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t --- a/tests/test-treemanifest.t +++ b/tests/test-treemanifest.t @@ -325,6 +325,8 @@ rev linkrev nodeid p1 p2 0 4 064927a0648a 1 5 25ecb8cb8618 + +#if repobundlerepo $ hg incoming .hg/strip-backup/* comparing with .hg/strip-backup/*-backup.hg (glob) searching for changes @@ -334,6 +336,8 @@ date:Thu Jan 01 00:00:00 1970 + summary: modify dir1/a +#endif + $ hg unbundle .hg/strip-backup/* adding changesets adding manifests diff --git a/tests/test-shelve.t b/tests/test-shelve.t --- a/tests/test-shelve.t +++ b/tests/test-shelve.t @@ -771,10 +771,12 @@ $ hg shelve shelved as default 0 files updated, 0 files merged, 1 files removed, 0 files unresolved +#if repobundlerepo $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()' o 4 changes to: commit stuff shelve@localhost | ~ +#endif $ hg log -G --template '{rev} {desc|firstline} {author}' @ 3 commit stuff test | diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -1244,6 +1244,7 @@ o 0:4b34ecfb0d56 (draft) [ ] A +#if repobundlerepo $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg comparing with ../repo-bundleoverlay searching for changes @@ -1256,6 +1257,7 @@ |/ o 0:4b34ecfb0d56 (draft) [ ] A +#endif #if serve diff --git a/tests/test-narrow-strip.t b/tests/test-narrow-strip.t --- a/tests/test-narrow-strip.t +++ b/tests/test-narrow-strip.t @@ -130,6 +130,8 @@ $ hg strip 0 0 files updated, 0 files merged, 1 files removed, 0 files unresolved saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/*-backup.hg (glob) + +#if repobundlerepo $ hg incoming .hg/strip-backup/*-backup.hg comparing with .hg/strip-backup/*-backup.hg (glob) changeset: 0:* (glob) @@ -161,3 +163,4 @@ added 3 changesets with 2 changes to 1 files (+1 heads) new changesets *:* (glob) (run 'hg heads' to see heads, 'hg merge' to merge) +#endif diff --git a/tests/test-mq-pull-from-bundle.t b/tests/test-mq-pull-from-bundle.t --- a/tests/test-mq-pull-from-bundle.t +++ b/tests/test-mq-pull-from-bundle.t @@ -1,3 +1,5 @@ +#require repobundlerepo + $ cat <> $HGRCPATH > [extensions] > mq= diff --git a/tests/test-manifest.t b/tests/test-manifest.t --- a/tests/test-manifest.t +++ b/tests/test-manifest.t @@ -1,3 +1,5 @@ +#require repobundlerepo + Source bundle was generated with the following script: # hg init diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py --- a/tests/simplestorerepo.py +++ b/tests/simplestorerepo.py @@ -24,6 +24,7 @@ ) from mercurial import ( ancestor, +bundlerepo, error, filelog, mdiff, @@ -587,6 +588,9 @@ if not repo.local(): return +if isinstance(repo, bundlerepo.bundlerepository): +raise error.Abort(_('cannot use simple store with bundlerepo')) + class simplestorerepo(repo.__class__): def file(self, f): return filestorage(self.svfs, f) diff --git a/tests/hghave.py b/tests/hghave.py --- a/tests/hghave.py +++ b/tests/hghave.py @@ -731,12 +731,13 @@ """ # Default list provided by core. features = { +'bundlerepo', 'revlogstore', } # Features that imply other features. implies = { -'simplestore': ['-revlogstore'], +'simplestore': ['-revlogstore', '-bundlerepo'], } for override in os.environ.get('HGREPOFEATURES', '').split(' '): @@ -765,3 +766,7 @@ @check('reposimplestore', 'repository using simple storage extension') def has_reposimplestore(): return 'simplestore' in getrepofeatures() + +@check('repobundlerepo', 'whether we can open bundle files as repos') +def has_repobundlerepo(): +return 'bundlerepo' in getrepofeatures() To: indygreg, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3029: tests: add test extension implementing custom filelog storage
indygreg updated this revision to Diff 7634. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3029?vs=7563=7634 REVISION DETAIL https://phab.mercurial-scm.org/D3029 AFFECTED FILES tests/simplestorerepo.py CHANGE DETAILS diff --git a/tests/simplestorerepo.py b/tests/simplestorerepo.py new file mode 100644 --- /dev/null +++ b/tests/simplestorerepo.py @@ -0,0 +1,589 @@ +# simplestorerepo.py - Extension that swaps in alternate repository storage. +# +# Copyright 2018 Gregory Szorc+# +# This software may be used and distributed according to the terms of the +# GNU General Public License version 2 or any later version. + +from __future__ import absolute_import + +from mercurial.i18n import _ +from mercurial.node import ( +bin, +hex, +nullid, +nullrev, +) +from mercurial.thirdparty import ( +cbor, +) +from mercurial import ( +ancestor, +error, +filelog, +mdiff, +pycompat, +revlog, +) + +# Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for +# extensions which SHIP WITH MERCURIAL. Non-mainline extensions should +# be specifying the version(s) of Mercurial they are tested with, or +# leave the attribute unspecified. +testedwith = 'ships-with-hg-core' + +def validatenode(node): +if isinstance(node, int): +raise ValueError('expected node; got int') + +if len(node) != 20: +raise ValueError('expected 20 byte node') + +def validaterev(rev): +if not isinstance(rev, int): +raise ValueError('expected int') + +class filestorage(object): +"""Implements storage for a tracked path. + +Data is stored in the VFS in a directory corresponding to the tracked +path. + +Index data is stored in an ``index`` file using CBOR. + +Fulltext data is stored in files having names of the node. +""" + +def __init__(self, svfs, path): +self._svfs = svfs +self._path = path + +self._storepath = b'/'.join([b'data', path]) +self._indexpath = b'/'.join([self._storepath, b'index']) + +indexdata = self._svfs.tryread(self._indexpath) +if indexdata: +indexdata = cbor.loads(indexdata) + +self._indexdata = indexdata or [] +self._indexbynode = {} +self._indexbyrev = {} +self.index = [] +self._refreshindex() + +# This is used by changegroup code :/ +self._generaldelta = True +self.storedeltachains = False + +self.version = 1 + +def _refreshindex(self): +self._indexbynode.clear() +self._indexbyrev.clear() +self.index = [] + +for i, entry in enumerate(self._indexdata): +self._indexbynode[entry[b'node']] = entry +self._indexbyrev[i] = entry + +self._indexbynode[nullid] = { +b'node': nullid, +b'p1': nullid, +b'p2': nullid, +b'linkrev': nullrev, +b'flags': 0, +} + +self._indexbyrev[nullrev] = { +b'node': nullid, +b'p1': nullid, +b'p2': nullid, +b'linkrev': nullrev, +b'flags': 0, +} + +for i, entry in enumerate(self._indexdata): +p1rev, p2rev = self.parentrevs(self.rev(entry[b'node'])) + +# start, length, rawsize, chainbase, linkrev, p1, p2, node +self.index.append((0, 0, 0, -1, entry[b'linkrev'], p1rev, p2rev, + entry[b'node'])) + +self.index.append((0, 0, 0, -1, -1, -1, -1, nullid)) + +def __len__(self): +return len(self._indexdata) + +def __iter__(self): +return iter(range(len(self))) + +def revs(self, start=0, stop=None): +step = 1 +if stop is not None: +if start > stop: +step = -1 + +stop += step +else: +stop = len(self) + +return range(start, stop, step) + +def parents(self, node): +validatenode(node) + +if node not in self._indexbynode: +raise KeyError('unknown node') + +entry = self._indexbynode[node] + +return entry[b'p1'], entry[b'p2'] + +def parentrevs(self, rev): +p1, p2 = self.parents(self._indexbyrev[rev][b'node']) +return self.rev(p1), self.rev(p2) + +def rev(self, node): +validatenode(node) + +# Will raise KeyError. +self._indexbynode[node] + +for rev, entry in self._indexbyrev.items(): +if entry[b'node'] == node: +return rev + +raise error.ProgrammingError('this should not occur') + +def node(self, rev): +validaterev(rev) + +return self._indexbyrev[rev][b'node'] + +def lookup(self, node): +if isinstance(node, int): +return self.node(node) + +if len(node) == 20: +try: +self.rev(node) +
D3059: tests: use `hg unbundle` instead of `hg pull` in some tests
indygreg updated this revision to Diff 7633. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3059?vs=7602=7633 REVISION DETAIL https://phab.mercurial-scm.org/D3059 AFFECTED FILES tests/test-branches.t tests/test-bundle-type.t tests/test-keyword.t tests/test-merge-symlinks.t tests/test-rebase-conflicts.t tests/test-strip.t tests/test-treemanifest.t CHANGE DETAILS diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t --- a/tests/test-treemanifest.t +++ b/tests/test-treemanifest.t @@ -334,9 +334,7 @@ date:Thu Jan 01 00:00:00 1970 + summary: modify dir1/a - $ hg pull .hg/strip-backup/* - pulling from .hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg - searching for changes + $ hg unbundle .hg/strip-backup/* adding changesets adding manifests adding file changes diff --git a/tests/test-strip.t b/tests/test-strip.t --- a/tests/test-strip.t +++ b/tests/test-strip.t @@ -215,13 +215,11 @@ cache:rev-branch-cache -- {} phase-heads -- {} 264128213d290d868c54642d13aeaa3675551a78 draft - $ hg pull .hg/strip-backup/* - pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg - searching for changes + $ hg unbundle .hg/strip-backup/* adding changesets adding manifests adding file changes - added 1 changesets with 0 changes to 0 files (+1 heads) + added 1 changesets with 0 changes to 1 files (+1 heads) new changesets 264128213d29 (run 'hg heads' to see heads, 'hg merge' to merge) $ rm .hg/strip-backup/* @@ -1108,9 +1106,7 @@ summary: commitA - $ hg pull -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg - pulling from $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg - searching for changes + $ hg unbundle -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg adding changesets adding manifests adding file changes diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t --- a/tests/test-rebase-conflicts.t +++ b/tests/test-rebase-conflicts.t @@ -148,16 +148,17 @@ Check that the right ancestors is used while rebasing a merge (issue4041) - $ hg clone "$TESTDIR/bundles/issue4041.hg" issue4041 - requesting all changes + $ hg init issue4041 + $ cd issue4041 + $ hg unbundle "$TESTDIR/bundles/issue4041.hg" adding changesets adding manifests adding file changes added 11 changesets with 8 changes to 3 files (+1 heads) new changesets 24797d4f68de:2f2496ddf49d - updating to branch default + (run 'hg heads' to see heads) + $ hg up default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ cd issue4041 $ hg log -G ochangeset: 10:2f2496ddf49d |\ branch: f1 diff --git a/tests/test-merge-symlinks.t b/tests/test-merge-symlinks.t --- a/tests/test-merge-symlinks.t +++ b/tests/test-merge-symlinks.t @@ -31,7 +31,7 @@ $ hg init t $ cd t - $ hg -q pull "$TESTDIR/bundles/test-merge-symlinks.hg" + $ hg -q unbundle "$TESTDIR/bundles/test-merge-symlinks.hg" $ hg up -C 3 3 files updated, 0 files merged, 0 files removed, 0 files unresolved diff --git a/tests/test-keyword.t b/tests/test-keyword.t --- a/tests/test-keyword.t +++ b/tests/test-keyword.t @@ -118,14 +118,14 @@ hg ci -m addsym -u mercurial hg bundle --base null ../test-keyword.hg - $ hg pull -u "$TESTDIR"/bundles/test-keyword.hg - pulling from *test-keyword.hg (glob) - requesting all changes + $ hg unbundle "$TESTDIR"/bundles/test-keyword.hg adding changesets adding manifests adding file changes added 1 changesets with 1 changes to 1 files new changesets a2392c293916 + (run 'hg update' to get a working copy) + $ hg up a2392c293916 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ echo 'expand $Id$' > a diff --git a/tests/test-bundle-type.t b/tests/test-bundle-type.t --- a/tests/test-bundle-type.t +++ b/tests/test-bundle-type.t @@ -13,9 +13,7 @@ 1 changesets found $ cd ../t2 - $ hg pull ../b1 - pulling from ../b1 - requesting all changes + $ hg unbundle ../b1 adding changesets adding manifests adding file changes @@ -32,7 +30,7 @@ $ hg init t3 $ cd t3 - $ hg -q pull ../b1 + $ hg -q unbundle ../b1 $ hg bundle -a -t unknown out.hg abort: unknown is not a recognized bundle specification (see 'hg help bundlespec' for supported values for --type) diff --git a/tests/test-branches.t b/tests/test-branches.t --- a/tests/test-branches.t +++ b/tests/test-branches.t @@ -86,9 +86,7 @@ $ hg init test-invalid-branch-name $ cd test-invalid-branch-name - $ hg pull -u "$TESTDIR"/bundles/test-invalid-branch-name.hg - pulling from *test-invalid-branch-name.hg (glob) - requesting all changes + $ hg unbundle -u "$TESTDIR"/bundles/test-invalid-branch-name.hg adding changesets adding manifests adding file changes To: indygreg, durin42, #hg-reviewers Cc:
D3059: tests: use `hg unbundle` instead of `hg pull` in some tests
indygreg added a comment. In https://phab.mercurial-scm.org/D3059#49559, @durin42 wrote: > Quick question before I'm okay with this: do we still have an explicit test of `hg pull` from a bundle somewhere? > > If so, this is strictly an improvement, since pull-from-bundle is slower than straight-unbundle. It has to be evaluated on a case-by-case basis. I attempted to only make changes where the test was simply adding revisions to a repo and not testing behavior w.r.t. exchange. That being said, I audited this again and found at least one error. So will submit a follow-up. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3059 To: indygreg, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3056: tests: disable test-revlog-v2 when using simple store
indygreg updated this revision to Diff 7632. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3056?vs=7599=7632 REVISION DETAIL https://phab.mercurial-scm.org/D3056 AFFECTED FILES tests/test-revlog-v2.t CHANGE DETAILS diff --git a/tests/test-revlog-v2.t b/tests/test-revlog-v2.t --- a/tests/test-revlog-v2.t +++ b/tests/test-revlog-v2.t @@ -1,3 +1,5 @@ +#require reporevlogstore + A repo with unknown revlogv2 requirement string cannot be opened $ hg init invalidreq To: indygreg, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3056: tests: disable test-revlog-v2 when using simple store
indygreg added a comment. In https://phab.mercurial-scm.org/D3056#49554, @durin42 wrote: > Though I do wonder if this should be a positive check, that is, "require it's on revlogs" rather than "require it's not on the simple store"? Yes, it should. Will re-submit. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3056 To: indygreg, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3057: tests: remove superfluous config setting
This revision was automatically updated to reflect the committed changes. Closed by commit rHGdb06c4bb2158: tests: remove superfluous config setting (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3057?vs=7600=7627 REVISION DETAIL https://phab.mercurial-scm.org/D3057 AFFECTED FILES tests/test-bundle-type.t tests/test-bundle.t tests/test-clonebundles.t tests/test-commit-amend.t tests/test-copy.t tests/test-debugcommands.t tests/test-hgweb-commands.t tests/test-init.t tests/test-lfconvert.t tests/test-patchbomb.t tests/test-rebase-conflicts.t tests/test-rebase-mq-skip.t tests/test-rebase-newancestor.t tests/test-ssh-bundle1.t tests/test-ssh.t tests/test-strip.t tests/test-treemanifest.t CHANGE DETAILS diff --git a/tests/test-treemanifest.t b/tests/test-treemanifest.t --- a/tests/test-treemanifest.t +++ b/tests/test-treemanifest.t @@ -1,8 +1,6 @@ #require killdaemons $ cat << EOF >> $HGRCPATH - > [format] - > usegeneraldelta=yes > [ui] > ssh=$PYTHON "$TESTDIR/dummyssh" > EOF diff --git a/tests/test-strip.t b/tests/test-strip.t --- a/tests/test-strip.t +++ b/tests/test-strip.t @@ -1,5 +1,3 @@ - $ echo "[format]" >> $HGRCPATH - $ echo "usegeneraldelta=yes" >> $HGRCPATH $ echo "[extensions]" >> $HGRCPATH $ echo "strip=" >> $HGRCPATH $ echo "drawdag=$TESTDIR/drawdag.py" >> $HGRCPATH diff --git a/tests/test-ssh.t b/tests/test-ssh.t --- a/tests/test-ssh.t +++ b/tests/test-ssh.t @@ -10,11 +10,6 @@ This test tries to exercise the ssh functionality with a dummy script - $ cat <> $HGRCPATH - > [format] - > usegeneraldelta=yes - > EOF - creating 'remote' repo $ hg init remote diff --git a/tests/test-ssh-bundle1.t b/tests/test-ssh-bundle1.t --- a/tests/test-ssh-bundle1.t +++ b/tests/test-ssh-bundle1.t @@ -15,8 +15,6 @@ > [devel] > # This test is dedicated to interaction through old bundle > legacy.exchange = bundle1 - > [format] # temporary settings - > usegeneraldelta=yes > EOF diff --git a/tests/test-rebase-newancestor.t b/tests/test-rebase-newancestor.t --- a/tests/test-rebase-newancestor.t +++ b/tests/test-rebase-newancestor.t @@ -1,6 +1,4 @@ $ cat >> $HGRCPATH < [format] - > usegeneraldelta=yes > [extensions] > rebase= > drawdag=$TESTDIR/drawdag.py diff --git a/tests/test-rebase-mq-skip.t b/tests/test-rebase-mq-skip.t --- a/tests/test-rebase-mq-skip.t +++ b/tests/test-rebase-mq-skip.t @@ -2,8 +2,6 @@ already has one local mq patch $ cat >> $HGRCPATH < [format] - > usegeneraldelta=yes > [extensions] > rebase= > mq= diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t --- a/tests/test-rebase-conflicts.t +++ b/tests/test-rebase-conflicts.t @@ -1,6 +1,4 @@ $ cat >> $HGRCPATH < [format] - > usegeneraldelta=yes > [extensions] > rebase= > drawdag=$TESTDIR/drawdag.py diff --git a/tests/test-patchbomb.t b/tests/test-patchbomb.t --- a/tests/test-patchbomb.t +++ b/tests/test-patchbomb.t @@ -24,8 +24,6 @@ > print(l, end='') > EOF $ FILTERBOUNDARY="$PYTHON `pwd`/prune-blank-after-boundary.py" - $ echo "[format]" >> $HGRCPATH - $ echo "usegeneraldelta=yes" >> $HGRCPATH $ echo "[extensions]" >> $HGRCPATH $ echo "patchbomb=" >> $HGRCPATH diff --git a/tests/test-lfconvert.t b/tests/test-lfconvert.t --- a/tests/test-lfconvert.t +++ b/tests/test-lfconvert.t @@ -1,8 +1,6 @@ $ USERCACHE="$TESTTMP/cache"; export USERCACHE $ mkdir "${USERCACHE}" $ cat >> $HGRCPATH < [format] - > usegeneraldelta=yes > [extensions] > largefiles = > share = diff --git a/tests/test-init.t b/tests/test-init.t --- a/tests/test-init.t +++ b/tests/test-init.t @@ -1,12 +1,5 @@ This test tries to exercise the ssh functionality with a dummy script -(enable general delta early) - - $ cat << EOF >> $HGRCPATH - > [format] - > usegeneraldelta=yes - > EOF - $ checknewrepo() > { >name=$1 diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t +++ b/tests/test-hgweb-commands.t @@ -6,11 +6,6 @@ - unbundle, tested in test-push-http - changegroupsubset, tested in test-pull - $ cat << EOF >> $HGRCPATH - > [format] - > usegeneraldelta=yes - > EOF - Set up the repo $ hg init test diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t --- a/tests/test-debugcommands.t +++ b/tests/test-debugcommands.t @@ -1,8 +1,6 @@ $ cat << EOF >> $HGRCPATH > [ui] > interactive=yes - > [format] - > usegeneraldelta=yes > EOF $ hg init debugrevlog diff --git a/tests/test-copy.t b/tests/test-copy.t --- a/tests/test-copy.t +++ b/tests/test-copy.t @@ -1,10 +1,3 @@ -# enable bundle2 in advance - - $ cat << EOF >> $HGRCPATH - > [format] - > usegeneraldelta=yes - > EOF - $ mkdir part1 $ cd part1 diff --git a/tests/test-commit-amend.t b/tests/test-commit-amend.t --- a/tests/test-commit-amend.t
D3073: hgweb: drop support for "manifest" parameter
This revision was automatically updated to reflect the committed changes. Closed by commit rHG44f3b60deafb: hgweb: drop support for manifest parameter (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3073?vs=7622=7629 REVISION DETAIL https://phab.mercurial-scm.org/D3073 AFFECTED FILES mercurial/hgweb/webutil.py CHANGE DETAILS diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -296,23 +296,15 @@ return pathutil.canonpath(repo.root, '', path) def changeidctx(repo, changeid): -try: -ctx = repo[changeid] -except error.RepoError: -man = repo.manifestlog._revlog -ctx = repo[man.linkrev(man.rev(man.lookup(changeid)))] - -return ctx +return repo[changeid] def changectx(repo, req): changeid = "tip" if 'node' in req.qsparams: changeid = req.qsparams['node'] ipos = changeid.find(':') if ipos != -1: changeid = changeid[(ipos + 1):] -elif 'manifest' in req.qsparams: -changeid = req.qsparams['manifest'] return changeidctx(repo, changeid) To: martinvonz, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3075: hgweb: use revsymbol() for creating context from changeid
This revision was automatically updated to reflect the committed changes. Closed by commit rHG956260cbc564: hgweb: use revsymbol() for creating context from changeid (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3075?vs=7624=7631 REVISION DETAIL https://phab.mercurial-scm.org/D3075 AFFECTED FILES mercurial/hgweb/webutil.py CHANGE DETAILS diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -32,6 +32,7 @@ patch, pathutil, pycompat, +scmutil, templatefilters, templatekw, ui as uimod, @@ -303,15 +304,15 @@ if ipos != -1: changeid = changeid[(ipos + 1):] -return repo[changeid] +return scmutil.revsymbol(repo, changeid) def basechangectx(repo, req): if 'node' in req.qsparams: changeid = req.qsparams['node'] ipos = changeid.find(':') if ipos != -1: changeid = changeid[:ipos] -return repo[changeid] +return scmutil.revsymbol(repo, changeid) return None @@ -326,7 +327,7 @@ else: raise ErrorResponse(HTTP_NOT_FOUND, 'node or filenode not given') try: -fctx = repo[changeid][path] +fctx = scmutil.revsymbol(repo, changeid)[path] except error.RepoError: fctx = repo.filectx(path, fileid=changeid) To: martinvonz, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3074: hgweb: inline changeidctx()
This revision was automatically updated to reflect the committed changes. Closed by commit rHG6407507e12b6: hgweb: inline changeidctx() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3074?vs=7623=7630 REVISION DETAIL https://phab.mercurial-scm.org/D3074 AFFECTED FILES mercurial/hgweb/webutil.py CHANGE DETAILS diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -295,26 +295,23 @@ path = path.lstrip('/') return pathutil.canonpath(repo.root, '', path) -def changeidctx(repo, changeid): -return repo[changeid] - def changectx(repo, req): changeid = "tip" if 'node' in req.qsparams: changeid = req.qsparams['node'] ipos = changeid.find(':') if ipos != -1: changeid = changeid[(ipos + 1):] -return changeidctx(repo, changeid) +return repo[changeid] def basechangectx(repo, req): if 'node' in req.qsparams: changeid = req.qsparams['node'] ipos = changeid.find(':') if ipos != -1: changeid = changeid[:ipos] -return changeidctx(repo, changeid) +return repo[changeid] return None To: martinvonz, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3076: rebase: use single transaction when running in memory
This revision was automatically updated to reflect the committed changes. Closed by commit rHGb48b7b130d08: rebase: use single transaction when running in memory (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3076?vs=7625=7628 REVISION DETAIL https://phab.mercurial-scm.org/D3076 AFFECTED FILES hgext/rebase.py CHANGE DETAILS diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -788,7 +788,9 @@ try: # in-memory merge doesn't support conflicts, so if we hit any, abort # and re-run as an on-disk merge. -return _origrebase(ui, repo, inmemory=inmemory, **opts) +overrides = {('rebase', 'singletransaction'): True} +with ui.configoverride(overrides, 'rebase'): +return _origrebase(ui, repo, inmemory=inmemory, **opts) except error.InMemoryMergeConflictsError: ui.warn(_('hit merge conflicts; re-running rebase without in-memory' ' merge\n')) To: martinvonz, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3058: bundlerepo: use super() when calling file()
This revision was automatically updated to reflect the committed changes. Closed by commit rHGc68262401c8c: bundlerepo: use super() when calling file() (authored by indygreg, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3058?vs=7601=7626 REVISION DETAIL https://phab.mercurial-scm.org/D3058 AFFECTED FILES mercurial/bundlerepo.py CHANGE DETAILS diff --git a/mercurial/bundlerepo.py b/mercurial/bundlerepo.py --- a/mercurial/bundlerepo.py +++ b/mercurial/bundlerepo.py @@ -420,7 +420,7 @@ linkmapper = self.unfiltered().changelog.rev return bundlefilelog(self.svfs, f, self._cgunpacker, linkmapper) else: -return filelog.filelog(self.svfs, f) +return super(bundlerepository, self).file(f) def close(self): """Close assigned bundle file immediately.""" To: indygreg, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3039: tests: conditionalize tests based on presence of custom extensions
indygreg added a comment. In https://phab.mercurial-scm.org/D3039#49541, @durin42 wrote: > Could this be more tightly integrated with --extra-config-opt? What do you mean by that? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3039 To: indygreg, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3076: rebase: use single transaction when running in memory
durin42 accepted this revision. durin42 added a comment. This revision is now accepted and ready to land. fixing typo in log message in flight REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3076 To: martinvonz, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3029: tests: add test extension implementing custom filelog storage
indygreg added inline comments. INLINE COMMENTS > durin42 wrote in simplestorerepo.py:35-44 > ew Why? The point of these functions is to help validate the interface. There are surprisingly few failures in core due to this type checking. Manifests and changelog, however, failure in several places. But our use of revisions and nodes in filelogs is surprisingly consistent. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3029 To: indygreg, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3059: tests: use `hg unbundle` instead of `hg pull` in some tests
durin42 added a comment. Quick question before I'm okay with this: do we still have an explicit test of `hg pull` from a bundle somewhere? If so, this is strictly an improvement, since pull-from-bundle is slower than straight-unbundle. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3059 To: indygreg, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3056: tests: disable test-revlog-v2 when using simple store
durin42 added a comment. Though I do wonder if this should be a positive check, that is, "require it's on revlogs" rather than "require it's not on the simple store"? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3056 To: indygreg, #hg-reviewers, durin42 Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3043: narrow: pass node into revlog.revision()
durin42 accepted this revision. durin42 added a comment. This revision is now accepted and ready to land. Yes please! REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3043 To: indygreg, durin42, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3039: tests: conditionalize tests based on presence of custom extensions
durin42 added a comment. Could this be more tightly integrated with --extra-config-opt? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3039 To: indygreg, #hg-reviewers Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3030: tests: conditionalize tests based on presence of revlogs for files
durin42 accepted this revision. durin42 added a comment. This revision is now accepted and ready to land. Seems fine for now, we may need to revisit it later if we get too many stores. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3030 To: indygreg, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3029: tests: add test extension implementing custom filelog storage
durin42 requested changes to this revision. durin42 added a comment. This revision now requires changes to proceed. One thing that I'm 99% sure is a bug. The "ew" comment is not actionable, it just feels bad. INLINE COMMENTS > simplestorerepo.py:35-44 > +def validatenode(node): > +if isinstance(node, int): > +raise ValueError('expected node; got int') > + > +if len(node) != 20: > +raise ValueError('expected 20 byte node') > + ew > simplestorerepo.py:215-216 > +def candelta(self, baserev, rev): > +validaterev(rev) > +validaterev(rev) > + should one of these be baserev? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3029 To: indygreg, #hg-reviewers, durin42 Cc: durin42, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3065: repair: use repo.file().files() to rebuild fncache
indygreg abandoned this revision. indygreg added a comment. I'm just going to disable fncache with the simple store. All test functionality for `hg debugrebuildfncache` will be disabled unless an fncache is in play. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3065 To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3066: tests: teach test-fncache.t about the simple store
indygreg abandoned this revision. indygreg added a comment. I'm just going to disable this test unless fncache is enabled. That will be simpler. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3066 To: indygreg, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH 7 of 7] templater: mark .joinfmt as a private attribute
On Wed, Apr 04, 2018 at 11:48:58PM +0900, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara> # Date 1521293425 -32400 > # Sat Mar 17 22:30:25 2018 +0900 > # Node ID 8cf313b60c1eb83dfa2e1ef09acbcc1de581 > # Parent 3e8117550703c88ed14a84e9db133eb2390adaa4 > templater: mark .joinfmt as a private attribute queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Re: [PATCH] stringutil: drop escapedata() in favor of escapestr()
On Wed, Apr 04, 2018 at 11:35:56PM +0900, Yuya Nishihara wrote: > # HG changeset patch > # User Yuya Nishihara> # Date 1522852009 -32400 > # Wed Apr 04 23:26:49 2018 +0900 > # Node ID 69b1e6f9cc986d2763a00646179a956930a86a0d > # Parent e826fe7a08c73ed484bb09d7ea2b2093750cec27 > stringutil: drop escapedata() in favor of escapestr() queued, thanks ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel