Commit Graph

26081 Commits

Author SHA1 Message Date
Anton Shestakov
4de10bfe5d coal: reuse style-paper.css and use a separate css file for visual tweaks
To remove another big chunk of duplication from coal hgweb style, we can move
all visual tweaks to style-extra-coal.css and include it together with
style-paper.css.
2015-09-18 14:03:32 +08:00
Anton Shestakov
e8f1879f80 coal: reuse all templates from paper/map by %including the file
Before, coal/map simply had all the templates copied and pasted from paper/map
file. It was easy to make a change to paper that would get into coal only
partially and just sit there until something like 216a95e6094f happened.

Let's remove this duplication from coal/map by using %include to reuse
templates from paper/map directly.
2015-09-18 01:06:27 +08:00
timeless@mozdev.org
ed7f1d1663 help/config: reword committemplate external editor text 2015-09-04 05:40:52 -04:00
timeless@mozdev.org
59c061a8d6 help/config: reword committemplate multibyte character text 2015-09-04 05:40:37 -04:00
timeless@mozdev.org
11a62cdebb help/config: use :hg:help config.... notation 2015-08-28 15:43:14 -04:00
timeless@mozdev.org
a92c1c739a help/config: omit True or False 2015-08-28 15:24:58 -04:00
timeless@mozdev.org
37e4b0effc help/config: capitalize items 2015-08-28 15:13:28 -04:00
timeless@mozdev.org
1796c2de4c tests: add more doctests for check-translation deprecated 2015-09-17 21:20:35 -04:00
timeless@mozdev.org
8ab1a3583e tests: cleanup check-translation deprecated 2015-09-17 21:20:17 -04:00
Anton Shestakov
a80c2de885 gitweb: add author to filelogentry
The line is copied from shortlogentry template.
2015-09-18 14:24:53 +08:00
Anton Shestakov
66ab769443 monoblue: add author to filelogentry
The line is copied from shortlogentry template.
2015-09-18 14:24:38 +08:00
Anton Shestakov
b1908a7d13 monoblue: split a long line in filelogentry template
The whole td has a nowrap class, which disallows breaking the line, so it's not
required to use non-breakable spaces.
2015-09-18 14:23:44 +08:00
Yuya Nishihara
b2d79071df readbundle: fix typo of None compression
The test simulates pre-53c48b25631a hgweb that sends "unbundle" capability
with no argument.
2015-09-18 21:32:43 +09:00
Pierre-Yves David
0b4b905886 readbundle: map 'HG10UN' to None compression
In line with the other previous changes
2015-09-11 17:06:56 -07:00
Pierre-Yves David
70cc7f5586 getsubset: use None to request uncompressed changegroup 2015-09-11 17:06:02 -07:00
Pierre-Yves David
a9d2d02aff bundle: use None when unpacking uncompressed changegroup
Let's be more modern!
2015-09-11 17:05:46 -07:00
Pierre-Yves David
6a841b0f13 writebundle: use 'None' instead of 'UN' for the bundle2 case
Let's be modern!
2015-09-15 17:43:54 -07:00
Pierre-Yves David
47af8d73d3 compression: use 'None' for no-compression
This seems more idiomatic and clearer. We still support both None and 'UN' for
now because no user are migrated.
2015-09-15 17:53:28 -07:00
Pierre-Yves David
f052875fa0 changegroup: move all compressions utilities in util
We'll reuse the compression for other things (next target bundle2), so let's
make it more accessible and organised.
2015-09-15 17:35:32 -07:00
Pierre-Yves David
c27b91f154 obsolete: clarify that 'successorssets' returns the latest successors
We do not return the first successors we found, we returns the latest (non
obsolete  (mostly)) one following the obsolete link transitively. We update the
documentation to make this clean.
2015-09-15 13:12:03 -07:00
Pierre-Yves David
f317af09f6 obsolete: drop an empty line at the end of a docstring
This empty line is useless, let's drop it.
2015-09-15 13:10:25 -07:00
Pierre-Yves David
4595c06fb1 traceback: allow providing a local support contact point
The extensions blaming code is fine for casual users but pretty terrible for
corporate environments that can deploy a large amount of extensions to
unsuspecting users. Reports will likely blame a random "innocent" extension (in
our case crecord) and the hint in the message will triggers endless debug
attempts from the user.

We introduce a "ui.supportcontact" option that allow such big company to redirect
their users to their own support desk. This disables all extensions blaming and
just point people to the local support in all cases.
2015-09-11 12:45:19 -07:00
Pierre-Yves David
50db85e952 dispatch: pre-indent the extensions blaming logic
We are about to put some real conditional here, but pre-indenting in it's own
changesets makes next patch much cleaner.
2015-09-17 11:50:55 -07:00
timeless@mozdev.org
cef7f703ed tests: check for inconsistently translated DEPRECATED
Mercurial expects DEPRECATED to be translated consistently,
not doing that breaks Mercurial.
2015-09-17 07:49:18 -04:00
timeless@mozdev.org
80f4daf493 i18n-fr: reject translation which is missing DEPRECATED 2015-09-17 07:33:21 -04:00
timeless@mozdev.org
5d6c8cf675 i18n-pt_BR: select a single definition of DEPRECATED
Mercurial expects DEPRECATED to be translated consistently,
not doing that breaks Mercurial.
2015-09-17 07:47:30 -04:00
timeless@mozdev.org
0f2ad741cd i18n-sv: select a single definition of DEPRECATED
Mercurial expects DEPRECATED to be translated consistently,
not doing that breaks Mercurial.
2015-09-17 07:37:20 -04:00
timeless@mozdev.org
3c256de349 i18n-ro: use ()s instead of [] for DEPRECATED 2015-09-17 07:34:27 -04:00
timeless@mozdev.org
0669670d0b i18n-ro: include translation of DEPRECATED 2015-09-17 07:34:13 -04:00
timeless@mozdev.org
346d662db7 i18n-zh_CN: include translation of DEPRECATED 2015-09-17 07:35:03 -04:00
timeless@mozdev.org
cb880bc40e i18n-it: include translation of DEPRECATED 2015-09-17 07:33:44 -04:00
timeless@mozdev.org
63d6405686 i18n-da: include translation of DEPRECATED 2015-09-17 07:32:28 -04:00
timeless@mozdev.org
076fde20cc test-i18n: always run non gettext tests 2015-09-17 07:31:07 -04:00
Yuya Nishihara
a3529f51c1 localrepo: refresh filecache stats only if transaction finished successfully
If commit is aborted by pretxncommit hook, in-memory changelog and manifest
have entries that would be added. So they must be discarded on invalidate().

But the mechanism introduced by 071f71da2fe2 doesn't handle this case well.
It tries to mitigate the penalty of invalidate() by marking in-memory cache
as "clean" on unlock assuming that they are identical to the stored data.
But this assumption is wrong if stored data are rolled back by tr.abort().

This patch moves the hook to post-close action so that it will never be
triggered on abort.

This bug was originally reported to thg, which is only reproducible in
command-server process on unix, evolve disabled.

https://bitbucket.org/tortoisehg/thg/issues/4285/
2015-09-15 00:32:39 +09:00
Yuya Nishihara
b265ea8243 localrepo: move closure of lock release to class
It only captures "self", so it isn't necessary to be created dynamically.
2015-09-15 21:00:28 +09:00
Anton Shestakov
7e01618c4d highlight: add highlightfiles config option which takes a fileset (issue3005)
Highlight extension lacked a way to limit files by size, by extension, and/or
by any other part of file path. A good solution would be to use a fileset,
since it can check file path, extension and size (and more) in one expression.
So this change introduces such an option, highlighfiles, which takes a fileset
and on each request decides if the requested file should be highlighted.

The default "size('<5M')" is, in a way, suggested in issue3005.

checkfctx() limits the amount of work to just one file (subset kwarg in
fileset.matchctx()).

Monkey-patching works around issue4568, otherwise using filesets here while
running hgweb in directory mode would say, for example, "Abort: **.py not under
root", but this fix is very local and probably far from ideal. I suspect there
to be a way to fix this for the whole hgweb and resolve the issue, but I don't
know how to do it.
2015-09-16 22:30:36 +08:00
timeless@mozdev.org
180d1578ac posix: shellquote do not require quoting for "+" (issue4818) 2015-09-04 11:15:02 -04:00
Gregory Szorc
4e3c6d9b7a hgweb: consume generator inside context manager (issue4756)
If code inside a context manager returns a generator, the context
manager exits before the generator is iterated.

hgweb was using a context manager to control thread safe access to a
localrepository instance. But it was returning a generator, so there was
a race condition between a previous request streaming a response to the
client and a new request obtaining the released but in use repository.
By iterating the generator inside the context manager, we ensure we
don't release the repo instance until after the response has finished.

With this change, hgweb finally appears to have full localrepository
isolation between threads. I can no longer reproduce the 2 exceptions
reported in issue4756.

test-hgweb-non-interactive.t has been modified to consume the output
of calling into a WSGI application. Without this, execution of the WSGI
application stalls because of the added yield statement.
2015-09-12 12:16:39 -07:00
Augie Fackler
57b1966770 histedit: use one editor when multiple folds happen in a row (issue3524) (BC)
This was the first ever feature request for histedit, originally filed
back on April 4, 2009. Finally fixed.

In the future we'll probably want to make it possible for other
preprocessing steps to be added to the list, but for now we're
skipping that because it's unclear what the API should look like
without a proposed consumer.
2015-08-27 14:46:26 -04:00
Anton Shestakov
d1c17dc442 hgweb: replace .sourcelast with .bottomline that does the same
In paper and Coal, basically, div.sourcelast was only used to make a 1px border
on the bottom of file source view (and only there). It's better to use
bottomline class, that also exists for the same purpose (visually), but is used
more widely and works without needing an empty <div>.
2015-09-14 18:41:09 +08:00
Anton Shestakov
166a086d20 coal: copy newer things from paper
Basically, coal style in hgweb is intended to be functionally equivalent (just
different in style) to paper, and does this by reusing almost all templates
from paper (except header.tmpl, where it specifies a different css file). Looks
like everybody forgot this and so many improvements to paper templates, that
should've also made it into coal, were often only half-done there (usually
thanks to template reuse). Let's fix this by bulk-copying missing things from
paper/map and style-paper.css to coal/map and style-coal.css.

There were many improvements to paper that didn't touch coal, and that makes it
hard to untangle the code and split this patch into many, but here are some of
the changes (paper-only), that now get into coal:

a9c9f5ef6abf - hgweb: color line which is linked to in file source view
1555d017cac7 - hgweb: highlight line which is linked to at annotate view
a46863946982 - hgweb: code selection without line numbers in file source view
636594df4244 - hgweb: add line wrapping switch to file source view
cc6bee069ce6 - hgweb: use css margin instead of empty <p> before diffstat table

It also fixes line anchor in annotateline template (#42 vs #l42).
2015-09-13 21:01:34 +08:00
Gregory Szorc
7769f0b9ff revlog: optionally cache the full text when adding revisions
revlog instances can cache the full text of a single revision. Typically
the most recently read revision is cached.

When adding a delta group via addgroup() and _addrevision(), the
full text isn't always computed: sometimes only the passed in delta is
sufficient for adding a new revision to the revlog.

When writing the changelog from a delta group, the just-added full
text revision is always read immediately after it is written because
the changegroup code needs to extract the set of files from the entry.
In other words, revision() is *always* being called and caching the full
text of the just-added revision is guaranteed to result in a cache hit,
making the cache worthwhile.

This patch adds support to _addrevision() for always building and
caching the full text. This option is currently only active when
processing changelog entries from a changegroup.

While the total number of revision() calls is the same, the location
matters: buildtext() calls into revision() on the base revision when
building the full text of the just-added revision. Since the previous
revision's _addrevision() built the full text and the the previous
revision is likely the base revision, this means that the base
revision's full text is likely cached and can be used to compute the
current full text from just a delta. No extra I/O required.

The end result is the changelog isn't opened and read after adding every
revision from a changegroup.

On my 2013 MacBook Pro running OS X 10.10.5 from an SSD and Python 2.7,
this patch impacted the time taken to apply ~262,000 changesets from a
mozilla-central gzip bundle:

  before: ~43s
  after:  ~32s

~25% reduction in changelog processing times. Not bad.
2015-09-12 16:11:17 -07:00
Gregory Szorc
7f63b5672e revlog: drop local assignment of cache variable
The purpose of this code was to provide thread safety. With the
conversion of hgweb to use separate localrepository instances per
request/thread, we should no longer have any consumers that need to
access revlog instances from multiple threads. Remove the code.
2015-09-12 15:16:47 -07:00
Gregory Szorc
7784d9ad76 revlog: rename generic "i" variable to "indexdata"
Increase readability.
2015-09-12 12:47:00 -07:00
Gregory Szorc
216aba88f8 hg: always create new localrepository instance
cachedlocalrepo.copy() didn't actually create new localrepository
instances. This meant that the new thread isolation code in hgweb wasn't
actually using separate localrepository instances, even though it was
properly using separate cachedlocalrepo instances.

Because the behavior of the API changed, the single caller in hgweb had
to be refactored to always call _webifyrepo() or it may not have used
the proper filter.

I confirmed via print() debugging that id(repo) is in fact different on
each thread. This was not the case before.

For reasons I can't yet explain, this does not fix issue4756. I suspect
there is shared cache somewhere that isn't thread safe.
2015-09-12 11:31:56 -07:00
timeless@mozdev.org
36e75d4956 test-bad-extension: reduce dependencies on other things
test-bad-extension would jitter if the format of the first line
of hg help changed, which isn't relevant to its goal.
2015-09-10 19:45:46 -04:00
timeless@mozdev.org
a14fb0ee13 help: fix help argument parsing and documentation
support combining -c and -e

previously -k was misdocumented:
 * the first line didn't mention it
 * the help half implied you could do help -k keyword topic

with these changes, -k just changes the search method

support -c and -e for -k searches
2015-09-10 20:22:37 -04:00
timeless@mozdev.org
ea3920eaa0 minirst: establish leveling for nested definitions 2015-09-10 10:48:20 -04:00
Jordi Gutiérrez Hermoso
b64649a4e1 dispatch: use the right context manager to deactivate demandimport
In 4bc3dc605581 I very embarrassingly wrote a patch with the
completely wrong function name. This should fix it.
2015-09-13 16:30:21 -04:00
Augie Fackler
62a104b3a9 ui: improve docs on ui.log
This makes the documentation on ui.log line up with the use of that
interface in blackbox.
2015-09-10 10:50:03 -04:00