Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:46:05 -0700] rev 31681
rcutil: extract rc directory listing logic
The logic of listing a ".rc" directory is duplicated in two functions,
extract it to a single function to make the code cleaner.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:21:32 -0700] rev 31680
rcutil: split osrcpath to return default.d paths (API)
After this change, there are 3 rcpath functions:
- defaultrcpath
- systemrcpath
- userrcpath
This will allow us to insert another config layer in the middle.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:18:42 -0700] rev 31679
rcutil: move scmutil.*rcpath to rcutil (API)
As discussed at [1], the logic around "actual config"s seem to be
non-trivial enough that it's worth a new module.
This patch creates the module and move "scmutil.*rcpath" functions there as
the first step. More methods will be moved to the module in the future.
The module is different from config.py because the latter only cares about
data structure and parsing, and does not care about special case, or system
config paths, or environment variables.
[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/095503.html
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 17:25:23 +0900] rev 31678
statfs: make getfstype() raise OSError
It's better for getfstype() function to not suppress an error. Callers can
handle it as necessary. Now "hg debugfsinfo" will report OSError.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 17:24:11 +0900] rev 31677
statfs: rename pygetfstype to getfstype
There's no ambiguity now.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 17:23:21 +0900] rev 31676
statfs: refactor inner function as a mapping from statfs to string
The major difference between BSD and Linux is how to get a fstype string.
Let's split the longest part of getfstype() as a pure function.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 17:13:12 +0900] rev 31675
statfs: simplify handling of return value
Py_BuildValue() can translate NULL pointer to None.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 18:22:27 +0900] rev 31674
hghave: use util.getfstype
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 19:57:17 -0700] rev 31673
runtests: change local IP glob pattern from "127.0.0.1" to "$LOCALIP"
This is similar to what
348b2b9da703 does. Since
636cf3f7620d has changed
"127.0.0.1" to "$LOCALIP". The glob pattern needs update accordingly. It is
expected to fix tests running in some BSD jails.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 16:00:47 +0200] rev 31672
tags: deprecated 'repo.tag'
All user are gone. We can now celebrate the removal of some extra line from the
'localrepo' class.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 18:08:05 +0200] rev 31671
drawdag: use 'tagsmod.tag' instead of 'repo.tag'
The former is about to be deprecated.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 16:00:34 +0200] rev 31670
tags: use the 'tag' function from the 'tags' module in the 'tag' command
There is No need to go through the 'repo' object method anymore.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 15:58:31 +0200] rev 31669
tags: move 'repo.tag' in the 'tags' module
Similar logic, pretty much nobody use this method (that creates a tag) so we
move it into the 'tags' module were it belong.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Mon, 27 Mar 2017 15:55:07 +0200] rev 31668
tags: move '_tags' from 'repo' to 'tags' module
As far as I understand, that function do not needs to be on the local repository
class, so we extract it in the 'tags' module were it will be nice and
comfortable. We keep the '_' in the name since its only user will follow in the
next changeset.
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 13 Mar 2017 15:17:20 +0100] rev 31667
hgweb: filter diff hunks when 'linerange' and 'patch' are specified in filelog
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 13 Mar 2017 15:15:49 +0100] rev 31666
hgweb: add a 'linerange' parameter to webutil.diffs()
This is used to filter out hunks based on their range (with respect to 'node2'
for patch.diffhunks() call, i.e. 'ctx' for webutil.diffs()).
This is the simplest way to filter diff hunks, here done on server side. Later
on, it might be interesting to perform this filtering on client side and
expose a "toggle" action to alternate between full and filtered diff.
Denis Laxalde <denis.laxalde@logilab.fr> [Thu, 19 Jan 2017 17:41:00 +0100] rev 31665
hgweb: handle a "linerange" request parameter in filelog command
We now handle a "linerange" URL query parameter to filter filelog using
a logic similar to followlines() revset.
The URL syntax is: log/<rev>/<file>?linerange=<fromline>:<toline>
As a result, filelog entries only consists of revision changing specified
line range.
The linerange information is propagated to "more"/"less" navigation links but
not to numeric navigation links as this would apparently require a dedicated
"revnav" class.
Only update the "paper" template in this patch.
Kostia Balytskyi <ikostia@fb.com> [Sun, 26 Mar 2017 16:51:19 -0700] rev 31664
shelve: add logic to preserve active bookmarks
This adds an explicit active-bookmark-handling logic
to shelve. Traditional shelve handles it by transaction aborts,
but it is a bit ugly and having an explicit functionality
seems better.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 12:26:35 -0700] rev 31663
metadataonlyctx: speed up sanity check
Previously the sanity check will construct manifestctx for both p1 and p2.
But it only needs the "manifest node" information, which could be read from
changelog directly.
Denis Laxalde <denis.laxalde@logilab.fr> [Fri, 24 Feb 2017 18:39:08 +0100] rev 31662
revset: factor out linerange processing into a utility function
Similar processing will be done in hgweb.webutil in forthcoming changeset.
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 13 Mar 2017 10:41:13 +0100] rev 31661
hgweb: add a "patch" query parameter to filelog command
Add support for a "patch" query parameter in filelog web command similar to
--patch option of `hg log` to display the diff of each changeset in the table
of revisions. The diff text is displayed in a dedicated row of the table that
follows the existing one for each entry and spans over all columns. Only
update "paper" template in this patch.
Denis Laxalde <denis.laxalde@logilab.fr> [Mon, 13 Mar 2017 10:40:19 +0100] rev 31660
hgweb: handle "parity" internally in webutil.diffs()
There's apparently no reason to have the "parity" of diff blocks that
webutil.diffs() generates coming from outside the function. So have it
internally managed. We thus now pass a "web" object to webutil.diffs() to get
access to both "repo" and "stripecount" attribute.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 27 Mar 2017 09:44:36 +0900] rev 31659
largefiles: add lfile argument to updatestandin() for efficiency (API)
Before this patch, updatestandin() takes "standin" argument, and
applies splitstandin() on it to pick out a path to largefile (aka
"lfile" or so) from standin.
But in fact, all callers already knows "lfile". In addition to it,
many callers knows both "standin" and "lfile".
Therefore, making updatestandin() take only one of "standin" or
"lfile" is inefficient.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 27 Mar 2017 09:44:36 +0900] rev 31658
largefiles: use strip() instead of slicing to get rid of EOL of standin
This slicing prevents from replacing SHA-1 by another (= longer hash
value) in the future.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 27 Mar 2017 09:44:36 +0900] rev 31657
largefiles: rename local variable appropriately
repo['.'] is called not as "working context" but as "parent context".
In this code path, hash value of current content of file should be
compared against hash value recorded in "parent context".
Therefore, "wctx" may cause misunderstanding in this case.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 27 Mar 2017 09:44:35 +0900] rev 31656
largefiles: avoid redundant loop to eliminate None from list
Before this patch, this code path contains two loops for m._files: one
for replacement with standin, and another for elimination of None,
which comes from previous replacement ("standin in wctx or
lfdirstate[f] == 'r'" case in tostandin()).
These two loops can be unified into simple one "for" loop.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 27 Mar 2017 09:44:35 +0900] rev 31655
largefiles: avoid meaningless changectx looking up
Logically, "repo[ctx.node()]" should be equal to "ctx".
In addition to it, this redundant code path is repeated
"len(match.m_files)" times.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 27 Mar 2017 09:44:35 +0900] rev 31654
largefiles: avoid redundant changectx looking up at each repetitions
These code paths look up changectx at each repetitions, even though
the changectx key isn't changed while loop.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 27 Mar 2017 09:44:34 +0900] rev 31653
largefiles: omit updating newly added standin at linear merging
Updating standin for newly added largefile is needed, only if same
name largefile exists in destination context at linear merging. In
such case, updated standin is used to detect divergence of largefile
at overridefilemerge().
Otherwise, standin doesn't have any responsibility for its content
(usually, it is empty).
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 27 Mar 2017 09:44:34 +0900] rev 31652
largefiles: reuse hexsha1() to centralize hash calculation logic into it
This patch also renames argument of hexsha1(), not only for
readability ("data" isn't good name for file-like object), but also
for reviewability (including hexsha1() code helps reviewers to confirm
how these functions are similar).
BTW, copyandhash() has also similar logic, but it can't reuse
hexsha1(), because it writes read-in data into specified fileobj
simultaneously.
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Mar 2017 19:11:41 +0900] rev 31651
py3: prove second commit works
Finally it works.
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Mar 2017 19:06:48 +0900] rev 31650
py3: fix manifestdict.fastdelta() to be compatible with memoryview
This doesn't look nice, but a straightforward way to support Python 3.
bytes(m[start:end]) is needed because a memoryview doesn't support ordering
operations. On Python 2, m[start:end] returns a bytes object even if m is
a buffer, so calling bytes() should involve no additional copy.
I'm tired of trying cleaner alternatives, including:
a. extend memoryview to be compatible with buffer type
=> memoryview is not an acceptable base type
b. wrap memoryview by buffer-like class
=> zlib complains it isn't bytes-like
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 17:00:23 -0700] rev 31649
crecord: use ProgrammingError
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 16:59:30 -0700] rev 31648
transaction: use ProgrammingError
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 16:57:25 -0700] rev 31647
bundle2: use ProgrammingError
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 16:55:56 -0700] rev 31646
merge: use ProgrammingError
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 16:53:28 -0700] rev 31645
repair: use ProgrammingError
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Mar 2017 16:33:12 +0900] rev 31644
py3: abuse r'' to preserve str-ness of literals passed to __setattr__()
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Mar 2017 17:12:06 +0900] rev 31643
py3: fix slicing of byte string in revlog.compress()
I tried .startswith('\0'), but data wasn't always a bytes nor a bytearray.
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Mar 2017 16:31:01 +0900] rev 31642
py3: use bytes() to cast to immutable bytes in changelog.appender.write()
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Mar 2017 16:16:45 +0900] rev 31641
py3: use bytes() to cast to immutable bytes in pure.bdiff.bdiff()
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Mar 2017 16:14:04 +0900] rev 31640
bdiff: drop support for array.array argument from pure.bdiff.bdiff()
Thanks to
2a18e9e6ca43, we no longer pass array.array('c') object to
bdiff().
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Sun, 26 Mar 2017 15:55:34 +0200] rev 31639
histedit: test that an aborted histedit can be rerun (with obsolete)
In the future, this should help catching issue as the one introduced in
6f0b7475cf9a.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Sun, 26 Mar 2017 15:46:09 +0200] rev 31638
histedit: backout changeset
6f0b7475cf9a
Before
6f0b7475cf9a, histedit (like rebase) was only creating markers on final
success from the old-rewritten node to the newly created nodes (as of before
6f0b7475cf9a). In case of abort the aborted attempt were stripped to restore the
repository in its state prior to the attempt.
This use of strip was on purpose. Using markers in this case introduces various
issues. The main one is that keeping the partial result of histedit as obsolete
prevents us to recreates the same nodes in a second attempt. The same operation
will lead to an identical results, using an identical node that already exists
in the repository as obsolete.
To conclude, we cannot and should not switch to obsolescence markers creation on
histedit --abort and we backout
6f0b7475cf9a. A test to catch this class of
issue will be introduced in the next changeset.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Sun, 26 Mar 2017 15:34:39 +0200] rev 31637
histedit: backout changeset
2b599f5468a4
Its parent is about to be backedout so this one needs to be removed too.
Augie Fackler <raf@durin42.com> [Sun, 26 Mar 2017 16:48:29 -0400] rev 31636
revsetlang: fix _quote on int on python3
Thanks to Yuya for spotting the need.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:58:54 -0700] rev 31635
runtests: unset editor and pager related environment variables
Those environment variables could affect some configuration and future
tests. Drop them to avoid issues.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 17:59:33 -0700] rev 31634
debugfsinfo: improve case-sensitive testing
Previously the case-sensitive test was for the current directory, and is
fragile with errors, and could remove a real file called ".debugfsinfo".
This patch improves the case-sensitive testing so it test the given path
using a unique temporary file, and does not crash on errors.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 17:29:37 -0700] rev 31633
debugfsinfo: show fstype for given path
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 26 Mar 2017 21:10:25 +0530] rev 31632
test-check-py3-commands: cleanup tests related to `hg status`
We were testing hg status on Python 3 at two places in the test. Cleaned up
one of them.
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 26 Mar 2017 20:58:21 +0530] rev 31631
diff: use pycompat.{byteskwargs, strkwargs} to switch opts b/w bytes and str
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 26 Mar 2017 20:54:50 +0530] rev 31630
patch: make regular expressions bytes by adding b''
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 26 Mar 2017 20:49:18 +0530] rev 31629
dispatch: use pycompat.maplist() instead of map() to get a list
Matt Harbison <matt_harbison@yahoo.com> [Sat, 25 Mar 2017 13:29:23 -0400] rev 31628
color: fix grammar in help text
Jun Wu <quark@fb.com> [Sat, 25 Mar 2017 12:58:55 -0700] rev 31627
statfs: detect more filesystems on Linux
Previously, the code only has what manpager says. In <linux/magic.h>, there
are more defined. This patch adds filesystems that appear in the current
Arch Linux's /proc/filesystems (autofs, overlay, securityfs) and f2fs, which
was seen in news.
Matt Harbison <matt_harbison@yahoo.com> [Thu, 23 Mar 2017 23:47:23 -0400] rev 31626
repair: use context manager for lock management
If repo.lock() raised inside of the try block, 'tr' would have been None in the
finally block where it tries to release(). Modernize the syntax instead of just
winching the lock out of the try block.
I found several other instances of acquiring the lock inside of the 'try', but
those finally blocks handle None references. I also started switching some
trivial try/finally blocks to context managers, but didn't get them all because
indenting over 3x for lock, wlock and transaction would have spilled over 80
characters. That got me wondering if there should be a repo.rwlock(), to handle
locking and unlocking in the proper order.
It also looks like py27 supports supports multiple context managers for a single
'with' statement. Should I hold off on the rest until py26 is dropped?
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 24 Mar 2017 19:52:43 -0700] rev 31625
gitweb: use monospace font for commit messages
Commit messages often contain vertically aligned text. The default
paper style already uses monospace fonts for rendering commit messages.
And, AFAICT, a number of Git servers also render commit messages
with monospace. It seems like the reasonable thing to do.
This commit converts all instances of the full commit message
in the gitweb style to render with monospace.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 24 Mar 2017 22:40:08 -0400] rev 31624
pager: improve support for various flavors of `more` on Windows
Hardcoding 'more' -> 'more.com' means that 'more.exe' from MSYS would need to be
configured with its *.exe extension. This will resolve to either one, as
cmd.exe would have done if the command ran through the shell.
Something that's maybe problematic with this is it comes after 'pageractive' and
various ui configs have been set by the calling method. But the other early
exits in this method don't undo those changes either.
Jun Wu <quark@fb.com> [Fri, 24 Mar 2017 15:05:42 -0700] rev 31623
statfs: avoid static allocation
Previously we have "static struct statfs" to return a string. That is not
multiple-thread safe. This patch moves the allocation to the caller to
address the problem.
Jun Wu <quark@fb.com> [Fri, 24 Mar 2017 14:59:19 -0700] rev 31622
statfs: change Linux feature detection
Previously we check three things: "statfs" function, "linux/magic.h" and
"sys/vfs.h" headers. But we didn't check "struct statfs" or the "f_type"
field. That means if a system has "statfs" but "struct statfs" is not
defined in the two header files we check, or defined without the "f_type"
field, the compilation will fail.
This patch combines the checks (2 headers + 1 function + 1 field) together
and sets "HAVE_LINUX_STATFS". It makes setup.py faster (less checks), and
more reliable (immutable to the issue above).
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Mar 2017 16:20:10 -0700] rev 31621
rebase: don't require destination if commands.rebase.requiredest=False
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Mar 2017 16:20:04 -0700] rev 31620
tests: add tests with commands.{update,rebase}.requiredest=False
This shows how rebase is currently broken with
commands.rebase.requiredest=False.
Durham Goode <durham@fb.com> [Sun, 12 Mar 2017 12:33:35 -0700] rev 31619
rebase: move state serialization to use unfiltered repo
Now that rebasestate is serialized as part of the transaction, the repo state it
sees is the version at the end of the transaction, which may have hidden nodes.
Therefore, it's possible parts of the rebase commit set are no longer visible by
the time the transaction is closing, which causes a filtered revision error in
this code. I don't think state serialization should be blocked from accessing
commits it knows exist, especially if all it's trying to do is get the hex of
them, so let's use an unfiltered repo here.
Unfortunately, the only known repro is with the fbamend Facebook extension, so
I'm not sure how to repro it in core Mercurial for a test.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 24 Mar 2017 22:29:22 +0900] rev 31618
largefiles: avoid redundant standin() invocations
There are some code paths, which apply standin() on same value
multilpe times instead of using already standin()-ed value.
"fstandin" is common name for "path to standin file" in lfutil.py, to
avoid shadowing "standin()".
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 24 Mar 2017 22:29:22 +0900] rev 31617
largefiles: replace hashrepofile by hashfile (API)
There is only one user for the former, and repo.wjoin()-ed value is
alread known by that user.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 24 Mar 2017 22:26:34 +0900] rev 31616
largefiles: call readstandin() with changectx itself instead of rev or node
readstandin() takes "node" argument to get changectx by "repo[node]".
There are some readstandin() invocations, which use ctx.node(),
ctx.rev(), or '.' as "node" argument above, even though corresponded
changectx object is already looked up on caller side.
This patch calls readstandin() with already known changectx itself, to
avoid meaningless re-construction of changectx (indirect case via
copytostore() is also included).
BTW, copytostore() uses "rev" argument only for readstandin()
invocation. Therefore, this patch also renames it to "revorctx" to
indicate that it can take not only revision ID or so but also
changectx, for readability.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 24 Mar 2017 22:24:59 +0900] rev 31615
largefiles: omit redundant splitstandin() invocations
There are 3 splitstandin() invocations in updatestandin() for same
"standin" value.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 24 Mar 2017 22:24:59 +0900] rev 31614
largefiles: replace splitstandin() by isstandin() to omit str creation
If splitstandin()-ed str itself isn't used, isstandin() should be
used instead of it, to omit meaningless str creation.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 24 Mar 2017 22:24:58 +0900] rev 31613
largefiles: omit redundant isstandin() before splitstandin()
There are many isstandin() invocations before splitstandin().
The former examines whether specified path starts with ".hglf/". The
latter returns after ".hglf/" of specified path if it starts with that
prefix, or returns None otherwise.
Therefore, value returned by splitstandin() can be used for
replacement of preceding isstandin(), and this replacement can omit
redundant string comparison after isstandin().
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 24 Mar 2017 22:13:23 +0900] rev 31612
misc: update descriptions about removed file for filectxfn
Since
650b5b6e75ed, filectxfn for memctx should return None for
removed file instead of raising IOError.
Augie Fackler <augie@google.com> [Mon, 20 Mar 2017 17:58:44 -0400] rev 31611
osx: always purge build/mercurial before starting build
This prevents stray files from previous builds from polluting newer builds.
Augie Fackler <augie@google.com> [Mon, 20 Mar 2017 17:49:47 -0400] rev 31610
osx: use more paranoid quoting in test
Augie Fackler <augie@google.com> [Mon, 20 Mar 2017 17:50:05 -0400] rev 31609
osx: install completion scripts using install(1) to avoid umask badness
This actually fixes some tests that were showing us umask badness that
had been overlooked.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 24 Mar 2017 08:37:26 -0700] rev 31608
merge with stable
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:47:56 -0400] rev 31607
py3: prove `hg {add,addremove,commit} all work
We can't do a second commit in a repo yet, because pure-Python bdiff
is broken on Python 3. That is probably a good next step.
Augie Fackler <augie@google.com> [Thu, 23 Mar 2017 10:46:50 -0400] rev 31606
revsetlang: perform quoting using ui.escapestr instead of repr()
This changes one of the doctest results, but I'm pretty sure on
inspection that it's an equivalent result.
Augie Fackler <augie@google.com> [Thu, 23 Mar 2017 10:41:34 -0400] rev 31605
revsetlang: add docstring with some tests to _quote
Augie Fackler <augie@google.com> [Sun, 19 Mar 2017 01:14:19 -0400] rev 31604
revsetlang: move quoting function to not be a closure
I'm about to change the implementation here and I'd like to add some
doctests, which means this needs to not be hidden inside another
function.
Augie Fackler <augie@google.com> [Thu, 23 Mar 2017 10:33:20 -0400] rev 31603
revsetlang: portably bytestring-ify another pair of int() calls
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 21:23:21 -0700] rev 31602
checkcode: enforce lowercase for extension docstring title
This will ensure new extensions are consistent and `hg help -e` has a
consistent output.
I have to add a new group since the normal "pypats" will be filtered by
"pyfilters", which will remove comments and docstrings.
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 21:16:55 -0700] rev 31601
logtoprocess: use lowercase for docstring title
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 21:16:29 -0700] rev 31600
journal: use lowercase for docstring title
See the previous patch for why.
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 21:15:39 -0700] rev 31599
automv: use lowercase for docstring title
The first line of docstring is used in `hg help -e`. Use lowercase to be
consistent with most extensions.
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 22:31:50 -0700] rev 31598
util: enable hardlink for some BSD-family filesystems
Since we can now detect filesystems on FreeBSD and OSX. Add their major
filesystems (ufs, zfs for FreeBSD; hfs for OSX) to the hardlink whitelist.
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 22:13:02 -0700] rev 31597
osutil: report fstype for BSD and OSX
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 22:15:36 -0700] rev 31596
setup: use a more strict way to test BSD or OSX's statfs
We want to use the `f_fstypename` field to get the filesystem type. Test it
directly. The new macro HAVE_BSD_STATFS implys the old HAVE_SYS_MOUNT_H and
HAVE_SYS_PARAM_H. So the latter ones are removed.
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 12:03:19 -0700] rev 31595
debugfsinfo: use util.getfstype
This changes the behavior slightly. It now always prints fstype, regardless
of whether osutil.getfstype exists.
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 12:01:18 -0700] rev 31594
util: use util.getfstype
Jun Wu <quark@fb.com> [Thu, 23 Mar 2017 11:58:45 -0700] rev 31593
util: add a getfstype method
The util version is a thin wrapper of the osutil version, which is not
always available.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 20 Mar 2017 00:19:33 -0400] rev 31592
pager: fix the invocation of `more` on Windows
After
9335dc6b2a9c, with 'shell' being (mostly) set to False, invoking `more` no
longer worked. Instead, a warning was printed and the pager was disabled.
Invoking `more.com` works. Since a user may have configured 'pager.pager=more',
do this substitution at the end. Surprisingly, `more` does allow for arguments,
so those are preserved. This also allows `more` to work in MSYS.
Setting 'shell=False' runs the executable via CreateProcess(), which has rather
wonky rules for resolving an executable without an extension [1]. Resolving to
*.com is not among them. Since 'shell=True' yields a cryptic error for a bad
$PAGER, and a *.exe program will work without specifying the extension, sticking
with current 'shell=False' seems like the right thing to do. I don't think
there are any other *.com pagers out there, so this one special case seems OK.
If somebody wants to do something crazy that requires cmd.exe, I was able to get
normal paged output with 'pager.pager="cmd.exe /c more"'. I assume you can
replace `more` with *.bat, *.vbs or various other creatures listed in $PATHEXT.
[1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx
Martin von Zweigbergk <martinvonz@google.com> [Wed, 22 Mar 2017 16:36:53 -0700] rev 31591
help: format ``commands`` heading correctly
The number of dashes under it needs to match exactly for it to be
rendered as a heading. Without this change, the dashes end up on the
same line as "commands", and "hg help config.commands" does not work.
David Soria Parra <davidsp@fb.com> [Wed, 22 Mar 2017 14:12:58 -0500] rev 31590
convert: fix the handling of empty changlist descriptions in P4
Empty changelist descriptions are valid in Perforce. If we encounter one of
them we are currently running into an IndexError. In case of empty commit
messages set the commit message to **empty changelist description**, which
follows Perforce terminology.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 21 Mar 2017 17:50:44 -0700] rev 31589
status: support commands.status.relative config
When the config is set to true, status output becomes relative to the
working directory. This has bugged me since I started using hg and it
turns it is sillily simple to support it (unless I missed something,
of course).
We could also add a --relative flag, but I would personally always
want that on, and I haven't heard any use for having it sometimes on,
so this patch only lets you enable it via config.
Martin von Zweigbergk <martinvonz@google.com> [Tue, 21 Mar 2017 21:26:52 -0700] rev 31588
plain: ignore [commands] config
We only have commands.{update,rebase}.requiredest so far. We should
clearly ignore those two if HGPLAIN is in effect, and it seems like we
should ignore any future config that will be added in [commands] since
that is about changing the behavior of commands.
Thanks to Yuya for suggesting to centralize the code in ui.py.
While at it, remove the unnecessary False values passed to
ui.configbool() for the aforementioned config options.
Gregory Szorc <gregory.szorc@gmail.com> [Thu, 23 Mar 2017 19:54:59 -0700] rev 31587
changegroup: store old heads as a set
Previously, the "oldheads" variable was a list. On a repository at
Mozilla with 46,492 heads, profiling revealed that list membership
testing was dominating execution time of applying small changegroups.
This patch converts the list of old heads to a set. This makes
membership testing significantly faster. On the aforementioned
repository with 46,492 heads:
$ hg unbundle <file with 1 changeset>
before: 18.535s wall
after: 1.303s
Consumers of this variable only check for truthiness (`if oldheads`),
length (`len(oldheads)`), and (most importantly) item membership
(`h not in oldheads` - which occurs twice). So, the change to a set
should be safe and suitable for stable.
The practical effect of this change is that changegroup application
and related operations (like `hg push`) no longer exhibit an O(n^2)
CPU explosion as the number of heads grows.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 21 Mar 2017 23:30:13 +0100] rev 31586
checkheads: extract obsolete post processing in its own function
The checkheads function is long and complex, extract that logic in a subfunction
is win in itself. As the comment in the code says, this postprocessing is
currently very basic and either misbehave or fails to detect valid push in many
cases. My deeper motive for this extraction is to be make it easier to provide
extensive testing of this case and strategy to cover them. Final test and logic
will makes it to core once done.