Commit Graph

14422 Commits

Author SHA1 Message Date
Peter Arrenbrecht
421dba9540 color: fix --color=always when output is piped
Also restructures the mode determination as discussed on IRC.
I tried to simplify the code too, while keeping the original
semantics except for the case of --color=always.
2011-05-25 18:48:00 +02:00
Martin Geisler
af8a35e078 check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +02:00
Augie Fackler
6f67427a80 run-tests: allow whitelisting tests that should always run
It's desirable to run some tests all the time, for example
test-check-pyflakes.t and test-check-code-hg.py. This allows passing
--whitelist as a path to a file (flag can be specified more than once)
which contains a list of files to whitelist. Whitelisted tests are run
even if they're blacklisted or wouldn't match a --keyword test
run. For example, to do a quick test of usehttp2, one can now do

  $ cat > test-whitelist <<EOF
  > test-check-pyflakes.t
  > test-check-code-hg.py
  > EOF
  $ (cd tests && ./run-tests.py --extra-config-opt 'ui.usehttp2=true'
  >                             -k http -j 8  --whitelist test-whitelist)

and have all http-specific tests run as well as the two code linters.
2011-05-31 20:39:04 -05:00
Augie Fackler
2578f4f9f2 subrepo: make stdin for svn a pipe for non-interactive use (issue2759)
This certainly can't hurt, so go ahead and do it, potentially along
with --non-interactive if that flag is safe for the given subcommand.
2011-05-31 19:49:17 -05:00
Matt Mackall
479dfb8747 tests: glob version number in test-hgrc 2011-05-31 17:18:23 -05:00
Steven Brown
a8c12e93a7 web: provide diffstat to the changeset page
This includes all affected files, so it can be used for an extended view of
the files or as a replacement for the filenodelink and filenolink templates.
2011-05-28 14:44:45 +08:00
Matt Mackall
20e41fa990 tests: update for handling of missing hgrc includes 2011-05-31 16:24:47 -05:00
Regis Desgroppes
422cfa6bde subrepo: svn abort now depends on exit code (issue2833) 2011-05-31 16:22:04 -05:00
Matt Mackall
ebb03b5a77 config: ignore include errors for nonexistent files 2011-05-31 16:00:39 -05:00
Brendan Cully
ea84333a75 Make pull -u behave like pull && update
Previously, pull would not update if new branch heads were received,
whereas pull && update would move to the tipmost branch head.

Also change the "crosses branches" abort in merge.update from
"crosses branches (merge branches or use --check to force update)"
to
"crosses branches (merge branches or update --check to force update)"

since it can no longer assume the user is running hg update.
2011-05-31 11:52:22 -07:00
Matt Mackall
b0048281b5 requires: note apparent corruption 2011-05-31 15:55:23 -05:00
Adrian Buehlmann
cfc4484960 readrequires: provide easier to understand error message
NEW:

  $ hg id
  abort: unknown repository format: requires feature 'foo' (upgrade Mercurial)!

OLD:

  $ hg id
  abort: requirement 'foo' not supported!
2011-05-31 19:16:25 +02:00
Adrian Buehlmann
924c56c606 introduce new function scmutil.readrequires
for reading and parsing the .hg/requires file
2011-05-31 19:16:18 +02:00
Matt Mackall
e5b463de99 merge with stable 2011-05-31 15:28:23 -05:00
Matt Mackall
66ffe5ba1e merge with crew 2011-05-31 15:26:02 -05:00
Matt Mackall
21fbbb6f17 merge with i18n 2011-05-31 15:25:43 -05:00
Idan Kamara
69cc9dd98e mq: no need to make a copy of seriesopts
the command decorator takes care of copying the
options (introduced in a1338167b2ad)
2011-05-30 21:44:03 +03:00
Martin Geisler
774f5abfa7 merge with stable 2011-05-30 12:21:53 +02:00
Martin Geisler
3b1a193cbb merge with hg-i18n 2011-05-30 12:21:08 +02:00
Martin Geisler
1c3f47671a merge with hg-i18n 2011-05-30 12:20:36 +02:00
Martin Geisler
731d787518 test-gendoc: update for new Russian translation 2011-05-30 11:52:17 +02:00
Alexander Sauta
69da0530be i18n-ru: branches-import translated 2011-05-30 01:24:21 +04:00
Alexander Sauta
2d4abd7ab6 i18n-ru:bisect,backout,branch translated 2011-05-29 02:33:36 +04:00
Alexander Sauta
5d03bda354 i18n-ru: translated add, addremove, annotate, archive 2011-05-29 01:42:59 +04:00
Alexander Sauta
2ed10e9b98 i18n-ru:translation started,convert translated 2011-05-29 01:31:12 +04:00
Eric Eisner
55bac452e8 subrepo: don't crash when git .hgsubstate is empty (issue2716) 2011-05-28 11:03:48 -04:00
Adrian Buehlmann
a216345ef2 workingctx.remove: use self.forget 2011-05-27 21:11:44 +02:00
Martin Geisler
e495964784 commands: use repo.branchheads in heads command 2011-05-31 13:18:56 +02:00
Martin Geisler
f365370231 commands: remove unused variable from heads command
The b variable has not been needed since 5333bad7a76b. Renamed ls
variable to bheads for clarity.
2011-05-31 09:59:03 +02:00
Martin Geisler
57e33178d6 mq: print "'foo' 'bar'", not "['foo', 'bar']" when showing guards
The internal list representation of guards was leaking into the
output. The guards were always printed using repr(guard) and that
style was kept.

When "hg qguard -l" prints several guards for a patch, it does so by
joining the names with " " and that style was used for the error
messages too.
2011-05-31 08:47:16 +02:00
Adrian Buehlmann
5e0e57cb94 commands.remove: don't use workingctx.remove(list, unlink=True)
workingctx.remove(list, unlink=True) is unsuited here, because it does too
much: it also unlinks added files. But the command 'hg remove' is specified
to *never* unlink added files.

Instead, we now unlink the files at the commands.remove level (if --after was
not specified) and use workingctx.forget for all files.

As an added bonus, this happens to eliminate a wlock acquire/release pair,
since the previous implementation caused

   acquire wlock
   release wlock
   acquire wlock
   release wlock

where the first pair of acquire/release was caused by the workingctx.forget
call, and the second by the workingctx.remove call.
2011-05-27 15:59:52 +02:00
Idan Kamara
09c86872e4 tests: add a test to check for duplicate command options 2011-05-27 17:51:16 +03:00
Idan Kamara
1c58f33fac mq: allow --mq for qrecord 2011-05-27 17:49:54 +03:00
Idan Kamara
f4c2cac599 run-tests: fix --blacklist with jobs > 1
filter blacklisted tests before partitioning them
to the children.

maintains the 'Skipped...' output but not the 's'.
2011-05-27 17:46:48 +03:00
Idan Kamara
13676f41c0 run-tests: slightly simplify blacklist check 2011-05-27 17:46:47 +03:00
Matt Mackall
fd5cc95a4a coal: use preformatted text for descriptions (issue2835)
The coal style was broken here by an earlier change to paper, which
shares files.
2011-05-27 08:50:27 -05:00
Martin Geisler
4cb518e9a1 hg: remove underscores in clone function 2011-05-27 12:42:36 +02:00
Idan Kamara
04f3767289 hg-ssh: fix dispatch call to use dispatch.request()
e1a0c549e195 changed dispatch.dispatch() to accept a
request object instead of a list of arguments
2011-05-29 13:43:50 +03:00
Martin Geisler
9573c538b1 gendoc: config help topic is in hgrc.5, do not include it in hg.1 2011-05-30 11:18:47 +02:00
Martin Geisler
5cdd89938e doc: improve merge between hgrc.5 and config help topic 2011-05-30 11:15:25 +02:00
Martin Geisler
8a54b72005 doc: rebuild hgrc.5 man and HTML page when help/config changes 2011-05-30 11:14:31 +02:00
Martin Geisler
7cbe536a61 help/config: separate terms with a blank line
This makes it easier for translators since they can then translate
each term individually.
2011-05-30 10:35:43 +02:00
Martin Geisler
a66b0892f8 help/config: fix rendering of definition list
Without the blank line, the minirst parser renders

  Term-1
    Line-1

    Line-2
  Term-2
    Line-1

as

  Term-1
    Line-1

  Line-2 Term-2 Line-1

because the second term is seen as a paragraph.
2011-05-30 10:30:46 +02:00
Yun Lee
657bb2225f help: move part of hgrc.5 man page config help topic 2011-05-30 10:21:39 +02:00
Yun Lee
5e2a128d7e hgrc.5: make minirst find headings correctly
The minirst parser is stricter than Docutils here and require a blank
after a heading. Otherwise the heading is classified as a paragraph.
2011-05-30 10:05:39 +02:00
Patrick Mezard
51439bc0e1 run-tests: fix --blacklist (broken by 098f69771978) 2011-05-28 11:44:27 +02:00
Patrick Mezard
ab82a700d3 patch: do not patch unknown files (issue752) 2011-05-27 21:50:11 +02:00
Patrick Mezard
d4b7db6294 patch: use temporary files to handle intermediate copies
git patches may require copies to be handled out-of-order. For instance, take
the following sequence:

  * modify a
  * copy a into b

Here, we have to generate b from a before its modification. To do so,
applydiff() was scanning for copy metadata and performing the copies before
processing the other changes in-order. While smart and efficient, this approach
complicates things by handling file copies and file creations at different
places and times. While a new file must not exist before being patched a copied
file already exists before applying the first hunk.

Instead of copying the files at their final destination before patching, we
store them in a temporary file location and retrieve them when patching. The
filestore always stores file content in real files but nothing prevents adding
a cache layer. The filestore class was kept separate from fsbackend for at
least two reasons:

- This class is likely to be reused as a temporary result store for a future
  repository patching call (entries just have to be extended to contain copy
  sources).

- Delegating this role to backends might be more efficient in a repository
  backend case: the source files are already available in the repository itself
  and do not need to be copied again. It also means that third-parties backend
  would have to implement two other methods. If we ever decide to merge the
  filestore feature into backend, a minimalistic approach would be to compose
  with filestore directly. Keep in mind this copy overhead only applies for
  copy/rename sources, and may even be reduced to copy sources which have to
  handled ahead of time.
2011-05-27 21:50:10 +02:00
Patrick Mezard
e6f284be06 patch: refactor file creation/removal detection
The patcher has to know if a file is being created or removed to check if the
target already exists, or to actually unlink the file when a hunk emptying it
is applied. This was done by embedding the creation/removal information in the
first (and only) hunk attached to the file.

There are two problems with this approach:

- creation/removal is really a property of the file being patched and not its
  hunk.

- for regular patches, file creation cannot be deduced at parsing time: there
  are case where the *stripped* file paths must be compared. Modifying hunks
  after their creation is clumsy and prevent further refactorings related to
  copies handling.

Instead, we delegate this job to selectfile() which has all the relevant
information, and remove the hunk createfile() and rmfile() methods.
2011-05-27 21:50:09 +02:00
Adrian Buehlmann
63c4bf2469 rebase: add option --tool/-t for 'pull --rebase'
This makes 'pull --rebase' consistent with the merge command, which already
provides that option to control the merges
2011-05-27 10:03:29 +02:00