Commit Graph

21860 Commits

Author SHA1 Message Date
FUJIWARA Katsunori
0d1dc1fcfa dispatch: check shell alias again after loading extensions (issue4355)
Before this patch, the shell alias causes failure when it takes its
specific (= unknown for "hg") options in the command line, because
"_parse()" can't accept them.

This is the regression introduced by 7849ac1dbc57.

It fixed the issue that ambiguity between shell aliases and commands
defined by extensions was ignored. But it also caused that ambiguous
shell alias is handled in "_parse()" even if it takes specific options
in the command line.

To avoid such failure, this patch checks shell alias again after
loading extensions.

All aliases and commands (including ones defined by extensions) are
completely defined before the 2nd (= newly added in this patch)
"_checkshellalias()" invocation, and "cmdutil.findcmd(strict=False)"
can detect ambiguity between them correctly.

For efficiency, this patch does:

  - omit the 2nd "_checkshellalias()" invocation if "[ui] strict= True"

    it causes "cmdutil.findcmd(strict=True)", of which result should
    be equal to one of the 1st invocation before adding aliases

  - avoid removing the 1st "_checkshellalias()" invocation

    it causes "cmdutil.findcmd(strict=True)" invocation preventing
    shell alias execution from loading extensions uselessly
2014-09-10 00:41:44 +09:00
FUJIWARA Katsunori
906133d681 dispatch: make "_checkshellalias" reusable regardless of adding aliases
To reduce changes in the subsequent patch fixing issue4355, this patch
makes "_checkshellalias" reusable regardless of adding aliases.

In this patch, alias definitions are added and restored, only when
"precheck=True".
2014-09-10 00:41:44 +09:00
Siddharth Agarwal
ca3e00a8e3 histedit: abort gracefully on --continue/--abort with no state
Previously we'd print an ugly message saying that the histedit-state file
doesn't exist in the repo.
2014-09-03 20:42:51 +02:00
Matt Mackall
01496efef0 Added signature for changeset c2e80605b621 2014-09-02 03:41:01 +02:00
Matt Mackall
8d49d252a8 merge with i18n 2014-09-01 23:43:33 +02:00
Wagner Bruna
aef4c89e3e i18n-pt_BR: synchronized with 359fb11497a4 2014-09-01 10:57:27 -03:00
Wagner Bruna
3853b731ce merge with i18n 2014-09-01 10:54:49 -03:00
FUJIWARA Katsunori
645a149940 i18n-ja: synchronized with 86be79fee795 2014-08-31 20:49:13 +09:00
Gregory Szorc
a57721695a help: only call doc() when it is callable
`hg help -k` on my machine was aborting because the hg-prompt extension
was inserting a string and not a function into help.helptable and help
was blindly calling it.

This patch changes keyword searching to be more robust against
unexpected types.
2014-08-30 20:06:24 +02:00
Mike Hommey
edf6a59652 repoview: fix typo in repoview.changelog
Incidentally, this avoids the changelog cache being invalidated each time
it's accessed on a repoview.

On a filtering experiment on a repository the size of mozilla-central,
this makes a significant difference:

Before, running hg log -l 10 --time with about 8k changesets filtered out:
time: real 1.490 secs (user 1.450+0.000 sys 0.040+0.000)

After:
time: real 0.540 secs (user 0.530+0.000 sys 0.010+0.000)
2014-08-31 19:43:03 +09:00
Kevin Bullock
13972d0b4a bookmarks: refer to "the" active bookmark to clarify that there's only one
This is a follow-on to c6533daf7fc4 that just makes a slight clarification.
2014-08-30 15:13:02 +02:00
Wagner Bruna
e74e5f203b i18n-pt_BR: synchronized with 86be79fee795 2014-08-30 09:40:31 -03:00
FUJIWARA Katsunori
5c74f6bc14 import: show the warning message for failure of merging
Before this patch, no message is shown for failure of merging at "hg
import".

In such case, merging patch is imported as a normal revision silently,
and it may confuse users.

For simplicity, this patch recommends just using "--exact", even
though importing the merging patch itself is possible without it if:

  - the hash of the 1st parent in the patch is equal to one of the
    patch imported just before (or the parent of the working
    directory, for the 1st patch of the series), and

  - the hash of the 2nd parent in the patch is known in the local
    repository
2014-08-27 23:10:06 +09:00
Mads Kiilerich
bb5bc3c743 graft: fix collision detection with origin revisions that are missing
When grafting something with a matching origin, it would normally be skipped:
  skipping already grafted revision 123 (23 also has origin 12)

But after stripping a graft origin, graft could fail with a reference to the
origin that no longer exists:
  abort: unknown revision '5c095ad7e90f871700f02dd1fa5012cb4498a2d4'!

Instead, detect that the origin is unknown and skip it anyway, like:
  skipping already grafted revision 8 (2 also has unknown origin 5c095ad7e90f871700f02dd1fa5012cb4498a2d4)
2014-08-27 15:30:09 +02:00
Sean Farley
a5ff857520 log: use correct phase info for parent field (issue4347)
Previously, there was a copy / paste error with using the current changeset's
phase information. We now look up the parent context explicitly.

The line was too long so it is stored into a variable first.
2014-08-23 17:03:08 -05:00
Thomas De Schampheleire
1c23ea4c79 help: add pad function to template help
Commit 89145c35f76e introduced a pad function for use in templates, but did
not add the corresponding documentation to 'hg help templating'.
2014-08-25 15:10:09 +02:00
Aaron Kushner
c8faef4c5a config: exit non zero on non-existent config option (issue4247)
When running 'hg config no_such_option', hg exited with a
zero exit code. This change now exits with a 1 if the
config option does not exist.
2014-08-19 16:57:02 -07:00
Mads Kiilerich
7f9b497a4c incoming: don't request heads that already are common
Pull would send a getbundle command where common heads were sent both as common
and head, even though there is no reason to request a common head.
The request was thus twice as big as necessary and more likely to hit HTTP
header size limits.

Instead, don't request heads that already are common.

This is fixed in bundlerepo.getremotechanges . It could perhaps also have been
fixed in discovery.findcommonincoming but that would have a bigger impact.
2014-08-15 03:24:40 +02:00
Mads Kiilerich
c6b11d841f tests: improve test coverage for discovery and actual parameters for pulling 2014-08-15 03:24:40 +02:00
Mads Kiilerich
af05e75b06 changectx: ancestor should only prefer merge.preferancestor if it is a revision
The value '*' currently designates that bid merge should be used. The best
way to test bid merge is to set preferancestor=* in the configuration file ...
but then it would abort with unknown revision '*' when other code paths ended
up in changectx.ancestor .

Instead, just skip and ignore the value '*' when looking for a preferred
ancestor.
2014-08-15 02:46:44 +02:00
Mads Kiilerich
26f83c4483 merge: show the scary multiple ancestor hint for merges only, not for updates
Updates with uncommited changes will always only have one ancestor - the parent
revision. Updates between existing revision should (and will) always give the
same result no matter which ancestor is used. The warning is thus only relevant
when doing a "real" merge.
2014-08-15 02:39:01 +02:00
Pierre-Yves David
78f473bc9b discovery: prevent crash on unknown remote heads with old repo (issue4337)
When a remote is not capable of the `branchmap` wireproto command, we denote
incoming heads with None. This leads to a crash in the code in charge of
displaying the list of unknown remote heads.

We now properly detect this case and display a shorter message in this case.

The reason for this  `set([None])` value is now documented.
2014-08-14 16:26:41 -07:00
Pierre-Yves David
8bf8eb1b78 obsstore.create: add a simple safeguard against cyclic markers
We detect when there is a cycle in the marker itself (precursors being listed
as successors).
2014-08-14 14:59:42 -07:00
Pierre-Yves David
eed7417a2c debugobsolete: catch ValueError that may be raised by obsstore.create
There are already a couple of errors that obsstore.create can raise and we are
going to introduce a cycle check too.
2014-08-14 14:57:03 -07:00
Matt Mackall
24638bb76c test-run-tests: fix up slash/backslash on diff chunks for Windows 2014-08-14 16:18:45 -05:00
Siddharth Agarwal
26dccff015 test-largefiles: add test for hg log --follow --patch with path
This was the one case for test-largefiles that was not broken.
2014-08-13 15:55:45 -07:00
Siddharth Agarwal
6e2ab4d61f largefiles: don't override matchandpats for always matchers (issue4334)
This makes hg log --follow --patch work, since in cmdutil._makelogrevset we
use the non-follow matcher for hg log --follow --patch with no file arguments.
2014-08-13 15:51:33 -07:00
Siddharth Agarwal
c70d49625f largefiles: in overridelog, use non-lf matcher for patch generation (issue4334)
This has actually been broken since at least Mercurial 2.8 -- hg log --patch
with largefiles only used to work when no largefiles existed. Rev 658ce4a0a0a9
exposed this bug for all cases.
2014-08-13 15:18:41 -07:00
Siddharth Agarwal
dcc2ebb6cf largefiles: drop setting lfstatus in overridelog (issue4334)
lfstatus should only be True for operations where we want standins to be
printed out. We explicitly do not want that for historical operations like log.
Other historical operations like hg diff -r A -r B don't print out standins
either.

This is required to fix issue4334, but doesn't fix anything by itself. That's
why there aren't any tests accompanying this patch.
2014-08-13 15:13:50 -07:00
Siddharth Agarwal
f07a4ceb07 cmdutil: add a hook for making custom non-follow log file matchers
This will be used by largefiles (and basically only by largefiles) in an
upcoming patch.
2014-08-13 15:17:03 -07:00
Siddharth Agarwal
b112932fc1 cmdutil: rename _makelogfilematcher to _makefollowlogfilematcher
We're going to add a _makenofollowlogfilematcher in an upcoming patch.
2014-08-13 15:15:13 -07:00
Martin von Zweigbergk
69e9a354a2 histedit: preserve initial author on fold (issue4296)
When the authorship of the changeset folded in does not match that of
the base changeset, we currently use the configured ui.username
instead. This is especially surprising when the user is not the author
of either of the changesets. In such cases, the resulting authorship
(the user's) is clearly incorrect. Even when the user is folding in a
patch they authored themselves, it's not clear whether they should
take over the authorship. Let's instead keep it simple and always
preserve the base changeset's authorship. This is also how
"git rebase -i" handles folding/squashing.
2014-08-13 11:50:13 -07:00
Matt Mackall
1fc52a716b run-tests: fix some io ordering
backported from default
2014-08-13 18:50:35 -05:00
Matt Mackall
28afeddddf test-run-tests: fix stdout/stderr io ordering 2014-08-13 14:05:08 -05:00
Matt Mackall
158e001efc run-tests: don't double lines on build failure output 2014-08-12 11:17:29 -05:00
Matt Mackall
696a2d25ed test-run-tests: filter pwd alias for Windows 2014-08-12 11:10:57 -05:00
Matt Mackall
4437029857 run-tests: self-test on Windows needs binary streams 2014-08-12 11:02:30 -05:00
Matt Mackall
17ab77f157 repoview: filter tags to non-existent nodes from blockers (issue4328) 2014-08-12 02:40:42 -05:00
Michael O'Connor
306b55bcc9 revset: bookmark revset interprets 'literal:' prefix correctly (issue4329) 2014-08-11 23:45:08 -04:00
Matt Mackall
f40cbba38d unbundle: fix pyflakes warning about wc 2014-08-11 13:10:00 -05:00
Matt Mackall
65d57189d4 unbundle: don't advance bookmarks (issue4322) (BC)
This behavior didn't make much sense and interacts badly with things
that use unbundle internally like shelve. Presumably, the original
rationale was that since bundles didn't contain bookmarks, this gave a
sense of keeping bookmarks up-to-date like would happen with a
corresponding pull. However, since it only updated the current active
bookmark, and bare update already did that anyway, this is pretty
slim.

Notably, the corresponding test actually works better without this
feature.
2014-08-10 23:09:23 -05:00
Matt Mackall
2bfc2c18d4 tests: more bundle2 non-binary file test fixes 2014-08-10 15:26:12 -05:00
Matt Mackall
7a68007f38 hgweb: avoid config object race with hgwebdir (issue4326)
Turns out hgwebdir passes full repo objects to each hgweb request
instance, but with a shared baseui. We explicitly break the sharing.
2014-08-10 13:53:36 -05:00
Matt Mackall
8bff782c4b test-commandserver.py: filter path separator
Was failing on Windows:

-bundle.mainreporoot=$TESTTMP/repo
+bundle.mainreporoot=$TESTTMP\repo
2014-08-09 16:15:52 -05:00
Matt Mackall
4c8a0f6ac6 merge with i18n 2014-08-09 16:05:03 -05:00
Matt Mackall
c4175c9947 i18n-ru: fix RST breakage spotted by test-gendoc
test-gendoc complained:

   % extracting documentation from ru
   checking for parse errors
+  gendoc-ru.txt:5686: (WARNING/2) Field list ends without a blank
   line; unexpected unindent.
+  gendoc-ru.txt:8327: (WARNING/2) Definition list ends without a
   blank line; unexpected unindent.
2014-08-09 16:04:36 -05:00
Matt Mackall
b1763500b3 i18n-ru: undo fix buildbot breakage
Buildbot complained:

   $ python check-translation.py *.po
+  ru.po:9576:fatal(promptchoice): number of choices differs between
msgid and msgstr
+  [1]

Prompt text was obviously wrong.. because it didn't include a prompt.
2014-08-09 15:46:54 -05:00
Alexander Sauta
fcd2aba024 i18n-ru: syncronized with 0c46fc3bf33b 2014-08-04 16:08:42 +01:00
Alexander Sauta
ffd3e9a4f6 merge with i18n 2014-08-04 16:21:58 +01:00
Alexander Sauta
46861b290d i18n-ru: sync with 664883681beb (fuzzies) 2014-08-04 18:51:18 +04:00