Jun Wu <quark@fb.com> [Thu, 30 Mar 2017 18:24:23 -0700] rev 31759
revlog: use raw revisions in clone
test-revlog-raw.py now shows "clone test passed", but there is more to fix.
Jun Wu <quark@fb.com> [Thu, 30 Mar 2017 18:23:27 -0700] rev 31758
revlog: use raw revisions in revdiff
See the added comment. revdiff is meant to output the raw delta that will be
written to revlog. It should use raw.
test-revlog-raw.py now shows "addgroupcopy test passed", but there is more
to fix.
Jun Wu <quark@fb.com> [Thu, 30 Mar 2017 17:58:03 -0700] rev 31757
revlog: use raw content when building delta
Using external content provided by flagprocessor when building revlog delta
is wrong, because deltas are applied to raw contents in revlog.
This patch fixes the above issue by adding "raw=True".
test-revlog-raw.py now shows "local test passed", but there is more to fix.
Jun Wu <quark@fb.com> [Thu, 30 Mar 2017 15:34:08 -0700] rev 31756
revlog: fix _cache usage in revision()
As documented at revlog.__init__, revlog._cache stores raw text.
The current read and write usage of "_cache" in revlog.revision lacks of
raw=True check.
This patch fixes that by adding check about raw, and storing rawtext
explicitly in _cache.
Note: it may slow down cache hit code path when raw=False and flags=0. That
performance issue will be fixed in a later patch.
test-revlog-raw now points us to a new problem.
Jun Wu <quark@fb.com> [Thu, 30 Mar 2017 14:56:09 -0700] rev 31755
revlog: rename some "text"s to "rawtext"
This makes code easier to understand. "_addrevision" is left untouched - it
will be changed in a later patch.
Jun Wu <quark@fb.com> [Thu, 30 Mar 2017 07:59:48 -0700] rev 31754
revlog: clarify flagprocessor documentation
The words "text", "newtext", "bool" could be confusing. Use explicit "text"
or "rawtext" and document more about the "bool".
Jun Wu <quark@fb.com> [Thu, 30 Mar 2017 20:48:57 -0700] rev 31753
revlog: add a stronger test for raw processing
There are some issues about revlog raw processing (flag processor). The test
is relatively strong covering many cases. It will verify fixes.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 31 Mar 2017 11:53:56 +0200] rev 31752
hook: add hook name information to external hook
While we are here, we can also add the hook name information to external hook.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 31 Mar 2017 11:08:11 +0200] rev 31751
hook: provide hook type information to external hook
The python hooks have access to the hook type information. There is not reason
for external hook to not be aware of it too.
For the record my use case is to make sure a hook script is configured for the
right type.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 31 Mar 2017 11:06:42 +0200] rev 31750
hook: use 'htype' in 'hook'
Same rational as for 'runhooks', we fix the naming in another function.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 31 Mar 2017 11:03:23 +0200] rev 31749
hook: use 'htype' in 'runhooks'
Same rational as for '_pythonhook', 'htype' is more accurate and less error
prone. We just fixed an error from the 'name'/'hname' confusion and this should
prevent them in the future.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 31 Mar 2017 11:02:05 +0200] rev 31748
hook: fix name used in untrusted message
The name used in the message we issue when a hook is untrusted was using "name"
which is actually the hook type and not the name of the hook.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Fri, 31 Mar 2017 10:59:37 +0200] rev 31747
hook: use "htype" as variable name in _pythonhook
We rename 'name' to 'htype' because it fits the variable content better.
Multiple python hooks already use 'htype' as a name for the argument. This makes
the difference with "hname" clearer and the code less error prone.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Thu, 30 Mar 2017 17:29:03 +0200] rev 31746
run-tests: auto-replace 'TXNID' output
Hooks related to the transaction are aware of the transaction id. By definition
this txn-id is unique and different for each transaction. As a result it can
never be predicted in test and always needs matching. As a result, touching any
like with this data is annoying. We solve the problem once and for all by
installing an automatic replacement. In test, this will now show as:
TXNID=TXN:$ID$
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 01 Apr 2017 02:32:49 +0900] rev 31745
largefiles: use readasstandin() to read hex hash directly from filectx
BTW, C implementation of hexdigest() for SHA-1/256/512 returns hex
hash in lower case, and doctest in Python standard hashlib assumes
that, too. But it isn't explicitly described in API document or so.
Therefore, we can't assume that hexdigest() always returns hex hash in
lower case, for any hash algorithms, on any Python runtimes and
versions.
From point of view of that, it is reasonable for portability that
40800668e019 applies lower() on hex hash in overridefilemerge().
But on the other hand, in largefiles extension, there are still many
code paths comparing between hex hashes or storing hex hash into
standin file, without lower().
Switching to hash algorithm other than SHA-1 may be good chance to
clarify our policy about hexdigest()-ed hash value string.
- assume that hexdigest() always returns hex hash in lower case, or
- apply lower() on hex hash in appropriate layers to ensure
lower-case-ness of it for portability
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 01 Apr 2017 02:32:49 +0900] rev 31744
largefiles: remove unused readstandin()
Now, there is no client of readstandin().
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 01 Apr 2017 02:32:48 +0900] rev 31743
largefiles: make copytostore() accept only changectx as the 2nd argument (API)
As the name describes, the 2nd argument 'revorctx' of copytostore()
can accept non-changectx value, for historical reason,
But, since 10561eb97c7f, copyalltostore(), the only one copytostore()
client in Mercurial source tree, always passes changectx as
'revorctx'.
Therefore, it is reasonable to make copytostore() accept only
changectx as the 2nd argument, now.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 01 Apr 2017 02:32:48 +0900] rev 31742
largefiles: remove unused keyword argument of copytostore() (API)
AFAIK, 'uploaded' argument of copytostore() (or copytocache(), before
renaming at c65f5b6e26d4) has been never used both on caller and
callee sides, since official release of bundled largefiles extension.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 01 Apr 2017 02:32:48 +0900] rev 31741
largefiles: add copytostore() fstandin argument to replace readstandin() (API)
copyalltostore(), only one caller of copytostore(), already knows
standin file name of the target largefile. Therefore, passing it to
copytostore() is more efficient than calculating it in copytostore()
or readstandin().
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 01 Apr 2017 02:32:47 +0900] rev 31740
largefiles: replace readstandin() by readasstandin()
These code paths already (or should, for efficiency at repetition)
know the target changectx and path of standin file.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Sat, 01 Apr 2017 02:32:31 +0900] rev 31739
largefiles: introduce readasstandin() to read hex hash from given filectx
This will be used to centralize and encapsulate the logic to read hash
from given (filectx of) standin file. readstandin() isn't suitable for
this purpose, because there are some code paths, which want to read
hex hash directly from filectx.
Ryan McElroy <rmcelroy@fb.com> [Thu, 30 Mar 2017 03:50:10 -0700] rev 31738
rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514)
Previously, the pull would succeed, but the subsequent rebase would fail due
to the rebase.requiredest flag. Now abort earlier with a more useful error
message.
Ryan McElroy <rmcelroy@fb.com> [Thu, 30 Mar 2017 03:50:10 -0700] rev 31737
rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com> [Thu, 30 Mar 2017 03:50:10 -0700] rev 31736
rebase: allow destination-free continue and abort (issue5513)
Ryan McElroy <rmcelroy@fb.com> [Thu, 30 Mar 2017 03:50:10 -0700] rev 31735
rebase: test to show brokenness with requiredest
As shown in issue5513, --continue is broken when destination is required. This
adds a patch that demonstates this silly behavior, which will be fixed in a
future patch.
Ryan McElroy <rmcelroy@fb.com> [Thu, 30 Mar 2017 03:50:10 -0700] rev 31734
rebase: move destination test to new test file
We'll be adding a lot more tests here, so it makes sense to have this in its
own file now.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 01 Apr 2017 00:21:17 -0400] rev 31733
templatefilter: add support for 'long' to json()
When disabling the '#requires serve' check in test-hgwebdir.t and running it on
Windows, several 500 errors popped up when querying '?style=json', with the
following in the error log:
File "...\\mercurial\\templater.py", line 393, in runfilter
"keyword '%s'") % (filt.func_name, dt))
Abort: template filter 'json' is not compatible with keyword 'lastchange'
The swallowed exception at that point was:
File "...\\mercurial\\templatefilters.py", line 242, in json
raise TypeError('cannot encode type %s' % obj.__class__.__name__)
TypeError: cannot encode type long
This corresponds to 'lastchange' being populated by hgweb.common.get_stat(),
which uses os.stat().st_mtime. os.stat_float_times() is being disabled in util,
so the type for the times is 'long' on Windows, and 'int' on Linux.
Denis Laxalde <denis@laxalde.org> [Thu, 30 Mar 2017 21:40:10 +0200] rev 31732
hgweb: prefix line id by ctx shortnode in filelog when patches are shown
When "patch" query parameter is present in requests to filelog view, line ids
in patches diff are no longer unique in the page since several patches are
shown on the same page. We now prefix line id by changeset shortnode when
several patches are displayed in the same page to have unique line ids
overall.
Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 12:14:20 -0700] rev 31731
test-check-code: prevent files being added to the root directory
Adding new files in the root directory is probably a mistake, and is usually
discouraged [1]. The test catches it to avoid mistakes like [2].
Modify the test if files need to be added in the root.
[1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-July/086442.html
[2]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-March/095836.html
Matt Harbison <matt_harbison@yahoo.com> [Wed, 29 Mar 2017 09:54:34 -0400] rev 31730
sslutil: clarify internal documentation
I ran into this python issue with an incomplete certificate chain on Windows
recently, and this is the clarification that came from that experimenting. The
comment I left on the bug tracker [1] with a reference to the CPython code [2]
indicates that the original problem I had is a different bug, but happened to
be mentioned under issue20916 on the Python bug tracker.
[1] https://bz.mercurial-scm.org/show_bug.cgi?id=5313#c7
[2] https://hg.python.org/cpython/file/v2.7.12/Modules/_ssl.c#l628
Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 16:28:51 -0700] rev 31729
unionrepo: avoid unnecessary node -> rev conversion
Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 16:28:00 -0700] rev 31728
bundlerepo: avoid unnecessary node -> rev conversion
Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 16:23:04 -0700] rev 31727
revlog: avoid unnecessary node -> rev conversion
Jun Wu <quark@fb.com> [Wed, 29 Mar 2017 16:46:57 -0700] rev 31726
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 31725
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 31724
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 31723
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 31722
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 31721
color: replace str() with pycompat.bytestr()
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 26 Mar 2017 20:52:51 +0530] rev 31720
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 31719
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 31718
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 31717
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 31716
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 31715
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 31714
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 31713
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 31712
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.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 28 Mar 2017 06:13:49 +0200] rev 31711
tags: do not feed dictionaries to 'findglobaltags'
The code asserts that these dictionary are empty. So we can be more explicit
and have the function return the dictionaries directly.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> [Tue, 28 Mar 2017 06:01:31 +0200] rev 31710
tags: extract fnode retrieval into its own function
My main goal here is to be able to reuse this logic easily. As a side effect
this important logic is now insulated and the code is clearer.
Denis Laxalde <denis.laxalde@logilab.fr> [Wed, 29 Mar 2017 12:07:07 +0200] rev 31709
hgweb: fix diff hunks filtering by line range in webutil.diffs()
The previous clause for filter out a diff hunk was too restrictive. We need to
consider the following cases (assuming linerange=(lb, ub) and the @s2,l2
hunkrange):
<-(s2)--------(s2+l2)->
<-(lb)---(ub)->
<-(lb)---(ub)->
<-(lb)---(ub)->
previously on the first and last situations were considered.
In test-hgweb-filelog.t, add a couple of lines at the beginning of file "b" so
that the line range we will follow does not start at the beginning of file.
This covers the change in aforementioned diff hunk filter clause.
Denis Laxalde <denis@laxalde.org> [Sat, 25 Mar 2017 11:30:08 +0100] rev 31708
summary: display obsolete state of parents
Extend the "parent: " lines in summary to display "(obsolete)" when the parent
is obsolete.
Denis Laxalde <denis@laxalde.org> [Sat, 25 Mar 2017 10:40:29 +0100] rev 31707
templates: add "changeset.obsolete" label in command line style
Following respective change in cmdutil.changeset_printer.
Denis Laxalde <denis@laxalde.org> [Tue, 28 Mar 2017 22:38:45 +0200] rev 31706
templates: shorten definition of changeset labels in command-line style
We'll add more labels and the line is already quite long, so let's define a
variable to hold all evolution "troubles" labels.
Denis Laxalde <denis@laxalde.org> [Tue, 28 Mar 2017 22:36:22 +0200] rev 31705
templates: use separate() to build changeset labels in command-line style
Denis Laxalde <denis@laxalde.org> [Sat, 25 Mar 2017 10:34:11 +0100] rev 31704
templatekw: add an "obsolete" keyword
Definition is the same as the one in evolve extension.
Denis Laxalde <denis@laxalde.org> [Sat, 25 Mar 2017 09:39:07 +0100] rev 31703
cmdutil: add a "changeset.obsolete" label in changeset_printer
Until now there were no label to highlight obsolete changesets in log output,
only evolution troubles (unstable, bumped, divergent) are supported. We add a
"changeset.obsolete" label on changeset entries produced by changeset_printer
so that obsolete changesets can be highlighted in log output. This is useful
because, unless using a graph log where obsolete changesets have a 'x' marker,
there's no way to identify obsolete changesets. And even in graph mode, when
working directory's parent is obsolete, we get a '@' marker and we do not see
it as obsolete.
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 28 Mar 2017 14:40:13 -0700] rev 31702
fileset: perform membership test against set for status queries
Previously, fileset functions operating on status items performed
membership tests against a list of items. When there are thousands
of items having a specific status, that test can be extremely
slow. Changing the membership test to a set makes this operation
substantially faster.
On the mozilla-central repo:
$ hg files -r d14cac631ecc 'set:added()'
before: 28.120s
after: 0.860s
$ hg status --change d14cac631ecc --added
0.690s
David Soria Parra <davidsp@fb.com> [Tue, 28 Mar 2017 10:21:38 -0700] rev 31701
worker: flush ui buffers before running the worker
a91c6275 introduces flushing ui buffers after a worker finished. If the ui was
not flushed before the worker was started, fork will copy the existing buffers
to the worker. This causes messages issued before the worker started to be
written to the terminal for each worker.
We are now flushing the ui before we start a worker and add an appropriate test
which will fail before this patch.
Jun Wu <quark@fb.com> [Tue, 28 Mar 2017 08:40:12 -0700] rev 31700
chgserver: do not copy configs set by environment variables
Config set by environment variables have a source like "$ENVNAME". They
should not be copied because they will be recalculated by
rcutil.rccomponents.
Jun Wu <quark@fb.com> [Tue, 28 Mar 2017 07:57:56 -0700] rev 31699
rcutil: extract duplicated logic to a lambda
This simplifies the code a bit.
Jun Wu <quark@fb.com> [Tue, 28 Mar 2017 07:55:32 -0700] rev 31698
rcutil: unindent a block
Since global _rccomponents is gone, the code could be simplified.
Jun Wu <quark@fb.com> [Tue, 28 Mar 2017 07:54:00 -0700] rev 31697
rcutil: do not cache rccomponents
The function is only called once except for "hg debugconfig", where it is
called twice. So there is no need to cache it.
Caching it will cause issues with chgserver. Instead of dropping the cache
in chgserver, it seems cleaner to just avoid the cache.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 25 Mar 2017 19:17:11 -0400] rev 31696
ui: rerun color.setup() once the pager has spawned to honor 'color.pagermode'
Otherwise, ui.pageractive is False when color is setup in dispatch.py (without
--pager=on), and this config option is ignored.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 25 Mar 2017 21:12:00 -0400] rev 31695
ui: defer setting pager related properties until the pager has spawned
When --pager=on is given, dispatch.py spawns a pager before setting up color.
If the pager failed to launch, ui.pageractive was left set to True, so color
configured itself based on 'color.pagermode'. A typical MSYS setting would be
'color.mode=auto, color.pagermode=ansi'. In the failure case, this would print
a warning, disable the pager, and then print the raw ANSI codes to the terminal.
Care needs to be taken, because it appears that leaving ui.pageractive=True was
the only thing that prevented an attempt at running the pager again from inside
the command. This results in a double warning message, so pager is simply
disabled on failure.
The ui config settings didn't need to be moved to fix this, but it seemed like
the right thing to do for consistency.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 25 Mar 2017 13:50:17 -0400] rev 31694
color: stop mutating the default effects map
A future change will make color.setup() callable a second time when the pager is
spawned, in order to honor the 'color.pagermode' setting. The problem was that
when 'color.mode=auto' was resolved to 'win32' in the first pass, the default
ANSI effects were overwritten, making it impossible to honor 'pagermode=ansi'.
Also, the two separate maps didn't have the same keys. The symmetric difference
is 'dim' and 'italic' (from ANSI), and 'bold_background' (from win32). Thus,
the update left entries that didn't belong for the current mode. This bled
through `hg debugcolor`, where the unsupported ANSI keys were listed in 'win32'
mode.
As an added bonus, this now correctly enables color with MSYS `less` for a
command like this, where pager is forced on:
$ hg log --config color.pagermode=ansi --pager=yes --color=auto
Previously, the output was corrupted. The raw output, as seen through the ANSI
blind `more.com` was:
<-[-1;6mchangeset: 34840:3580d1197af9<-[-1m
...
which MSYS `less -FRX` rendered as:
1;6mchangeset: 34840:3580d1197af91m
...
(The two '<-' instances were actually an arrow character that TortoiseHg warned
couldn't be encoded, and notepad++ translated to a single '?'.)
Returning an empty map for 'ui._colormode == None' seems better that defaulting
to '_effects' (since some keys are mode dependent), and is better than None,
which blows up `hg debugcolor --color=never`.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:43:47 -0700] rev 31693
pager: do not read from environment variable
$PAGER is converted to the pager.pager config item. So it's no longer
necessary to read $PAGER in ui.pager().
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:41:42 -0700] rev 31692
ui: simplify geteditor
Now $EDITOR and $VISUAL will affect ui.editor directly. So it's no longer
necessary to test them in ui.geteditor.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:40:22 -0700] rev 31691
debugconfig: list environment variables in debug output
Since we print "read config from" for config files, printing environment
variables will make it more consistent.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:33:37 -0700] rev 31690
rcutil: let environ override system configs (BC)
This is BC because system configs won't be able to override $EDITOR, $PAGER.
The new behavior is arguably more rational.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:27:02 -0700] rev 31689
rcutil: add a method to convert environment variables to config items
Handling config and environ priorities has been messy. Partially because we
don't have config layers - you either get all configs (sys + user), or none.
Ideally, environ like $EDITOR, $PAGER should be able to override the system
configs "ui.editor", "pager.pager". This patch provides the ability to
convert them into config items, so they can be inserted into the middle
config layer between system rc and user rc.
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 21:04:29 -0700] rev 31688
rcutil: let rccomponents return different types of configs (API)
The next patches will convert environ to raw config items, and insert the
config items between systemrcpath and userrcpath. This patch teaches
rccomponents to return the type information so the caller could distinguish
between "path" and raw config "items".
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:48:00 -0700] rev 31687
rcutil: rename rcpath to rccomponents (API)
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 20:46:05 -0700] rev 31686
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 31685
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 31684
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 31683
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 31682
statfs: rename pygetfstype to getfstype
There's no ambiguity now.
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Mar 2017 17:23:21 +0900] rev 31681
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 31680
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 31679
hghave: use util.getfstype
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 19:57:17 -0700] rev 31678
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 31677
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 31676
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 31675
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 31674
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 31673
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 31672
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 31671
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 31670
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 31669
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 31668
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 31667
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 31666
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 31665
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 31664
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 31663
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 31662
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 31661
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 31660
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 31659
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 31658
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 31657
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 31656
py3: prove second commit works
Finally it works.
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Mar 2017 19:06:48 +0900] rev 31655
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 31654
crecord: use ProgrammingError
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 16:59:30 -0700] rev 31653
transaction: use ProgrammingError
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 16:57:25 -0700] rev 31652
bundle2: use ProgrammingError
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 16:55:56 -0700] rev 31651
merge: use ProgrammingError
Jun Wu <quark@fb.com> [Sun, 26 Mar 2017 16:53:28 -0700] rev 31650
repair: use ProgrammingError
Yuya Nishihara <yuya@tcha.org> [Sun, 26 Mar 2017 16:33:12 +0900] rev 31649
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 31648
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 31647
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 31646
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 31645
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 31644
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 31643
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 31642
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 31641
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 31640
runtests: unset editor and pager related environment variables
Those environment variables could affect some configuration and future
tests. Drop them to avoid issues.