Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 16:23:04 -0700] rev 31722
revlog: avoid unnecessary node -> rev conversion
Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 16:46:57 -0700] rev 31721
check-code: detect r.revision(r.node(rev))
revlog.revision takes either node or rev, but taking a rev is more
efficient, because converting rev to node is just a seek and read.
That's cheaper than converting node to rev, which may require O(n) walk in
revlog index for the first times, and then triggering building the radix
tree index. Even with the radix tree built, rev -> node is still faster than
node -> rev because the radix tree requires more jumps in memory.
So r.revision(r.node(rev)) should be changed to r.revision(rev). This patch
adds a check-code rule to detect that.
Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 12:37:03 -0700] rev 31720
hardlink: check directory's st_dev when copying files
Previously, when copying a file, copyfiles will compare src's st_dev with
dirname(dst)'s st_dev, to decide whether to enable hardlink or not.
That could have issues on Linux's overlayfs, where stating directories could
result in different st_dev from st_dev of stating files, even if both the
directories and the files exist in the overlay's upperdir.
This patch fixes it by checking dirname(src) instead. It's more consistent
because we are checking directories for both src and dest.
That fixes test-hardlinks.t running on common Docker setups.
Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 12:26:46 -0700] rev 31719
hardlink: duplicate hardlink detection for copying files and directories
A later patch will change one of them so they diverge.
Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 12:21:15 -0700] rev 31718
hardlink: extract topic text logic of copyfiles
The topic text shows whether it's "linking" or "copying", based on
"hardlink" value. The function is extracted so a later patch can reuse it.
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Mar 2017 14:56:58 +0530] rev 31717
tests: add check to make sure summary works on Python 2
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 29 Mar 2017 14:47:52 +0530] rev 31716
color: replace str() with pycompat.bytestr()
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 26 Mar 2017 20:52:51 +0530] rev 31715
diff: slice over bytes to make sure conditions work normally
Both of this are part of generating `hg diff` on python 3.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 29 Mar 2017 20:19:26 -0700] rev 31714
minirst: remove redundant _admonitions set
As Yuya pointed out during a review a month ago, _admonitions and
_admonitiontitles are largely redundant. With the last commit, they
are exactly redundant. So, remove _admonitions and use
_admonitiontitles.keys() instead.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 29 Mar 2017 20:05:18 -0700] rev 31713
minirst: remove "admonition" from _admonitions
The "admonition" rst primitive is split into "specific" admonitions
("attention," "caution," etc) and the "generic" admonition
("admonition"). For more, see
http://docutils.sourceforge.net/docs/ref/rst/directives.html#admonitions
The _admonitions set and keys of the _admonitiontitles dict
overlap exactly except _admonitions has an "admonition" entry.
Nowhere in Mercurial is the "admonition" admonition directive used.
Even if it were, it doesn't have a title, so it wouldn't be rendered
correctly.
So, let's remove "admonition" from the set of recognized admonition
directives.
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 29 Mar 2017 19:59:47 -0700] rev 31712
minirst: reindent _admonitiontitles
I don't like the verical indent.
While I was here, I cleaned up some whitespace and added a trailing
comma on the last element.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 28 Mar 2017 06:23:28 +0200] rev 31711
tags: extract filenode filtering into its own function
We'll also need to reuse this logic so we extract it into its own function. We
document some of the logic in the process.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 28 Mar 2017 06:08:12 +0200] rev 31710
tags: extract tags computation from fnodes into its own function
I'm about to introduce code that needs to perform such computation on
"arbitrary" nodes. The logic is extracted into its own function for reuse.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 28 Mar 2017 07:41:23 +0200] rev 31709
tags: only return 'alltags' in 'findglobaltags'
This is minor update along the way. We simplify the 'findglobaltags' function to
only return the tags. Since no existing data is reused, we know that all tags
returned are global and we can let the caller get that information if it cares
about it.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 28 Mar 2017 07:39:10 +0200] rev 31708
tags: make argument 'tagtype' optional in '_updatetags'
This is the next step from the previous changesets, we are now ready to use this
function in a simpler way.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 28 Mar 2017 07:38:10 +0200] rev 31707
tags: reorder argument of '_updatetags'
We move all arguments related to tagtype to the end, together. This will allow
us to make these arguments optional and reuse of this logic for callers that do
not care about the tag types.