Wed, 10 Jan 2018 10:30:51 -0800 obsolete: use context manager for transaction in createmarkers()
Martin von Zweigbergk <martinvonz@google.com> [Wed, 10 Jan 2018 10:30:51 -0800] rev 35572
obsolete: use context manager for transaction in createmarkers() Differential Revision: https://phab.mercurial-scm.org/D1835
Fri, 05 Jan 2018 09:12:08 +0100 visibility: improve the message when accessing filtered obsolete rev
Boris Feld <boris.feld@octobus.net> [Fri, 05 Jan 2018 09:12:08 +0100] rev 35571
visibility: improve the message when accessing filtered obsolete rev When trying to access filtered revision, it is likely because they have been obsoleted by an obs-marker. The current message shows how to access the revision anyway: abort: hidden revision '13bedc178fce'! But in the case of an obsoleted revision, the user is likely to want to update to or use the successor of the revision. We update the message to display more information about the obsolescence fate of the revision in the following cases: abort: hidden revision '13bedc178fce' is pruned! abort: hidden revision '13bedc178fce' has diverged! abort: hidden revision '13bedc178fce' was rewritten as X, Y and 2 more! Differential Revision: https://phab.mercurial-scm.org/D1591
Fri, 29 Dec 2017 03:37:36 +0530 tests: add b'' to string literals where bytes are required
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 03:37:36 +0530] rev 35570
tests: add b'' to string literals where bytes are required Since we are internally dealing with bytes only, we need to use bytes in the tests too. This is one of the many patches which will make all the tests completely use bytes. # skip-blame because we are just adding b'' Differential Revision: https://phab.mercurial-scm.org/D1788
Wed, 10 Jan 2018 08:53:22 -0800 rust: implementation of `hg`
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 10 Jan 2018 08:53:22 -0800] rev 35569
rust: implementation of `hg` This commit provides a mostly-working implementation of the `hg` script in Rust along with scaffolding to support Rust in the repository. If you are familiar with Rust, the contents of the added rust/ directory should be pretty straightforward. We create an "hgcli" package that implements a binary application to run Mercurial. The output of this package is an "hg" binary. Our Rust `hg` (henceforth "rhg") essentially is a port of the existing `hg` Python script. The main difference is the creation of the embedded CPython interpreter is handled by the binary itself instead of relying on the shebang. In that sense, rhg is more similar to the "exe wrapper" we currently use on Windows. However, unlike the exe wrapper, rhg does not call the `hg` Python script. Instead, it uses the CPython APIs to import mercurial modules and call appropriate functions. The amount of code here is surprisingly small. It is my intent to replace the existing C-based exe wrapper with rhg. Preferably in the next Mercurial release. This should be achievable - at least for some Mercurial distributions. The future/timeline for rhg on other platforms is less clear. We already ship a hg.exe on Windows. So if we get the quirks with Rust worked out, shipping a Rust-based hg.exe should hopefully not be too contentious. Now onto the implementation. We're using python27-sys and the cpython crates for talking to the CPython API. We currently don't use too much functionality of the cpython crate and could have probably cut it out. However, it does provide a reasonable abstraction over unsafe {} CPython function calls. While we still have our fair share of those, at least we're not dealing with too much refcounting, error checking, etc. So I think the use of the cpython crate is justified. Plus, there is not-yet-implemented functionality that could benefit from cpython. I see our use of this crate only increasing. The cpython and python27-sys crates are not without their issues. The cpython crate didn't seem to account for the embedding use case in its design. Instead, it seems to assume that you are building a Python extension. It is making some questionable decisions around certain CPython APIs. For example, it insists that PyEval_ThreadsInitialized() is called and that the Python code likely isn't the main thread in the underlying application. It is also missing some functionality that is important for embedded use cases (such as exporting the path to the Python interpreter from its build script). After spending several hours trying to wrangle python27-sys and cpython, I gave up and forked the project on GitHub. Our Cargo.toml tracks this fork. I'm optimistic that the upstream project will accept our contributions and we can eventually unfork. There is a non-trivial amount of code in our custom Cargo build script. Our build.rs (which is called as part of building the hgcli crate): * Validates that the Python interpreter that was detected by the python27-sys crate provides a shared library (we only support shared library linking at this time - although this restriction could be loosened). * Validates that the Python is built with UCS-4 support. This ensures maximum Unicode compatibility. * Exports variables to the crate build allowing the built crate to e.g. find the path to the Python interpreter. The produced rhg should be considered alpha quality. There are several known deficiencies. Many of these are documented with inline TODOs. Probably the biggest limitation of rhg is that it assumes it is running from the ./rust/target/<target> directory of a source distribution. So, rhg is currently not very practical for real-world use. But, if you can `cargo build` it, running the binary *should* yield a working Mercurial CLI. In order to support using rhg with the test harness, we needed to hack up run-tests.py so the path to Mercurial's Python files is set properly. The change is extremely hacky and is only intended to be a stop-gap until the test harness gains first-class support for installing rhg. This will likely occur after we support running rhg outside the source directory. Despite its officially alpha quality, rhg copes extremely well with the test harness (at least on Linux). Using `run-tests.py --with-hg ../rust/target/debug/hg`, I only encounter the following failures: * test-run-tests.t -- Warnings emitted about using an unexpected Mercurial library. This is due to the hacky nature of setting the Python directory when run-tests.py detected rhg. * test-devel-warnings.t -- Expected stack trace missing frame for `hg` (This is expected since we no longer have an `hg` script!) * test-convert.t -- Test running `$PYTHON "$BINDIR"/hg`, which obviously assumes `hg` is a Python script. * test-merge-tools.t -- Same assumption about `hg` being executable with Python. * test-http-bad-server.t -- Seeing exit code 255 instead of 1 around line 358. * test-blackbox.t -- Exit code 255 instead of 1. * test-basic.t -- Exit code 255 instead of 1. It certainly looks like we have a bug around exit code handling. I don't think it is severe enough to hold up review and landing of this initial implementation. Perfect is the enemy of good. Differential Revision: https://phab.mercurial-scm.org/D1581
Sun, 07 Jan 2018 15:21:16 -0500 lfs: improve the error message for a missing remote blob
Matt Harbison <matt_harbison@yahoo.com> [Sun, 07 Jan 2018 15:21:16 -0500] rev 35568
lfs: improve the error message for a missing remote blob It seems better to print the name known to the user, not the internal file. The previous code unconditionally set 'p.filename'. That potentially made the attribute None, and would be printed as such in _gitlfsremote._checkforservererror() instead of "unknown". Normally, files are printed relative to CWD, but I don't see a way to get the repo path to make that adjustment. The test modified here apparently only runs within Facebook, but a print statement confirmed the name change. I tried uploading the blob to a different remote store (so the git server never saw it), and also killing the git server and removing the blob directory, and removing the 'lfs.db' file. All resulted in a message: abort: LFS server claims required objects do not exist: bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a! So I have no idea how to make this test generally runnable.
Sun, 07 Jan 2018 15:01:59 -0500 filelog: add the ability to report the user facing name
Matt Harbison <matt_harbison@yahoo.com> [Sun, 07 Jan 2018 15:01:59 -0500] rev 35567
filelog: add the ability to report the user facing name This will be used by lfs, but is probably generally useful. There are various bits of code that reverse engineer this from the index or data file names, but it seems better to just store it. Especially if there's experimenting with backing storage other than revlog.
Tue, 19 Dec 2017 20:41:25 +0800 hgweb: make different kinds of commits look differently on /graph
Anton Shestakov <av6@dwimlabs.net> [Tue, 19 Dec 2017 20:41:25 +0800] rev 35566
hgweb: make different kinds of commits look differently on /graph Regular hg log -G uses different symbols for some graph nodes, such as commits that close branches and hidden commits. It also marks the currently checked out commit with "@". Since hg serve is sometimes used/recommended as a more visual alternative to CLI, it makes sense to port these features to hgweb. "graphnode" includes the style of a particular node and also if it's currently checked out or not, both at the same time. This is different from hg log -G (which uses templatekw.showgraphnode), where there's only place for one character, but hgweb doesn't have this limitation, since it uses <canvas> and not plain text. I'm using one string of 1 or 2 characters in this patch, it's not the most self-explanatory format, but it's concise, uses the same characters as hg log -G, and is internal to hgweb (i.e. not used for json-graph). I'm more or less fine with how things look visually, but there's still room for improvement. Feel free to criticise or point me to good-looking graphs of this kind for inspiration.
Thu, 21 Dec 2017 13:58:11 +0100 clonebundle: make it possible to retrieve the initial bundle through largefile
Boris Feld <boris.feld@octobus.net> [Thu, 21 Dec 2017 13:58:11 +0100] rev 35565
clonebundle: make it possible to retrieve the initial bundle through largefile By setting the default path early enough, we make it possible to retrieve a clone bundle as a largefile from the repository we are cloning. But... why? Clone bundle is a great feature to speeds up clone of large repository. However one of the main obstacle for clone bundle deployment is the authentication scheme. For non public project, just putting a static file on some random CDN is not an option as we have to make sure people have the proper permission to retrieves the bundle. On the other hand, 'largefiles' already have all the necessary logic to serve arbitrary binary files -after- an authentication checks. So reusing an existing large file infrastructure can be a significant shortcut to clone bundle in this kind of closed environment. The idea might seems strange, but the necessary update to the large file extensions are quite small while the benefits are huge. In addition, since all the extra logic live in the 'largefiles' extensions, core does not have to know anything about it.
Thu, 21 Dec 2017 13:57:57 +0100 largefiles: add support for 'largefiles://' url scheme
Boris Feld <boris.feld@octobus.net> [Thu, 21 Dec 2017 13:57:57 +0100] rev 35564
largefiles: add support for 'largefiles://' url scheme This changesets allows Mercurial to transparently download content from the configured largefile store. This handle all authentication and largefile protocol details. The target usecase is to leverage largefile infrastructure for clone bundle. See next changeset for details
Thu, 21 Dec 2017 13:53:26 +0100 largefiles: add a 'debuglfput' command to put largefile into the store
Boris Feld <boris.feld@octobus.net> [Thu, 21 Dec 2017 13:53:26 +0100] rev 35563
largefiles: add a 'debuglfput' command to put largefile into the store We add a new debug command able to add arbitrary new files into the largefile store. This will be useful for debugging, testing and other unholy usecase.
Fri, 15 Dec 2017 09:30:16 +0100 debug: add a 'debugdownload' command
Boris Feld <boris.feld@octobus.net> [Fri, 15 Dec 2017 09:30:16 +0100] rev 35562
debug: add a 'debugdownload' command This command resolve and fetch and URL through the Mercurial logic. Mercurial logic add various headers (including authentication) while resolving an URL so the commands helps with building the same request Mercurial would be doing. A new test file is created because we'll add more logic regarding Mercurial download logic and it will grow to a reasonable size.
Sat, 01 Apr 2017 17:12:48 +0900 revsetlang: raise ParseError to report invalid format character
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 17:12:48 +0900] rev 35561
revsetlang: raise ParseError to report invalid format character It's more common in revset and templater than raising Abort. I have a couple more patches to address exceptions caused by bad format string passed to revset() template function.
Sat, 01 Apr 2017 17:04:49 +0900 revsetlang: use iterator to track current argument in formatspec()
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 17:04:49 +0900] rev 35560
revsetlang: use iterator to track current argument in formatspec()
Sat, 01 Apr 2017 16:56:47 +0900 revsetlang: unnest "if True" in formatrevspec()
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 16:56:47 +0900] rev 35559
revsetlang: unnest "if True" in formatrevspec()
Sat, 01 Apr 2017 16:55:28 +0900 revsetlang: use str.find() to scan expr in formatspec()
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 16:55:28 +0900] rev 35558
revsetlang: use str.find() to scan expr in formatspec() There should be no need to walk character one by one in Python.
Sat, 01 Apr 2017 16:50:11 +0900 revsetlang: avoid string concatenation in formatspec()
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 16:50:11 +0900] rev 35557
revsetlang: avoid string concatenation in formatspec()
Thu, 04 Jan 2018 12:30:55 +0900 test-glog: hook cmdutil.getlogrevs() so -frREV is rewritten accordingly
Yuya Nishihara <yuya@tcha.org> [Thu, 04 Jan 2018 12:30:55 +0900] rev 35556
test-glog: hook cmdutil.getlogrevs() so -frREV is rewritten accordingly Before, these tests didn't match the real behavior of "log -frREV".
Wed, 03 Jan 2018 17:12:30 +0900 test-glog: dump computed set
Yuya Nishihara <yuya@tcha.org> [Wed, 03 Jan 2018 17:12:30 +0900] rev 35555
test-glog: dump computed set It's more important than the revset expression built from command options.
Wed, 03 Jan 2018 17:09:16 +0900 test-glog: drop uninteresting nodes from AST output
Yuya Nishihara <yuya@tcha.org> [Wed, 03 Jan 2018 17:09:16 +0900] rev 35554
test-glog: drop uninteresting nodes from AST output This makes future test changes more readable.
Sun, 07 Jan 2018 01:14:52 -0500 lfs: remove the verification option when writing to the local store
Matt Harbison <matt_harbison@yahoo.com> [Sun, 07 Jan 2018 01:14:52 -0500] rev 35553
lfs: remove the verification option when writing to the local store This partially reverts 417e8e040102 and bb6a80fc969a. But since there's now a dedicated download function, there's no functional change. The last sentence in the commit message of the latter is wrong- write() didn't need the one time hash check if verification wasn't requested. I suspect I missed 'read()' in there ("... but _read()_ also needs to do a one time check..."), because that did fail without the hash check before linking to the usercache. The write() method simply took the same check for consistency. While here, clarify that the write() method is *only* for storing content directly from filelog, which has already checked the hash. If someone can come up with a way to bridge the differences between writing to a file and sending a urlreq.request across the wire, we can create an upload() function and cleanup read() in a similar way. About the only common thread I see is an open() that verifies the content before returning a file descriptor.
Thu, 21 Dec 2017 21:20:00 -0500 lfs: use the localstore download method to transfer from remote stores
Matt Harbison <matt_harbison@yahoo.com> [Thu, 21 Dec 2017 21:20:00 -0500] rev 35552
lfs: use the localstore download method to transfer from remote stores Both gitlfsremote and file based remotes benefit from not requiring the whole file in memory (though the whole file is still loaded when passing through the revlog interface). With a method specific to downloading from a remote store, the misleading 'use hg verify' hint is removed. The behavior is otherwise unchanged, in that a download from both remote store types will yield a copy of the blob via util.atomictempfile. There's no response payload defined for the non 'download' actions, but the previous code attempted to read the payload in this case anyway. This refactored code made that more obvious, so any payload is printed as a debug message, just in case.
Thu, 21 Dec 2017 18:56:04 -0500 lfs: introduce a localstore method for downloading from remote stores
Matt Harbison <matt_harbison@yahoo.com> [Thu, 21 Dec 2017 18:56:04 -0500] rev 35551
lfs: introduce a localstore method for downloading from remote stores The current local.write() method requires the full data, which means concatenating file chunks in memory when downloading from a git server. The dedicated method downloads in chunks, verifies the content on the fly, and creates the usercache hardlink if successful. It can also be used for the file system based remotestore. An explicit division of labor between downloading from a remote store (which should be verified) and writing to the store because of a commit or similar (which doesn't need verification), seems clearer. I can't figure out how to make a similar function for upload, because for a file remote store, it's a simple open/read/write operation. For a gitremote store, it's open the file and a urlreq.request(), and process that.
Tue, 02 Jan 2018 12:14:08 +0900 win32: do not call GetVolumePathName() with the minimum buffer length
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jan 2018 12:14:08 +0900] rev 35550
win32: do not call GetVolumePathName() with the minimum buffer length It fails on Windows XP even though the doc says "a safer but slower way to set the size of the return buffer is to call the GetFullPathName function, and then make sure that the buffer size is at least the same size as the full path that GetFullPathName returns." https://msdn.microsoft.com/en-us/library/windows/desktop/aa364996(v=vs.85).aspx Well, more "safe" way would be to simply rely on MAX_PATH for common scenarios.
Tue, 02 Jan 2018 12:02:25 +0900 win32: allocate buffer of maximum length for GetVolumeInformation()
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jan 2018 12:02:25 +0900] rev 35549
win32: allocate buffer of maximum length for GetVolumeInformation() It's documented that "the maximum buffer size is MAX_PATH+1", which is slightly larger than 256. https://msdn.microsoft.com/en-us/library/windows/desktop/aa364993(v=vs.85).aspx
Sun, 22 Oct 2017 22:49:11 +0900 log: drop unused expr from return value of getlogrevs()
Yuya Nishihara <yuya@tcha.org> [Sun, 22 Oct 2017 22:49:11 +0900] rev 35548
log: drop unused expr from return value of getlogrevs() Future patches will move some processing of the --follow option out of _makelogrevset(), where the returned 'expr' value will be less consistent with the 'revs'. So let's remove it from the public interface.
Thu, 04 Jan 2018 12:00:18 +0900 log: don't expand aliases in revset built from command options
Yuya Nishihara <yuya@tcha.org> [Thu, 04 Jan 2018 12:00:18 +0900] rev 35547
log: don't expand aliases in revset built from command options Only -rREV should be rewritten with user aliases.
Sun, 22 Oct 2017 22:52:36 +0900 graphlog: remove redundant check for empty revs
Yuya Nishihara <yuya@tcha.org> [Sun, 22 Oct 2017 22:52:36 +0900] rev 35546
graphlog: remove redundant check for empty revs
Sun, 22 Oct 2017 22:38:16 +0900 log: remove redundant handling of --limit
Yuya Nishihara <yuya@tcha.org> [Sun, 22 Oct 2017 22:38:16 +0900] rev 35545
log: remove redundant handling of --limit A returned 'revs' set is pre-filtered by cmdutil.getlogrevs(). The result of displayer.flush() isn't used anymore, so removed.
Sun, 22 Oct 2017 23:04:07 +0900 log: use smartset.slice() to limit number of revisions to be displayed
Yuya Nishihara <yuya@tcha.org> [Sun, 22 Oct 2017 23:04:07 +0900] rev 35544
log: use smartset.slice() to limit number of revisions to be displayed
Thu, 04 Jan 2018 10:51:41 +0900 log: merge getlogrevs() and getgraphlogrevs()
Yuya Nishihara <yuya@tcha.org> [Thu, 04 Jan 2018 10:51:41 +0900] rev 35543
log: merge getlogrevs() and getgraphlogrevs() cmdutil.graphlog() is updated to receive (revs, filematcher) as arguments to make sure that opts['graph'] is set when getlogrevs() is invoked.
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip