Commit Graph

18956 Commits

Author SHA1 Message Date
Pierre-Yves David
e23948d63d hgweb: handle filtered "0" rev in navigation
Before this changeset, navigation generation crashed if revision "0" was
filtered. We introduce a `_first` methods on revision navigation that return the
lowest unfiltered element and use it in two place were the "0" changeset was
explicitly referenced.

Test case are introduced.
2013-04-30 13:53:49 +02:00
Pierre-Yves David
f362d20bef hgweb: fix empty navigation detection
For some obscure reason, changelog.node(0) returns nullid if changelog is empty.
this break empty navigation detection. We fix this code by using the length of
the changelog.

Using the length have some issue with revision filtering but this is a small
step in the right direction. Proper fix comes in later changeset.
2013-04-30 15:11:12 +02:00
Jim Hague
3d040369cd tests: AIX can't handle negative date in test-dirstate.t
test-dirstate.t fails on AIX in the absurd date test. AIX touch errors on
any date prior to 1970. AIX mktime() gives an error on such dates, so the
problem is deeper than touch and attempts to work around touch in Python
failed.

Give up. Add an AIX test to hghave and skip the absurd date test on AIX.
2013-04-30 14:56:33 +01:00
FUJIWARA Katsunori
071d89abd0 win32: use explicit path to "python.exe" only if it exists
Before this patch, "hg.bat" for Windows environment always uses
"%~dp0..\python" as explicit path to "python.exe".

This path may not be valid in some cases.

For example, on the environment using "virtualenv" python package,
both "python.exe" and "hg.bat" are placed in the same directory.  In
this case, "python.exe" should be found on PATH, because virtualenv
activation script puts "python.exe" on the PATH.

This patch uses explicit path to "python.exe" only if it exists, and
expects that "python.exe" can be found on PATH otherwise.
2013-04-26 01:12:03 +09:00
Siddharth Agarwal
bad1c384d8 test-mq-strip.t: add a test for strip --keep with clean working dir
This helped uncover a bug in a patchset I've been writing.
2013-04-26 22:07:25 -07:00
Mads Kiilerich
69da8bff75 largefiles: use repo.wwrite for writing standins (issue3909) 2013-04-27 00:41:42 +02:00
Mads Kiilerich
2f9545c92c largefiles: drop repo wrapping detection
After 08202d1ef738 I see:

  $ hg id -q
  largefiles: repo method 'commit' appears to have already been wrapped by another extension: largefiles may behave incorrectly
  largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly
  3bd0c95ec1bf

The warning is bad:

* The message gives no hint what the problem is and how it can be resolved.
  The message is useless.

* Largefiles do have its share of problems, but I don't think I ever have seen
  a problem where this warning would have helped. The 'may' in the warning
  seems like an exaggeration of the risk. Having largefiles enabled in
  combination with for instance mq, hggit and hgsubversion causes a warning
  (depending on the configuration order) but do not cause problems. Extensions
  might of course be incompatible, but they can be that in many other ways.
  The check and the message are incorrect.

It would thus be better to remove the check and the warning completely.

Before 08202d1ef738 the check always failed. That change made the check work
more like intended ... but the intention was wrong. This change will thus also
back that change out.
2013-04-26 19:04:01 +02:00
FUJIWARA Katsunori
a48794b349 config: discard "%unset" values defined in the other files read in previously
Before this patch, "%unset" can't unset values defined in the other
files read in previously, even though online help document says that
it can. It can unset only values defined in the same configuration
file.

For example, the value defined in "~/.hgrc" can't be unset by "%unset"
in ".hg/hgrc" of the repository.

This patch records "%unset"-ed values in "config.parse()", and
discards corresponding values in "config.update()".
2013-04-26 23:36:12 +09:00
FUJIWARA Katsunori
039fe3e215 tests: rename from test-config-case.t to test-config.t for centralization
Before this patch, there is no test script testing configuration
handling generally. "test-config-case.t" seems to be specific for
testing case sensitive configuration.

This patch renames from "test-config-case.t" to "test-config.t" for
centralization of tests around configuration handling.
2013-04-26 23:16:25 +09:00
FUJIWARA Katsunori
2de8c4416b i18n: show the non-ASCII password prompt text correctly
Before this patch, the prompt text for asking password is directly
passed to "getpass.getpass()" of Python standard library.

In "getpass.getpass()" implementation on Windows environment, the
prompt text is split into byte sequence and "msvcrt.putch()" is
applied on each bytes in it. This splitting causes non-ASCII prompt
text to be broken.

This patch shows the prompt text for asking password on "ui.getpass()"
side, and invokes "getpass.getpass()" with empty prompt text. This
prevents non-ASCII prompt text from being broken in
"getpass.getpass()" implementation.

This patch also sets "ui.prompt" label to prompt text to follow
"ui.prompt()" style.
2013-04-25 20:48:49 +09:00
Kevin Bullock
ed0cfa5cc4 tests: make sed usage in test-unionrepo.t cross-platform
Usage of the 'i' command proves tricky. I tried to write a check-code rule, but
failed.
2013-04-23 17:26:00 -05:00
Kevin Bullock
1b16c815cb check-code: fix sed 'i' command rule newline matching
The regular expression was meant to match cases where an 'i' command was
not followed by precisely a '\' and then a newline; it failed to match
the newline, so cases with a '\' but no newline would erroneously pass.
2013-04-23 16:57:51 -05:00
Durham Goode
0755816b12 blackbox: don't run permission tests on non-unix systems
The windows and vfat test runs were failing due to read/write permissions not
working the same on those systems.  On vfat, permissions can't be changed
at all, and on windows it seems the chmod emulation doesn't remove read
permissions.  We could theoretically get the 'cannot write to blacklog.log'
test to pass on windows but there's no #if condition to let us exclude vfat
only.

Verified that test-blackbox passes on windows now.
2013-04-22 18:00:59 -07:00
Kevin Bullock
2f2218183e check-code: expand sed rule to include more offenders
Expands the rule added in a3f00ef2b622 to include cases where the
address is a line number instead of a regular expression, and fixes an
instance of this pattern in test-unionrepo.t.
2013-04-22 16:50:08 -05:00
Kevin Bullock
5747742d25 check-code: add a rule against a GNU sed-ism
BSD sed requires the 'i' command to be followed with a backslash and a
newline, like so:

  $ sed -e '/^@/i\
  > other'

We've encountered this problem before, e.g. in test-mq.t (215a8789129e).
This change adds a check-code rule and fixes two instances of the
problem in test-record.t.
2013-04-22 16:33:28 -05:00
Alexander Plavin
fb005d78d7 hgweb: make help verbose again (issue3899)
Due to regression introduced in 5fc7d589c700, help in hgweb
was rendered in non-verbose form (issue3899)
2013-04-22 12:27:56 +04:00
Matt Mackall
e2fe53b5c3 merge with i18n 2013-04-21 17:33:51 -05:00
Wagner Bruna
0c16cfe519 i18n-pt_BR: synchronized with ff1886253606 2013-04-20 19:01:36 -03:00
Alexander Plavin
93a914c0c3 css: remove repeated property
'margin' property was repeated for the same selector
2013-04-20 16:46:38 +04:00
Alexander Plavin
86ea67ee62 css: fixed font-family
There is no 'sans' font-family, replaced with 'sans-serif'
2013-04-20 22:09:17 +04:00
Siddharth Agarwal
caefa6b342 color: add a test with extension loaded and ui.formatted=False 2013-04-19 22:03:59 -07:00
Siddharth Agarwal
dd5ad83252 color: set _colormode to None when mode is unset (issue3895)
Previously, colorui assumed that it would only be called when mode wasn't
None. 255b770b2eff changed that, so now colorui needs to care about whether it
should colorize output.
2013-04-19 16:57:10 -07:00
Siddharth Agarwal
423eaf6e61 color: turn colorui functions into forwards when color is None
colorui will be set to None as necessary in an upcoming patch.
2013-04-19 16:57:20 -07:00
Wagner Bruna
bf79f90e32 largefiles: fix typos in documentation 2013-04-19 18:26:35 -03:00
Durham Goode
1b7b932cfc translations: change label integer error to not specify the kind of label
The current error message used the kind (bookmark, branch, tag) in the message.
Unfortunately this isn't easily translatable since some languages give different
genders to these words. The fix is to not specify it at all, since it should be
implicit based on the command the user just ran.

Relevant discussions around this area:
http://selenic.com/pipermail/mercurial-devel/2012-October/045567.html
http://selenic.com/pipermail/mercurial-devel/2012-October/045600.html
2013-04-19 10:55:11 -07:00
Matt Mackall
254b89c9d7 Added signature for changeset b842f0d8d8e8 2013-04-18 23:50:15 -05:00
Bryan O'Sullivan
228c308a0d blackbox: automatically rotate log files
If enabled, log rotation prevents the amount of space used by the
blackbox log from growing without bound. This becomes important in
cases where there are a lot of busy repositories managed by humans
and automation on many machines.

In large deployments, we cannot reasonably track all the repos where
blackbox logs need to be managed, so it is safer to have blackbox
manage its own logs than to move responsibility to an external tool
such as logrotate.

This change adds two configuration keys:

* blackbox.maxsize is the maximum allowable size of the current log

* blackbox.maxfiles is the number of log files to maintain
2013-04-18 16:17:59 -07:00
Bryan O'Sullivan
12ef7ce995 ui: add a configbytes method, for space configuration
This accepts a floating point number, followed by optional whitespace,
followed by an optional one- or two-letter unit specifier (for
bytes, kilobytes, megabytes, or gigabytes).
2013-04-18 12:58:28 -07:00
Simon Heimberg
08371841f9 mq: do not inherit settings form base repo in mqrepo (Fixes issue2358)
This is done by using repo.baseui when creating the queue repo.
2013-04-18 23:53:39 +02:00
Simon Heimberg
7edcf8a9d5 color: set the ui class in reposetup, before a repo is created
Previously only the class of repo.ui was set. The class was set in the wrapper
of dispatch._runcommand. But this is called after the repo is created. Only
the class of repo.ui is set because repo.baseui already exists and is not
accessible.
We now set the class in uisetup because this is called before repo creation.
This is also the place suggested in the wiki for modifying classes.
2013-04-18 23:53:24 +02:00
André Sintzoff
cf733b64f6 parsers: remove warning: format ‘%ld’ expects argument of type ‘long int’
gcc 4.6.3 on 12.04 Ubuntu machine emits warnings:
mercurial/parsers.c: In function ‘find_deepest’:
mercurial/parsers.c:1288:9: warning: format ‘%ld’ expects argument of type
                    ‘long int’, but argument 3 has type ‘Py_ssize_t’ [-Wformat]
mercurial/parsers.c:1288:9: warning: format ‘%ld’ expects argument of type
                    ‘long int’, but argument 4 has type ‘Py_ssize_t’ [-Wformat]
2013-04-18 20:28:38 +02:00
FUJIWARA Katsunori
387c38ed85 annotate: discard refcount of discarded annotation for memory efficiency
Before this patch, refcount (managed in "needed") of the annotation
result is kept as 1, even if corresponding annotation result is
discarded from "hist", because it isn't decreased and discarded.

In the history tree including merging revision, the most recent common
ancestor of merged revisions is scanned twice. Refcount of such
ancestor never becomes 0, because refcount is started from 1 at the
second scanning.

This prevents annotation results of merging revision in "hist" from
being discarded, and decreases memory efficiency.

This patch discards refcount of the annotation result, when the
corresponding annotation is discarded from "hist".
2013-04-18 19:50:04 +09:00
Alexander Plavin
48936f264c revlog: fix a regression with null revision
Introduced in the patch which fixes issue3497
Part of that patch was erroneously submitted and it shouldn't be in the code
2013-04-18 16:46:09 +04:00
Siddharth Agarwal
a7818c164f rebase: check no-op before checking phase (issue3891)
This could lead to user confusion, because phases aren't really involved at
all when attempting to perform a no-op rebase.
2013-04-18 14:28:06 -07:00
Sean Farley
766233e4bb template: call runtemplate on the src argument to sub
This allows using a template keyword on calls to the sub function and brings
the function inline with most other semantics of the other template functions.
2013-04-10 19:27:49 -05:00
Mads Kiilerich
048869f652 run-tests: introduce --random for running tests in random error
This is convenient when investigating failures one by one to avoid running the
same fixed tests first every time.
2013-04-17 03:41:34 +02:00
Mads Kiilerich
ec228a65b1 largefiles: wlock in status before lfdirstate.write() 2013-04-17 03:41:11 +02:00
Mads Kiilerich
498a388ae4 transplant: use set for prune lookup 2013-04-16 19:31:59 +02:00
Pierre-Yves David
69d3fb6919 obsolete: extract obsolescence marker pulling into a dedicated function
Having a dedicated function will allow us to experiment with other exchange
strategies in an extension. As we have no solid clues about how to do it right,
being able to experiment is vital.

Some transaction tricks are necessary for pull. But nothing too scary.
2013-04-17 11:47:49 +02:00
Pierre-Yves David
0a4431da48 obsolete: extract obsolescence marker pushing into a dedicated function
Having a dedicated function will allows us to experiment with other exchange
strategies in an extension. As we have no solid clues about how to do it right,
being able to experiment is vital.

I intended a more ambitious extraction of push logic, but we are far too
advanced in the release cycle for it.
2013-04-17 11:18:36 +02:00
Bryan O'Sullivan
eed131db97 blackbox: fix a case of name capture 2013-04-18 12:55:58 -07:00
Yuya Nishihara
6621ca2cb6 pathencode: eliminate comma at end of enum list to avoid pedantic warning 2013-04-19 01:34:21 +09:00
FUJIWARA Katsunori
2f162b6837 smtp: use 465 as default port for SMTPS
Before this patch, port 25 (wellknown port of SMTP) is used as default
port, even if "[smtp] tls" is configured as "smtps".

This patch uses port 465 (wellknown port of SMTPS) as default port, if
"[smtp] tls" is configured as "smtps".
2013-04-19 01:26:23 +09:00
Kevin Bullock
5340fc4c0d subrepo: fix test breakage introduced in c4e616650776
The test didn't break when I originally committed it (git version
1.7.12.4 (Apple Git-37)), and still doesn't on that machine, but the
output changes elsewhere with "Warning: you are leaving N commits
behind..."

This change sets a ref on the commit we're updating the subrepo _away_
from to quash the warning.
2013-02-21 21:05:06 +00:00
Pierre-Yves David
c044ef8de0 histedit: more precise user message when changeset is missing
Now that we explicitly detect duplicated changesets, we can explicitly
detect missing ones. We cover the same cases as before, some others
and we offer a better error message in all cases.
2013-04-18 15:27:50 +02:00
Pierre-Yves David
f340c552d8 histedit: protect against duplicated entries
Before this change one would issue rules with duplicated entries. For
this to happen some other changeset had to be missing to maintain the
rules length.
2013-04-18 15:22:24 +02:00
Pierre-Yves David
f70c25782a histedit: track short hash instead of changectx object
This simplifies set usage and allow us to add a missing revision check
in a later commit.
2013-04-18 15:13:35 +02:00
Pierre-Yves David
1df8cacc3e histedit: ensure rules return short hex at all time
Handling homogeneous data is both simpler and safer.
2013-04-18 15:10:01 +02:00
Pierre-Yves David
cdc5bce2e5 histedit-test: test unknown command
We had no tested for this case.
2013-04-18 13:51:27 +02:00
Pierre-Yves David
36343ee790 histedit-test: test unknown changeset
We had no tested for this case.
2013-04-18 13:50:59 +02:00