Commit Graph

25733 Commits

Author SHA1 Message Date
Anton Shestakov
4547637785 monoblue: fix branches link on help topics page 2015-07-26 17:18:42 +08:00
Anton Shestakov
2bbb11440f hgweb: show ages in repos' Last modified column in monoblue and gitweb
Index page, which shows the list of available repositories, has a column where
the last modification date for each repo is shown. paper, coal and spartan
already show the dates in relative format (e.g. "2 weeks ago"), because these
styles have the required process_dates() js function call in their footer
templates, which are included on every page. But monoblue and gitweb styles
have more things in the footer templates, such as repo name and its atom/rss
links, so they don't include the footer on index page (as this page doesn't
have a single repo context).

Let's call process_dates() without including the footer.
2015-07-26 00:11:23 +08:00
Durham Goode
677efb706e ignore: fix include: rules depending on current directory (issue4759)
When reading pattern files, we just call open(path), which is relative to the
current directory.  Let's fix this by resolving the paths before attempting to
read the file.
2015-07-24 16:44:52 -07:00
Durham Goode
c9da9870f4 test: move ignore test run into a subdirectory
Previously the hgignore test just called hg init in the test directory. A future
patch needs to test hgignore stuff from outside of the repo, so let's move the
entire test repo into a subdirectory.
2015-07-24 16:43:21 -07:00
Eugene Baranov
322848b810 convert: when converting from Perforce use original local encoding by default
On Windows Perforce command line client uses default system locale to encode
output. Using 'latin_1' causes locale-specific characters to be replaced with
question marks. With this patch we will use default locale by default whilst
allowing to specify it explicity with 'convert.p4.encoding' config option.

This is a potentially breaking change for any scripts relying on output treated
as in 'latin_1' encoding.

Also because hgext.convert.convcmd overwrites detected default system locale
with UTF-8 we had to introduce an import cycle in hgext.convert.p4 to retrieve
originally detected encoding from hgext.convert.convcmd.
2015-07-22 16:57:11 +01:00
Eugene Baranov
29b28e8371 convert: when getting file from Perforce concatenate data at the end
As it turned out, even when getting relatively small files, concatenating
string data every time when new chunk is received is very inefficient.
Maintaining a string list of data chunks and concatenating everything in one go
at the end seems much more efficient - in my testing it made getting 40 MB file
7 times faster, whilst converting of a particularly big changelist with some big
files went down from 20 hours to 3 hours.
2015-07-30 00:58:05 +01:00
Martin von Zweigbergk
6ea2f0a8d1 exchange: fix dead assignment
The assignment of the value from bundle2.processbundle() to 'r' is
unused. It is currently the same as its third argument (if given), and
since that argument may eventually go away (according to the method's
docstring), let's reassign the return value to 'op' instead to better
prepare for that.
2015-07-20 13:39:25 -07:00
Martin von Zweigbergk
2b14caf707 exchange: s/phase/bookmark/ in _pushb2bookmarks() 2015-07-20 13:35:19 -07:00
Siddharth Agarwal
20e8951b71 test-bookmarks.t: avoid nested repo
This is (a) pretty unnecessary and (b) breaks tests for the third-party
hgwatchman extension, which doesn't support nested repos.
2015-08-02 21:56:38 -07:00
Yuya Nishihara
f08cad7728 revlog: remove unused shaoffset constants
Call sites were removed at 1299f0c14572, "revlog: remove lazy index".
2015-08-02 12:16:19 +09:00
Yuya Nishihara
28a45149e9 revlog: correct comment about size of v0 index format 2015-08-02 01:14:11 +09:00
Gregory Szorc
db719a7a87 help: scripting help topic
There are a lot of non-human consumers of Mercurial. And the challenges
and considerations for machines consuming Mercurial is significantly
different from what humans face.

I think there are enough special considerations around how machines
consume Mercurial that a dedicated help topic is warranted. I concede
the audience for this topic is probably small compared to the general
audience. However, lots of normal Mercurial users do things like create
one-off shell scripts for common workflows that I think this is useful
enough to be in the install (as opposed to, say, a wiki page - which
most users will likely never find).

This text is by no means perfect. But you have to start somewhere. I
think I did cover the important parts, though.
2015-07-18 17:10:28 -07:00
Matt Harbison
5dece5b905 convert: document convert.hg.startrev 2015-07-29 21:31:56 -04:00
FUJIWARA Katsunori
2fb0db56cb transplant: restore dirstate correctly at unexpected failure
Before this patch, transplant can't restore dirstate as expected at
failure other than one while patching. This causes:

  - unexpected file status

  - dirstate refers already rollback-ed parent
    (only at failure of transplanting the 2nd or later revision)

To restore dirstate correctly also at unexpected failure, this patch
encloses scope of store lock and transaction by 'dirstateguard'.

This is temporary fixing for stable branch. See
DirstateTransactionPlan wiki page for detail about the future plan to
treat dirstate consistently around scope boundary of transaction.

    https://mercurial.selenic.com/wiki/DirstateTransactionPlan

This patch also adds 'if lock' examination for safety
'lock.release()', because creating 'dirstateguard' object may fail
unexpectedly (e.g. IOError for saving dirstate).

BTW, in the test script, putting section header '[extensions]' into
'.hg/hgrc' is needed to fix incomplete disabling 'abort' extension at
d0d06f4ca862.
2015-07-30 06:22:09 +09:00
FUJIWARA Katsunori
4865b28d1a localrepo: make journal.dirstate contain in-memory changes before transaction
Before this patch, in-memory dirstate changes aren't written out at
opening transaction, even though 'journal.dirstate' is created
directly from '.hg/dirstate'.

Therefore, subsequent 'hg rollback' uses incomplete 'undo.dirstate' to
restore dirstate, if dirstate is changed and isn't written out before
opening transaction.

In cases below, the condition "dirstate is changed and isn't written
out before opening transaction" isn't satisfied and this problem
doesn't appear:

  - "wlock scope" and "transaction scope" are almost equivalent

    e.g. 'commit --amend', 'import' and so on

  - dirstate changes are written out before opening transaction

    e.g. 'rebase' (via 'dirstateguard') and 'commit -A' (by separated
    wlock scopes)

On the other hand, 'backout' may satisfy the condition above.

To make 'journal.dirstate' contain in-memory changes before opening
transaction, this patch explicitly invokes 'dirstate.write()' in
'localrepository.transaction()'.

'dirstate.write()' is placed before not "writing journal files out"
but "invoking pretxnopen hooks" for visibility of dirstate changes to
external hook processes.

BTW, in the test script, 'touch -t 200001010000' and 'hg status' are
invoked to make file 'c' surely clean in dirstate, because "clean but
unsure" files indirectly cause 'dirstate.write()' at 'repo.status()'
in 'repo.commit()' (see e1d123a2ee1f for detail) and prevents from
certainly reproducing the issue.
2015-07-30 06:16:12 +09:00
Anton Shestakov
00364f383f monoblue: show relative age of bookmarks
In 064b658181dd, age calculation was made dynamic (i.e. in javascript), but for
some reason bookmarkentry template in monoblue/map got a wrong class. It
resulted in /summary and /bookmarks pages always showing exact dates for
bookmarks, no age calculation was performed. Let's fix this by using "age"
class that is already used in branchentry and tagentry templates in the same
map file.

As usual, the exact date for such elements is still available in title
attribute, so it shows in a tooltip on hover.
2015-07-13 13:13:17 +08:00
Anton Shestakov
403857c028 highlight: produce correct markup when there's a blank line just before EOF
Due to how the colorized output from pygments was stripped of <pre> elements,
when there was an empty line at the end of a file, highlight extension produced
an incorrect markup (no closing tags from the fileline/annotateline template).
It wasn't usually noticeable, because browsers were smart enough to see where
the missing tags should've been, but in monoblue style it resulted in the last
line having twice the normal height.

Instead of awkwardly trying to strip outer <pre></pre> tags, let's make the
formatter with nowrap=True, which should do what we need in pygments since at
least 0.5 (2006-10-30).

Example from monoblue style:

Before:

    <div class="source">

<div style="font-family:monospace" class="parity0">
<pre><a class="linenr" href="#l1" id="l1">     1</a> </pre>
</div>
<div style="font-family:monospace" class="parity1">
<pre><a class="linenr" href="#l2" id="l2">     2</a>
    </div>

Now:

    <div class="source">

<div style="font-family:monospace" class="parity0">
<pre><a class="linenr" href="#l1" id="l1">     1</a> </pre>
</div>
<div style="font-family:monospace" class="parity1">
<pre><a class="linenr" href="#l2" id="l2">     2</a> </pre>
</div>
    </div>

(Notice the missing </pre></div> now in place)
2015-07-22 10:19:17 +08:00
Matt Harbison
1fb45c7e46 test-check-config: convert directory separators to '/' for MSYS
The output of the files command uses native separator.  MSYS then seems to drop
the '\' on Windows when invoking python:

 --- c:/Users/Matt/Projects/hg/tests/test-check-config-hg.t
 +++ c:/Users/Matt/Projects/hg/tests/test-check-config-hg.t.err
 @@ -6,22 +6,10 @@

    $ hg files "set:(**.py or **.txt) - tests/**" |
    >   xargs python contrib/check-config.py  Traceback (most recent call last):
      File "contrib/check-config.py", line 93, in <module>
        sys.exit(main(sys.argv[1:]))
      File "contrib/check-config.py", line 24, in main
        for l in open(f):
    IOError: [Errno 2] No such file or directory: 'contriball-revsets.txt'
    [123]
2015-07-20 23:33:57 -04:00
Matt Harbison
3e67d17d81 test-subrepo: fix globs for Windows
It looks like these changes originated with 23b60798c736.  I'm not sure that it
was intentional, but is seems harmless enough for an error message.
2015-07-20 22:48:42 -04:00
Matt Harbison
9af3be2f3b test-clone: fix globs for Windows 2015-07-20 22:44:53 -04:00
Danek Duvall
256c943981 tests: diff -r on Solaris emits "Common subdirectories:"
When using the -r option to Solaris diff, any directores that compare
identically are mentioned in the output.  We don't really care about these
directories for the purposes of this test, so ignore them.
2015-07-20 15:42:39 -07:00
Danek Duvall
ccade6afcc tests: work around differing hunk headers between GNU and Solaris diff
The hunk headers specifying what lines the hunk apply to differ.  They're
irrelevant to the test, so just eliminate them from the output.
2015-07-20 15:39:15 -07:00
Danek Duvall
6c0991c070 tests: use egrep with regular expression branches for compatibility
GNU grep allows you to use "a\|b" in a regular expression to match either
"a" or "b", but at least Solaris grep does not; only egrep allows for that.
And egrep considers "a+" to be "a{1,}" instead of an "a" and a literal plus
sign, so escape that as well.
2015-07-20 15:33:20 -07:00
Yuya Nishihara
b789a2d6b1 parsers: silence warning of implicit integer conversion issued by clang
"-Wshorten-64-to-32" is enabled by default on Mac OS X. Because "len" should
be represented in 32bit integer, this patch simply cast ssize_t to int.
2015-07-20 23:38:56 +09:00
Yuya Nishihara
d7d0977d82 tests: disable test of buffer overflow in parsers.c if --pure
It fails with AttributeError and there's no benefit to make it runnable
with pure Python code.
2015-07-19 15:27:28 +09:00
Pascal Quantin
6d8e263df2 win32: update Inno Setup script after the changes done in f8c357b94e74 2015-07-19 18:11:18 +02:00
Matt Mackall
7dd8e80201 Added signature for changeset 1ae362552d62 2015-07-18 17:33:59 -05:00
Matt Mackall
9630b6a23f tests: add a check-config pass 2015-06-26 18:45:29 -05:00
Matt Mackall
cb0d66d090 hgweb: document web.certificates option 2015-07-18 14:18:31 -05:00
Matt Mackall
108d56f661 shelve: make maxbackup doc check-config friendly 2015-07-18 14:17:46 -05:00
Matt Mackall
43de6c5585 share: make option docs more check-config friendly 2015-07-18 14:17:17 -05:00
Matt Mackall
e6644982a8 perf: mark experimental option presleep 2015-07-18 14:16:36 -05:00
Matt Mackall
39dd2c2b5a check-config: don't continue prematurely
The early check for section headers like ^``foo`` was missing actual
options like ^``foo.bar``.
2015-07-18 14:16:07 -05:00
Matt Mackall
af90fd51ba subrepo: mark internal-only option 2015-06-25 17:57:26 -05:00
Matt Mackall
db0a9a6103 progress: mark experimental option 2015-06-25 17:56:54 -05:00
Matt Mackall
89c8dd4cd3 censor: mark experimental option 2015-06-25 17:56:26 -05:00
Matt Mackall
c8d98cbf34 bundle2: fix type of experimental option 2015-06-25 17:56:06 -05:00
Matt Mackall
1f2f7de9a3 merge: make merge.preferancestor type and default consistent
(and mark it)
2015-06-25 17:54:55 -05:00
Matt Mackall
e4b3f099ef merge: mark ancient debugging option 2015-06-25 17:53:16 -05:00
Matt Mackall
c513e9d5f5 email: fix config default value inconsistency 2015-06-25 17:52:20 -05:00
Matt Mackall
1814d94dd8 bookmarks: mark internal-only option 2015-06-25 17:51:32 -05:00
Matt Mackall
d8dd457296 commit: mark internal-only option 2015-06-25 17:51:02 -05:00
Matt Mackall
6a4e277735 localrepo: mark format options 2015-06-25 17:50:27 -05:00
Matt Mackall
0e22b7683e formatter: mark developer options 2015-06-25 17:49:11 -05:00
Matt Mackall
3e2882b908 http2: mark experimental and developer options 2015-06-25 17:48:43 -05:00
Matt Mackall
2c7ca511c2 bookmarks: mark internal-only config option 2015-06-25 17:47:32 -05:00
Matt Mackall
647579e3af filemerge: mark internal-only config option 2015-06-25 17:46:55 -05:00
Matt Mackall
694178b7ed profiler: mark developer-only config option 2015-06-25 17:46:29 -05:00
Matt Mackall
48e65fe108 debugger: mark developer-only option
(and rearrange comment)
2015-06-25 17:45:49 -05:00
Matt Mackall
da38b28f4f commandserver: mark developer-only logging option 2015-06-25 17:44:15 -05:00