Yuya Nishihara <yuya@tcha.org> [Fri, 12 Jan 2018 22:09:34 +0900] rev 35631
rust: extract function to convert Path to platform CString
It can be better on Unix.
Boris Feld <boris.feld@octobus.net> [Mon, 09 Oct 2017 11:46:27 +0200] rev 35630
pylint: add a check for multiple statement on a single line
Now that they are all cleaned up, we can install a check so that no new
occurrence appears.
Differential Revision: https://phab.mercurial-scm.org/D1834
Boris Feld <boris.feld@octobus.net> [Mon, 09 Oct 2017 11:45:21 +0200] rev 35629
style: remove multiple statement on a single line in zeroconf
Differential Revision: https://phab.mercurial-scm.org/D1833
Boris Feld <boris.feld@octobus.net> [Mon, 09 Oct 2017 11:44:02 +0200] rev 35628
style: remove multiple statement on a single line
This is similar to the change made in
5326e4ef1dab.
Differential Revision: https://phab.mercurial-scm.org/D1832
Boris Feld <boris.feld@octobus.net> [Mon, 09 Oct 2017 11:40:15 +0200] rev 35627
pylint: split command line argument on multiple lines
This clarify the important line in that configuration.
Differential Revision: https://phab.mercurial-scm.org/D1831
Tom Prince <mozilla@hocat.ca> [Sun, 14 Jan 2018 11:24:43 -0800] rev 35626
phabricator: use named group for parsing differential reviews lines
Differential Revision: https://phab.mercurial-scm.org/D1801
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jan 2018 13:47:10 +0900] rev 35625
vfs: drop text mode flag (API)
It's useless on Python 3.
.. api::
``text=False|True`` option is dropped from the vfs interface because of
Python 3 compatibility issue. Use ``util.tonativeeol/fromnativeeol()`` to
convert EOL manually.
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jan 2018 13:41:11 +0900] rev 35624
lfs: convert EOL of hgrc before appending to bytes IO
Text IO is useless on Python 3 as it must be a unicode stream.
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jan 2018 13:33:55 +0900] rev 35623
largefiles: convert EOL of hgrc before appending to bytes IO
Text IO is useless on Python 3 as it must be a unicode stream.
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jan 2018 13:31:27 +0900] rev 35622
share: convert EOL of hgrc before writing to bytes IO
Text IO is useless on Python 3 as it must be a unicode stream.
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jan 2018 13:28:12 +0900] rev 35621
subrepo: convert EOL of hgrc before writing to bytes IO
Follows up
f2f0a777b2e2. Text IO is useless on Python 3 as it must be a
unicode stream.
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jan 2018 13:24:17 +0900] rev 35620
clone: use utility function to write hgrc
Yuya Nishihara <yuya@tcha.org> [Sat, 13 Jan 2018 13:23:16 +0900] rev 35619
share: use context manager or utility function to write file
Matt Harbison <matt_harbison@yahoo.com> [Sun, 31 Dec 2017 02:54:49 -0500] rev 35618
lfs: migrate most file filtering from threshold to custom filter
Migrate `lfs.threshold` to more powerful `lfs.filter` added by
D4990618 so
people can specify what files to be stored in LFS with more flexibility.
This patch was authored by Jun Wu for the fb-experimental repo, to avoid using
matcher for efficiency[1]. All I've changed here is to register the new
'lfs.track' default so that the tests run cleanly, and adapt the subsequent
language changes. Migrating the remaining uses of 'lfs.threshold' can be done
separately since there's a fallback in place.
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-December/109388.html
Matt Harbison <matt_harbison@yahoo.com> [Sun, 31 Dec 2017 12:47:36 -0500] rev 35617
test-lfs: bump the number on test repo11 and higher
This will allow a Facebook patch that creates 'repo11' to be imported without
breaking a bunch of tests, or requiring edits on the fly.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jan 2018 22:23:34 -0500] rev 35616
fileset: add a lightweight file filtering language
This patch was inspired by one that Jun Wu authored for the fb-experimental
repo, to avoid using matcher for efficiency[1]. We want a way to specify what
files will be converted to LFS at commit time. And per discussion, we also want
to specify what files to skip, text diff, or merge in another config option.
The current `lfs.threshold` config option could not satisfy complex needs. I'm
putting it in a core package because Augie floated the idea of also using it for
narrow and sparse.
Yuya suggested farming out to fileset.parse(), which added support for more
symbols. The only fileset element not supported here is 'negate'. (List isn't
supported by filesets either.) I also changed the 'always' token to the 'all()'
predicate for consistency, and introduced 'none()' to improve readability in a
future tracked file based config. The extension operator was changed from '.'
to '**', to match how recursive path globs are specified. Finally, I changed
the path matcher from '/' to 'path:' at Yuya's suggestion, for consistency with
matcher. Unfortunately, ':' is currently reserved in filesets, so this has to
be quoted to be processed as a string instead of a symbol[2]. We should
probably revisit that, because it's seriously ugly. But it's only used by an
experimental extension, and I think using a file based config for LFS may drive
some more tweaks, so I'm settling for this for now.
I reserved all of the glob characters in fileset except '.' and '_' for the
extension test because those are likely valid extension characters.
Sample filter settings:
all() # everything
size(">20MB") # larger than 20MB
!**.txt # except for .txt files
**.zip | **.tar.gz | **.7z # some types of compressed files
"path:bin" # files under "bin" in the project root
[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-December/109387.html
[2] https://www.mercurial-scm.org/pipermail/mercurial-devel/2018-January/109729.html
Matt Harbison <matt_harbison@yahoo.com> [Wed, 10 Jan 2018 22:35:08 -0500] rev 35615
fileset: split the logic for matching a size expression to a separate method
This will be used in the next patch to build a simple filtering language, but
where we won't have an mctx.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 12 Jan 2018 23:13:38 -0500] rev 35614
lfs: drop deprecated remote store config options
The last of these were removed from fb-experimental in
86884a51e9aa, and we
might as well clean this up before the freeze.
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 12 Jan 2018 18:11:05 +0530] rev 35613
py3: use bytes instead of pycompat.bytestr
Follow up for
35fb3367f72d.
Differential Revision: https://phab.mercurial-scm.org/D1854
Joerg Sonnenberger <joerg@bec.de> [Fri, 12 Jan 2018 17:10:55 +0100] rev 35612
test-pull-r: explicitly kill server processes
Differential Revision: https://phab.mercurial-scm.org/D1855
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 05 Jan 2018 22:28:06 +0530] rev 35611
bookmarks: add bookmarks to hidden revs if directaccess config is set
This patch adds support to add bookmarks to hidden revs if
`experimental.directaccessi=True` config is set. A warning is also printed
saying "accessing hidden changeset <revhash>".
Differential Revision: https://phab.mercurial-scm.org/D1813
Boris Feld <boris.feld@octobus.net> [Fri, 12 Jan 2018 11:15:41 +0000] rev 35610
visibility: pass a normal repo to _getfilteredreason
There is no reason to pass an unfiltered-repo to _getfilteredreason and
successorssets, so use a normal repo instead.
Differential Revision: https://phab.mercurial-scm.org/D1853
Boris Feld <boris.feld@octobus.net> [Fri, 12 Jan 2018 11:10:18 +0000] rev 35609
visibility: make the filtered message translatable
Introduce a filtered message table to ease translation of these messages.
Differential Revision: https://phab.mercurial-scm.org/D1852
Boris Feld <boris.feld@octobus.net> [Fri, 12 Jan 2018 11:09:04 +0000] rev 35608
visibility: fix a comment introduced before which is not up-to-date
265cd9e19d26 introduced a comment in _filterederror that was not updated with
the latest iterations of the patch, fix the comment.
Differential Revision: https://phab.mercurial-scm.org/D1851
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 10 Jan 2018 19:24:58 -0800] rev 35607
rust: avoid redundant 'static lifetime
'static is apparently automatic for const variables.
Differential Revision: https://phab.mercurial-scm.org/D1846
Boris Feld <boris.feld@octobus.net> [Thu, 11 Jan 2018 11:57:59 +0000] rev 35606
pull: hold wlock for the full operation when --update is used
With now, the wlock is not held between the pull and the update. This can lead
to race condition and make logic checking to post pull results more complicated
(eg: with _afterlock).
Anton Shestakov <av6@dwimlabs.net> [Thu, 11 Jan 2018 18:20:08 +0800] rev 35605
hgweb: drop support of browsers that don't understand <canvas> (BC)
Internet Explorer 8 and below need excanvas aka ExplorerCanvas to support
canvas tag at all. We used to vendor the library in Mercurial, but IE8 was
discontinued and all support for it ceased in January 2016. We should do the
same and remove excanvas library.
Apart from just cleaning up code, this will also make downstream Debian
packages stop depending on libjs-excanvas, for example.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 10 Jan 2018 19:36:45 -0800] rev 35604
rust: add TODO about lifetime of program_name variable
Per review comment in D1581.
Differential Revision: https://phab.mercurial-scm.org/D1847
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 10 Jan 2018 19:23:36 -0800] rev 35603
rust: move import of PathBuf
By moving it to the single function that uses it, we eliminate a
#cfg.
Differential Revision: https://phab.mercurial-scm.org/D1845
Jun Wu <quark@fb.com> [Wed, 10 Jan 2018 21:09:57 -0800] rev 35602
perf: do not import util.queue
This was added by
af25237be091. But util.queue is not a module and is not
importable. I guess it wasn't noticed because of demandimport.
Differential Revision: https://phab.mercurial-scm.org/D1848
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 10 Jan 2018 19:08:51 -0800] rev 35601
rust: move Cargo.lock
If you do a `cargo build` in rust/, Cargo will create rust/Cargo.lock.
Furthermore, the previous rust/hgcli/Cargo.lock appears to not even be
consulted because the auto-generated rust/Cargo.lock varied from
rust/hgcli/Cargo.lock.
This commit moves Cargo.lock to where Cargo expects it to be.
While we're here, bump the version of libc to the latest available.
Differential Revision: https://phab.mercurial-scm.org/D1844
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 10 Jan 2018 19:04:52 -0800] rev 35600
run-tests: fix regular expression for path test
The previous regexp would match the empty string. This fixes
a mistake added in
964212780daf.
Differential Revision: https://phab.mercurial-scm.org/D1843
Boris Feld <boris.feld@octobus.net> [Sun, 17 Dec 2017 04:31:27 +0100] rev 35599
perf: add threading capability to perfbdiff
Since we are releasing the GIL during diffing, it is interesting to see how a
thread pool would perform on diffing. We add a new `--threads` argument to
commands. Synchronizing the thread pool is a bit complex because we want to be
able to reuse it from one run to another.
On my computer (i7 with 4 cores + hyperthreading), I get the following data for
about 12000 revisions:
threads wall comb wall gain comb overhead
none 31.596715 31.59 0.00% 0.00%
1 31.621228 31.62 -0.08% 0.09%
2 16.406202 32.8 48.08% 3.83%
3 11.598334 34.76 63.29% 10.03%
4 9.205421 36.77 70.87% 16.40%
5 8.517604 42.51 73.04% 34.57%
6 7.94645 47.58 74.85% 50.62%
7 7.434972 51.92 76.47% 64.36%
8 7.070638 55.34 77.62% 75.18%
Compared to the feature disabled (threads=0), the overhead is negligible with
the threading code (threads=1), and the gain is already 48% with two threads.
Paul Morelle <paul.morelle@octobus.net> [Wed, 10 Jan 2018 17:24:25 +0100] rev 35598
upgraderepo: select correct deltareuse depending on actions
Only 'redeltafulladd' was taken into account because of a small typo.
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jan 2018 18:35:11 +0900] rev 35597
revsetlang: add %p specifier to format list of function arguments
This will be used to construct parameters passed to _matchfiles().
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jan 2018 21:05:40 +0900] rev 35596
revsetlang: unnest inner functions from formatspec()
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 17:51:56 +0900] rev 35595
revsetlang: fix quoting of %ls string
Before, "'" wasn't escaped appropriately. This also changes the separator
'\0' to '\\0', but that's okay as a string token is unescaped.
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 17:44:07 +0900] rev 35594
revsetlang: catch invalid value passed to formatspec()
The scope of AttributeError is narrowed because it's more likely to be
triggered by mistake.
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 17:28:28 +0900] rev 35593
revsetlang: check incomplete revspec format character
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 17:25:45 +0900] rev 35592
revsetlang: check number of arguments passed to formatspec()
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 17:18:31 +0900] rev 35591
revsetlang: catch invalid format character with %l prefix
listexp() could call argtype() with an invalid format character, but that
wasn't checked before.
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 06:32:17 +0530] rev 35590
py3: add 8 new passing tests to the whitelist
Differential Revision: https://phab.mercurial-scm.org/D1800
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:33:36 +0530] rev 35589
py3: use list() to get a list of items using dict.items()
dict.items() on Python 3 returns a generator over the values of the dictionary,
hence we can't delete elements while iterating over dict.items() in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D1799
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:31:27 +0530] rev 35588
py3: convert dict keys' to str before passing as kwargs
We have pycompat.strkwargs() which converts the keys of a dict to str and
returns that.
Differential Revision: https://phab.mercurial-scm.org/D1798
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:29:57 +0530] rev 35587
py3: make sure we open the file to write in bytes mode
Differential Revision: https://phab.mercurial-scm.org/D1797
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:47:17 +0530] rev 35586
py3: don't use dict.iterkeys()
Instead of iterating of dict.iterkeys(), let's iterate of dict as that will be
equivalent and dict.iterkeys() is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D1796
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:29:04 +0530] rev 35585
py3: use pycompat.bytestr() instead of str()
Differential Revision: https://phab.mercurial-scm.org/D1795
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:28:05 +0530] rev 35584
py3: make regular expressions bytes by prepending b''
Regexes start with r'' and hence transformer skips adding b'' there.
# skip-blame because we are just adding b''
Differential Revision: https://phab.mercurial-scm.org/D1794
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:27:00 +0530] rev 35583
py3: slice on bytes instead of indexing
Indexing returns the ascii value on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D1793
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:25:27 +0530] rev 35582
py3: use node.hex(h.digest()) instead of h.hexdigest()
hashlib.sha1.hexdigest() returns str on Python 3.
Differential Revision: https://phab.mercurial-scm.org/D1792
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:22:06 +0530] rev 35581
tests: make autodiff.py work on Python 3
This patch adds b'' to string literal to make it compatible with in-core Python
3 compatibility.
# skip-blame because we are just adding b''
Differential Revision: https://phab.mercurial-scm.org/D1791
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 03:32:04 +0530] rev 35580
py3: use pycompat.ziplist instead of inbuilt zip
zip just like map on Python 3 returns a generator object instead of list. This
results in error if we try to iterate over the result once we consume it. We
have added pycompat.ziplist which returns a list.
Differential Revision: https://phab.mercurial-scm.org/D1790
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 29 Dec 2017 05:35:57 +0530] rev 35579
py3: use bytes and open() instead of file() in test-diff-upgrade.t
file() is not present in Python 3.
Differential Revision: https://phab.mercurial-scm.org/D1789
Martin von Zweigbergk <martinvonz@google.com> [Wed, 10 Jan 2018 11:02:20 -0800] rev 35578
exchange: use context manager for locks and transaction in unbundle()
Note that the transactionmanager doesn't actually create a transaction
-- that is done the first time .transaction() is called on it (if at
all). Consequently, .close() and .release() won't do anything if no
transaction has been created. This makes it a little unusual, but it
still works as a context manager.
Differential Revision: https://phab.mercurial-scm.org/D1841
Martin von Zweigbergk <martinvonz@google.com> [Wed, 10 Jan 2018 10:49:12 -0800] rev 35577
bookmarks: use context managers for locks and transaction in pushbookmark()
Differential Revision: https://phab.mercurial-scm.org/D1840
Martin von Zweigbergk <martinvonz@google.com> [Wed, 10 Jan 2018 10:47:13 -0800] rev 35576
bookmarks: use context managers for lock and transaction in update()
Differential Revision: https://phab.mercurial-scm.org/D1839
Martin von Zweigbergk <martinvonz@google.com> [Wed, 10 Jan 2018 10:44:21 -0800] rev 35575
phase: use context managers for lock and transaction
Differential Revision: https://phab.mercurial-scm.org/D1838
Martin von Zweigbergk <martinvonz@google.com> [Wed, 10 Jan 2018 10:33:11 -0800] rev 35574
obsolete: use context manager for transaction in pushmarker()
Differential Revision: https://phab.mercurial-scm.org/D1837
Martin von Zweigbergk <martinvonz@google.com> [Wed, 10 Jan 2018 10:32:16 -0800] rev 35573
obsolete: use context manager for lock in pushmarker()
Differential Revision: https://phab.mercurial-scm.org/D1836
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
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
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
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
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.
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.
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.
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.
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
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.
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.
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.
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 17:04:49 +0900] rev 35560
revsetlang: use iterator to track current argument in formatspec()
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 16:56:47 +0900] rev 35559
revsetlang: unnest "if True" in formatrevspec()
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.
Yuya Nishihara <yuya@tcha.org> [Sat, 01 Apr 2017 16:50:11 +0900] rev 35557
revsetlang: avoid string concatenation in formatspec()
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".
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.
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.
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.
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.
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.
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.
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
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.
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.
Yuya Nishihara <yuya@tcha.org> [Sun, 22 Oct 2017 22:52:36 +0900] rev 35546
graphlog: remove redundant check for empty revs
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.
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
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.
Yuya Nishihara <yuya@tcha.org> [Sat, 30 Dec 2017 17:55:23 +0900] rev 35542
revset: parse x^:: as (x^):: (
issue5764)
We have to make '::' a valid primary expression to parse 'x^::' as '(x)^(::)'
first, but that doesn't change the language because a prefix operator '::y'
precedes a primary '::'.
I can't think of an intuitive meaning of '::', so it's just rejected. Given
'x::y' can be considered to default to {x = roots(), y = heads()}, '::' could
be 'roots()::heads()', which seems not any useful.
Jun Wu <quark@fb.com> [Mon, 08 Jan 2018 16:07:51 -0800] rev 35541
test-run-tests: stabilize the test (
issue5735)
Previously there is a race condition because things happen in this order:
1. Check shouldStop
2. If shouldStop is false, print the diff
3. Call fail() -> set shouldStop
The check and set should really happen in a same critical section.
This patch adds a lock to address the issue.
Test Plan:
Run `run-tests.py -l test-run-tests.t` 20 times on gcc112 and the race
condition does not reproduce.
Differential Revision: https://phab.mercurial-scm.org/D1830
Mihai Popescu <mihai@unity3d.com> [Mon, 08 Jan 2018 13:52:43 +0100] rev 35540
run-tests: avoid set PYTHONUSERBASE environment variable to None
According to python documentation, get_config_var can return None and it was
during running mercurial tests under a virtual environment with the local built
mercurial installed as a python package with `pip install -e .`.
On the other hand, if mercurial is installed in the user library folders with
`pip install --local -e .` the issue doesn't reproduce.
The fallback is that it will just set an empty string and everything should work
as before, according to https://www.python.org/dev/peps/pep-0370/:
The path to the user base directory can be overwritten with the environment
variable PYTHONUSERBASE. The default location is used when PYTHONUSERBASE is
not set or empty.
Yuya Nishihara <yuya@tcha.org> [Sun, 07 Jan 2018 12:07:29 +0900] rev 35539
templatefilters: fix doc of basename()
os.path.basename() does NOT strip trailing slashes.
> Note that the result of this function is different from the Unix basename
> program; where basename for '/foo/bar/' returns 'bar', the basename()
> function returns an empty string ('').
https://docs.python.org/2.7/library/os.path.html#os.path.basename
Yuya Nishihara <yuya@tcha.org> [Sun, 07 Jan 2018 15:56:58 +0900] rev 35538
identify: document -r. explicitly how to disable wdir scanning (
issue5622)
Matt Harbison <matt_harbison@yahoo.com> [Fri, 05 Jan 2018 21:48:29 -0500] rev 35537
lfs: add a comment to describe subtle local blobstore open() behavior
Martin von Zweigbergk <martinvonz@google.com> [Fri, 05 Jan 2018 11:53:33 -0800] rev 35536
tests: make #testcase available as env var in test
It can be useful for e.g. helper functions to behave differently
depending on which test case is being executed. This patch helps with
that by making the #testcase case available as a TESTCASE environment
variable.
Differential Revision: https://phab.mercurial-scm.org/D1816
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 05 Jan 2018 19:30:37 +0530] rev 35535
archive: add support to specify hidden revs if directaccess config is set
Differential Revision: https://phab.mercurial-scm.org/D1812
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 05 Jan 2018 19:23:30 +0530] rev 35534
annotate: add support to specify hidden revs if directaccess config is set
Differential Revision: https://phab.mercurial-scm.org/D1811
Anton Shestakov <av6@dwimlabs.net> [Fri, 05 Jan 2018 19:30:30 +0800] rev 35533
hgweb: stop adding strings to innerHTML of #graphnodes and #nodebgs (BC)
There's nothing that uses this functionality anymore, since all HTML is
generated server-side now. Changeset entries are still accessible in JS via
DOM (that's how we set left padding), so it's still possible to do something
unusual by overriding Graph.prototype.vertex().
Anton Shestakov <av6@dwimlabs.net> [Fri, 05 Jan 2018 19:22:05 +0800] rev 35532
spartan: make actual changeset entries have backgrounds on /graph
This patch removes a separate container for backgrounds only and puts
backgrounds on changeset elements themselves. This makes it so that JS code
doesn't need to create background elements separately anymore.
There's a bit of manipulating positions of elements: every changeset entry has
a "fg" element that gets a higher z-index than <canvas> element. This
prioritizes text information, so that even if it somehow gets close to the
graph drawn on <canvas> (which has z-index of 5), it'll still be on top of it.
This can happen if commit message has a long first line and browser window is
narrow, for example.
Anton Shestakov <av6@dwimlabs.net> [Fri, 05 Jan 2018 19:16:08 +0800] rev 35531
gitweb: make actual changeset entries have backgrounds on /graph
This patch removes a separate container for backgrounds only and puts
backgrounds on changeset elements themselves. This makes it so that JS code
doesn't need to create background elements separately anymore.
There's a bit of manipulating positions of elements: every changeset entry has
a "fg" element that gets a higher z-index than <canvas> element. This
prioritizes text information, so that even if it somehow gets close to the
graph drawn on <canvas> (which has z-index of 5), it'll still be on top of it.
This can happen if commit message has a long first line and browser window is
narrow, for example.
Anton Shestakov <av6@dwimlabs.net> [Fri, 05 Jan 2018 19:08:00 +0800] rev 35530
monoblue: make actual changeset entries have backgrounds on /graph
This patch removes a separate container for backgrounds only and puts
backgrounds on changeset elements themselves. This makes it so that JS code
doesn't need to create background elements separately anymore.
There's a bit of manipulating positions of elements: every changeset entry has
a "fg" element that gets a higher z-index than <canvas> element. This
prioritizes text information, so that even if it somehow gets close to the
graph drawn on <canvas> (which has z-index of 5), it'll still be on top of it.
This can happen if commit message has a long first line and browser window is
narrow, for example.
'parity' is added to each entry because there's no stripes2 class in monoblue,
only in paper.
Anton Shestakov <av6@dwimlabs.net> [Fri, 05 Jan 2018 18:46:06 +0800] rev 35529
paper: make actual changeset entries have backgrounds on /graph
This patch removes a separate container for backgrounds only and puts
backgrounds on changeset elements themselves. This makes it so that JS code
doesn't need to create background elements separately anymore.
There's a bit of manipulating positions of elements: every changeset entry has
a "fg" element that gets a higher z-index than <canvas> element. This
prioritizes text information, so that even if it somehow gets close to the
graph drawn on <canvas> (which has z-index of 5), it'll still be on top of it.
This can happen if commit message has a long first line and browser window is
narrow, for example.
Elmar Bartel <elb_hg@leo.org> [Thu, 04 Jan 2018 12:34:40 +0100] rev 35528
crecord: fallback to color = no when curses.use_default_colors() fails
Even when python was setup/compiled with curses, curses.use_default_colors()
may raise a curses exception when the TERM environment variable
specifies a value where no propper color configuration is possible.
This patch falls back to non-color mode to let the user continue
instead of failing with an unhandled exception.
Elmar Bartel <elb_hg@leo.org> [Thu, 04 Jan 2018 12:12:07 +0100] rev 35527
crecord: honor "ui.color = no" config option
The current implementation of crecord ignores the ui.color setting.
This patch checks the ui.color config option and does the curses setup
without colors when the option is set to a falsy value. For other (or
missing) setting of ui.color, curses setup is done as before and uses
colors.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 02 Jan 2018 21:46:57 -0500] rev 35526
lfs: use the local store method for opening a blob
I noticed that when I cloned without updating and then turned around and pushed
that clone to an lfs server, it was only trying to find the blob in the local
store.
Writes to the dummyremote (file based store) use local.read(), which looks at
both the usercache and local store.
Matt Harbison <matt_harbison@yahoo.com> [Tue, 02 Jan 2018 21:18:30 -0500] rev 35525
lfs: add a local store method for opening a blob
The has() and read() methods already dynamically switch between the usercache
and local store. This should generally be preferred to directly accessing the
vfs instances outside of the store.
The file is now explicitly opened in binary mode for clarity. (It was also
being opened in binary mode before, but only because vfs.__call__() appends 'b'
if needed when not opening with 'text=True'.)
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 05 Jan 2018 17:23:55 +0530] rev 35524
hgdemandimport: use correct hyperlink to python-bug in comments (
issue5765)
Differential Revision: https://phab.mercurial-scm.org/D1810
Anton Shestakov <av6@dwimlabs.net> [Wed, 03 Jan 2018 10:37:49 +0800] rev 35523
monoblue: adjust font size of graph entries
/shortlog uses 1.1em font for changesets, so it makes sense to use the same
size on /graph too. In practice, 1.2em is 14.784px, and 1.1em is 13.552px.
Anton Shestakov <av6@dwimlabs.net> [Wed, 03 Jan 2018 09:41:01 +0800] rev 35522
hgweb: make .info a block element by default
Using a <div> instead of a <span> with "display: block" makes more sense.
While at it, let's adjust top margin in monoblue so that text in .info doesn't
overlap changeset "tags" elements (they are quite large in monoblue).
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 25 Dec 2017 16:31:14 -0700] rev 35521
revlog: don't use slicing to return parents
This is the only place we use a slice on index entries, which
are currently tuples. In preparation for moving away from tuples,
let's stop using slices so we don't have to implement that support
on the new type.
We also tweak the logic slightly so the exception only catches the
IndexError on the index lookup, not on the index entry lookup. The
old code should never have been buggy. But it was semantically wrong.
Differential Revision: https://phab.mercurial-scm.org/D1764
Kyle Lippincott <spectral@google.com> [Thu, 04 Jan 2018 16:29:03 -0800] rev 35520
tests: switch test from '--config ui.editor=~/foo' to HGEDITOR=~/foo
The test is currently not testing anything, the '--config ui.editor=~/path'
argument is apparently of lower priority than the HGEDITOR that run-tests.py is
setting.
Differential Revision: https://phab.mercurial-scm.org/D1809
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 27 Dec 2017 00:24:53 +0530] rev 35519
revert: support reverting to hidden cset if directaccess config is set
This patch adds support for reverting files to a hidden changeset if
`experimental.directacess=True` is set.
Differential Revision: https://phab.mercurial-scm.org/D1763
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 27 Dec 2017 00:14:00 +0530] rev 35518
update: support updating to hidden cset if directaccess config is set
This patch adds support for updating to a hidden changeset without using
--hidden if `experimental.directacces=True` is set. The update command will
print out a warning when updating to a hidden changeset saying:
`updating to a hidden changeset <hash>`
The warning is also printed when directaccess is not used and --hidden is
passed which I think is good behaviour. Tests are added for the directaccess
part and updated output of tests which have case of updating to hidden cset
using `--hidden`.
Differential Revision: https://phab.mercurial-scm.org/D1762
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 26 Dec 2017 22:54:45 +0530] rev 35517
commands: check for empty rev before passing to scmutil.unhidehashlikerevs
Differential Revision: https://phab.mercurial-scm.org/D1760
Elmar Bartel <elb@leo.org> [Mon, 01 Jan 2018 16:48:31 +0100] rev 35516
test-convert-cvs: change TZ=US/Hawaii to TZ=Pacific/Johnston
The former was limited to be known on Linux and the test failed on FreeBSD
and Solaris platforms. The newer is known on Linux, FreeBSD and Solaris.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 29 Dec 2017 23:55:52 -0500] rev 35515
osutil: implement getfsmountpoint() on BSD systems
I don't have a BSD system handy to test this, but it looks simple enough from
the man page.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 29 Dec 2017 23:50:42 -0500] rev 35514
debugfs: display the tested path and mount point of the filesystem, if known
While implementing win32.getfstype(), I noticed that MSYS path mangling is
getting in the way. Given a path \\host\share\dir:
- If strong quoted, hg receives it unchanged, and it works as expected
- If double quoted, it converts to \host\share\dir
- If unquoted, it converts to \hostsharedir
The second and third cases are problematic because those are valid paths
relative to the current drive letter, so os.path.realpath() will expand it as
such. The net effect is to silently turn a network path test into (typically) a
"C:\" test. Additionally, the command hangs after printing out 'symlink: no'
for the third case (but is interruptable with Ctrl + C). This path mangling
only comes into play because of the command line arguments- it won't affect
internally obtained paths. Therefore, the simplest thing to do is to provide
feedback on what the command is acting on.
I also added the mount point, because Windows supports nesting [1] volumes (see
the examples in "Junction Points and Mounted Folders"), and it was a useful
diagnostic for figuring out why the wrong filesystem was printed out in the
cases above.
I opted not to call os.path.realpath() on the path argument, to make it clearer
that the mangling isn't being done by Mercurial.
[1] https://msdn.microsoft.com/en-us/library/windows/desktop/
aa364996(v=vs.85).aspx
Matt Harbison <matt_harbison@yahoo.com> [Fri, 29 Dec 2017 22:54:14 -0500] rev 35513
util: add a function to show the mount point of the filesystem
For now, this is Windows only, since Linux doesn't have the value in its statfs
structure, and I don't have a BSD system to test with.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 29 Dec 2017 22:15:37 -0500] rev 35512
win32: split a utility function to obtain the volume out of getfstype()
This is only done on Windows because it's simple enough to call statfs() on
Unix. The goal is to display this in `hg debugfs`.