Commit Graph

32698 Commits

Author SHA1 Message Date
Yuya Nishihara
998add0b38 changeset_templater: do not enable verbosity postfix for [templates] section
Since this postfix hack exists only for backward compatibility, we don't need
it for new [templates] section. This isn't a BC as templates defined in
[templates] section weren't loaded until recently.
2017-04-22 21:09:07 +09:00
Yuya Nishihara
544686bbdc changeset_templater: simplify handling of verbosity postfix 2017-04-22 21:06:11 +09:00
Augie Fackler
7bfbf7fa8a merge with stable 2017-06-20 16:33:46 -04:00
Danek Duvall
62a5629fe6 tests: don't touch the network when using virtualenv 2017-06-19 16:08:20 -07:00
Matt Harbison
3a1dae7593 largefiles: avoid a crash when archiving a subrepo with largefiles disabled
This path is also used for extdiff, which is how I crossed paths with it.
Without this, an AttributeError occurs looking for 'lfstatus' on
localrepository.  See also ca0085e432d6.

The other archive method is for the archival.py override, so it doesn't need to
be special cased like this.  (It looks like it is only called for the top level
repo.)  Likewise, the transplant override is also for commands.py.  The other
overrides set lfstatus before examining it.
2017-06-13 22:24:41 -04:00
Martin von Zweigbergk
87c2856ec2 help: correct description of "glob:foo/*" matching
Unlike what the description says, it does not match recursively. Also
add an example of "glob:foo/**" (which does match recursively).
2017-06-12 11:24:21 -07:00
Kevin Bullock
37a82e2a00 Added signature for changeset 28e02e510eac 2017-06-04 08:16:37 -05:00
Gregory Szorc
fc4c9d6ad7 tests: removed ReportedTest exception
The only call site called addFailure before raising, which is
exactly what the failure exception handler does. So this
complexity is not needed.

We have test coverage of this "server failed to start" scenario
and nothing appeared to change.
2017-06-03 17:32:52 -07:00
Gregory Szorc
896a966845 tests: remove support for warned tests
The previous changeset removed the last caller of addWarn(). So,
we rip out that method and all the code related to tracking warned
tests in the results system.

There was even a comment saying we may want to fold warned tests into
the "failed" state, which is what the previous changeset did.
2017-06-03 17:22:45 -07:00
Augie Fackler
c1e3251ee2 contrib: add check-code rule to enforce non-use of python in tests 2017-06-20 09:49:43 -04:00
Augie Fackler
e5d7bd82c5 cleanup: use $PYTHON to run python in many more tests
Spotted one of these, then wrote a check-code rule that caught them
all. It will be the next change.
2017-06-20 09:45:02 -04:00
Augie Fackler
2e5ee0608f tests: enforce use of $PYTHON in tests 2017-06-15 14:22:39 -04:00
Augie Fackler
305e834562 tests: use $PYTHON in #! so we always use the right Python 2017-06-15 14:27:52 -04:00
Augie Fackler
fa569dd767 tests: sed away python #! in test-run-tests.t to avoid some upcoming insanity 2017-06-20 09:33:19 -04:00
Augie Fackler
f08a4d8416 tests: remove #! from primes.py in test-highlight.t
It's about to be a source of trouble, but removing it changes a ton of
test lines, so doing this change as a standalone commit.
2017-06-20 08:44:56 -04:00
Christian Ebert
d05e4bb5d6 keyword: use context manager for rollback locking 2017-06-20 12:51:36 +01:00
Gregory Szorc
ef424bd1cf tests: remove WarnTest
We would raise this if a test didn't return a result code. AFAICT
this can only occur if there is a logic error in the test harness
itself.

I don't think it is worth the code complexity to distinguish this
failure scenario from a regular test failure.
2017-06-03 17:13:35 -07:00
Gregory Szorc
52ea71bafe tests: remove unused IgnoreTest exception
AFAICT its last use was removed in dac81132c652.
2017-06-03 17:09:13 -07:00
Gregory Szorc
e7d240ea93 tests: use unittest.SkipTest
unittest.SkipTest was introduced in Python 2.7. We previously defined
it with our own class so we could run on Python 2.6.
2017-06-03 17:04:42 -07:00
Martin von Zweigbergk
16b7a41d93 changegroup: delete "if True" and reflow 2017-06-15 23:23:47 -07:00
Martin von Zweigbergk
560e5ce4f1 changegroup: let callers pass in transaction to apply() (API)
I think passing in the transaction makes it a little clearer and more
consistent with bundle2.
2017-06-15 22:46:38 -07:00
Martin von Zweigbergk
6700618bdb repair: create transaction for bundle1 unbundling earlier
See earlier patch for motivation.
2017-06-15 23:09:14 -07:00
Martin von Zweigbergk
e57ebfa7c2 unbundle: create transaction for bundle1 unbundling earlier
See earlier patch for motivation.
2017-06-15 22:18:21 -07:00
Martin von Zweigbergk
350d0dfe2e exchange: create transaction for bundle1 unbundling earlier
changegroup.apply() currently creates a transation if there isn't
already one. Having the callers of that method pass in an existing
transaction seems a little cleaner. To do that, we need to make sure
all callers have a transaction. Since the transaction name is used as
a hook argument (HG_TXNNAME), we need to match the name from
changegroup.apply().
2017-06-15 16:10:53 -07:00
Martin von Zweigbergk
ed4a2d83be changegroup: inline 'publishing' variable in apply() 2017-06-19 00:06:23 -07:00
Martin von Zweigbergk
28a143f25f repair: remove unnecessary locking for bookmarks
The caller has already locked the repo.
2017-06-19 11:24:49 -07:00
Martin von Zweigbergk
d8b160077a repair: move check for existing transaction earlier
Several benefits:

 * Gets close the comment describing it
 * Splits off unrelated comment about "backup" argument
 * Error checking is customarily done early
 * If we added an early return to the method, it would still
   consistently fail if there was an existing transaction (so
   we would find and fix that case quickly)

One test needs updating with for this change, because we no longer
create the backup bundle before we fail. I don't see much reason to
create that backup bundle. If some command was adding content and then
trying to strip it as well within the transaction, we would have a
backup for the user, but the risk of that not being discovered in
development seems very small.
2017-06-19 13:18:00 -07:00
Martin von Zweigbergk
64eed0f13b strip: remove unncessary "del" and inline variable 2017-06-19 13:13:28 -07:00
Martin von Zweigbergk
e070466004 repair: clarify in comment that caller must take lock, but not transaction
I have checked that all callers have already taken the lock (and if
they hadn't, we should have seen tests fail thanks to the 'transaction
requires locking' devel warning in localrepo.transaction()).
2017-06-19 11:24:21 -07:00
Martin von Zweigbergk
0016bace9c amend: use context manager for locking 2017-06-19 11:21:37 -07:00
Martin von Zweigbergk
a24c5e2f5e strip: use context manager for locking and transaction in stripcmd() 2017-06-19 11:20:29 -07:00
Martin von Zweigbergk
72fa329bb6 strip: use context manager for locking in strip() 2017-06-19 11:17:31 -07:00
Martin von Zweigbergk
aac8f4879e rebase: use context manager for locking in pullrebase() 2017-06-19 11:18:12 -07:00
Martin von Zweigbergk
042e7bf238 rebase: use context manager for locking in rebase() 2017-06-19 11:18:05 -07:00
Matt Harbison
276f97c4dd test-http-proxy: redirect proxy stdout to /dev/null
This output hasn't been getting flushed, but would alter the log if it ever grew
large enough.  See b6dc6aa294f4.
2017-06-19 21:53:54 -04:00
Matt Harbison
75459d443c test-logtoprocess: don't run on Windows
Several bits of output were missing[1], unless the DETACHED_PROCESS flag is
_not_ passed to subprocess.Popen().  The problem with that is it briefly opens
and closes several cmd.exe windows on screen.  Foozy also mentioned some other
issues in that thread.

With this, the last of the long standing Windows failures fixed, the test suite
now runs cleanly (536 ran, 67 skipped) on Windows 7 x64, with python 2.7.13. \o/

[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-April/096987.html
2017-06-19 21:44:23 -04:00
Yuya Nishihara
c1736d34f9 revset: add support of keyword arguments to ancestors() and descendants()
Prepares for adding depth parameter.
2017-06-18 12:06:22 +09:00
Yuya Nishihara
d1abf1770e revsetlang: check arguments passed to ancestors() before optimizing to only()
Future patches will add depth parameter to ancestors(), which isn't compatible
with only().
2017-06-18 11:57:28 +09:00
Yuya Nishihara
fbc6f41a27 revsetlang: factor out helper to match ancestors() in parsed tree
More checks will be added.
2017-06-18 11:39:03 +09:00
Yuya Nishihara
2db9374d13 templatekw: use common "rev:node" format as the default of predecessors
I'm not sure if this is better. If we're planning to add a template keyword
that returns obsoleted nodes unavailable in the repo (i.e. they have no valid
revision numbers), we might want to use the current "node"-only format
everywhere.
2017-06-17 13:34:18 +09:00
Yuya Nishihara
c3de10454c templatekw: populate all keywords depending on predecessor in map operation
This is what showparents() does. repo[precnode] should never fail since its
validity is tested by closestpredecessors().
2017-06-17 13:23:55 +09:00
Yuya Nishihara
5e5cff46c2 templatekw: reference predecessor node id as {node} in map operation
More predecessor-depending values will be populated by the next patch.
2017-06-17 13:18:03 +09:00
Augie Fackler
856bd5ae00 highlight: put pygments import inside demandimport.deactivated
I tripped on some weirdness relating to _thread vs threading way down
in a dep of highlight recently. I'm not really sure why I'm only just
seeing this defect now, but experimentally this fixes the problem, and
shouldn't cause any load-time slowness for people until pygments is
actually about to be used since highlight.highlight is still lazily
loaded in the highlight/__init__.py file.
2017-06-18 23:05:54 -04:00
Matt Harbison
2ca7e36798 run-tests: explicitly flush test runner output for Windows stability
When hghave testing goes awry, the output order was changing on Windows.

  diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
  --- a/tests/test-run-tests.t
  +++ b/tests/test-run-tests.t
  @@ -920,10 +920,10 @@
      > EOF
      > done
      $ rt -j 2
  -  ....
  +  ....skipped: unknown feature: notarealhghavefeature\r (esc)
  +
  +
      # Ran 5 tests, 0 skipped, 0 warned, 0 failed.
  -  skipped: unknown feature: notarealhghavefeature
  -
      $ cd ..
      $ rm -rf broken

Since 'skipped: unknown feature: notarealhghavefeature\n\n' is printed to stdout
and the rest to stderr, it seems like maybe stdio isn't line buffered on
Windows.  When a program exits, stdout is flushed before stderr[1].

[1] https://blogs.msdn.microsoft.com/oldnewthing/20060519-09/?p=31133
2017-06-18 22:19:54 -04:00
Matt Harbison
602d34124b tinyproxy: explicitly flush logged messages
On Windows, output streams are buffered when redirected to a file, and
TerminateProcess() apparently doesn't trigger a flush.  This left
test-http-proxy.t missing part of the last line when it cat'd proxy.log[1].

Flushing stderr is all that is needed (on py27 anyway).  I originally flushed
stdout too, but that added additional output to the log:

     $ cat proxy.log
  +  Accept: $LOCALIP (localhost)\r (esc)
  +  Serving HTTP on 0.0.0.0 port 20810 ...\r (esc)
  +       connect to localhost:$HGPORT\r (esc)
     * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
  +       bye\r (esc)
  +       connect to localhost:$HGPORT\r (esc)
     * - - [*] "GET http://localhost:$HGPORT/?cmd=branchmap HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
  +       bye\r (esc)
  +       connect to localhost:$HGPORT\r (esc)
     * - - [*] "GET http://localhost:$HGPORT/?cmd=stream_out HTTP/1.1" - - x-hgproto-1:0.1 0.2 comp=*zlib,none,bzip2 (glob)
  +       bye\r (esc)
  +       connect to localhost:$HGPORT\r (esc)
 ...

[1] https://www.mercurial-scm.org/pipermail/mercurial-devel/2017-April/096987.html
2017-06-18 21:31:53 -04:00
Yuya Nishihara
d2a35c3c21 help: clarify ancestors() and descendants() include given set (issue5594)
Also unified "a changeset" to "changesets".
2017-06-18 22:46:56 +09:00
Siddharth Agarwal
41dae969eb status: don't crash if a lookup file disappears
This can happen if another process (even another hg process!) comes along and
removes the file at that time.

This partly resolves issue5584, but not completely -- a bogus dirstate update
can still happen. However, the full fix is too involved for stable.
2017-06-02 22:27:52 -07:00
Xavier Lepaul
a75e0dc064 help: clarify the choice of pager
This follows the change made in 4fba4efc2e2e to use environment variables
between system and user configuration.
2017-06-02 10:44:40 +02:00
Wagner Bruna
66a53a8e31 i18n-pt_BR: fix syntax error on translation 2017-06-02 20:50:46 -03:00
Wagner Bruna
2d3ddc9080 i18n-pt_BR: synchronized with 98315436ecec 2017-06-01 20:06:02 -03:00