Commit Graph

2662 Commits

Author SHA1 Message Date
Pierre-Yves David
c7f20ea1f1 pull: use other.url() as the source of a bookmark pull
We want to move the bookmarks movement into `exchange.pull`, for this purpose we
need to stop relying on variables from `command.pull`.
2014-09-26 10:59:29 -07:00
Yuya Nishihara
deb7a2b54f branches: reduce nesting in for loop 2014-10-02 21:58:10 +09:00
Mads Kiilerich
374f35aab5 templater: introduce templatepaths for getting paths searched for templates
Avoid function with different return types depending on parameters.
2014-09-28 16:57:37 +02:00
Pierre-Yves David
fa008917c9 pull: gather all bookmark-pulling code together
Pulling bookmarks is done in two rounds. First we do a simple update, then we use
the content of the `bookmark` argument to possibly overwrite some bookmark
with their remote location.

The second step was not done right after the first one for some obscure reason.
We now perform them one after the other.
2014-09-25 17:53:27 -07:00
Pierre-Yves David
4af2b1bb81 push: perform bookmark export in the push function
This part is responsible for adding new bookmarks on the remote.  Before that,
it was done on its own in `commands.push`. The export is still not integrated
with the rest of the push process, but at least it now dwells in the right
function.
2014-09-25 02:53:29 -07:00
Pierre-Yves David
90372104e5 push: pass list of bookmark to exchange.push
Currently stored but not unused. This parameter will control bookmarks explicitly
pushed (added to the server if missing).
2014-09-25 01:49:20 -07:00
Pierre-Yves David
7d3ee75e4d push: sanitize handling of bookmark push return value
Mixing return and assignment does not make sense, let's unify this.
2014-09-25 02:53:49 -07:00
Pierre-Yves David
dbad87edcd push: use exchange.push in commands.push
To gain access to all results from the push, we need to have access to the
`pushoperation` object. We call `exchange.push` to do so.

It is impossible to just change the `localrepo.push` signature because the
change may be too subtle to be caught by external extension wrapping
`localrepo.push`.

This mean we'll have to kill `localrepo.push` because just using
`exchange.push` in `commands.py` would silently disable all wrapping around
`localrepo.push` by third-party extensions. So we'll remove it in a later
changeset to get such extensions to fail noisily.
2014-09-25 01:39:39 -07:00
Siddharth Agarwal
f1c5684fc4 files: cache repo.dirstate
For a large repo, 'hg files' goes from 2.27 seconds to 1.92.
2014-09-30 16:01:19 -07:00
Siddharth Agarwal
41071b4456 files: only check for removed, not unknown or missing
ctx.matches() doesn't return unknown files, and repo.dirstate[f] never returns
'!' for an answer.
2014-09-30 15:21:35 -07:00
Siddharth Agarwal
fd44687dc1 files: use ctx.matches instead of ctx.walk
ctx.matches() is an optimized form of ctx.walk() when we don't care about the
state of files on disk.

For a large repo, 'hg files > /dev/null' drops from 3.7 seconds to 2.3.
2014-09-30 14:39:58 -07:00
Siddharth Agarwal
19c947e0ed files: actually filter out removed files
'hg files' makes an attempt to filter out removed files, but that doesn't work
because repo.dirstate[f] returns lowercase 'r', not uppercase.
2014-09-30 15:45:48 -07:00
Matt Mackall
e5c9cc0aaf help: basic support for showing only specified topic sections
For instance, 'hg help config.files' will show only the Files section.
2014-09-30 16:40:10 -05:00
Matt Mackall
34b0d3062c help: support OS-specific help sections
Containers of the form:

  .. container:: verbose.<os>

are shown by default on the given OS (or with -v).
2014-09-30 15:51:22 -05:00
Matt Mackall
275eb5bdd1 merge with stable 2014-09-29 17:23:38 -05:00
Matt Mackall
5f07bb0a47 help: fix typo in log examples 2014-09-29 16:42:12 -05:00
Matt Mackall
e3f89597c5 commands: add debuglocks to report/clear lock state 2014-09-26 16:44:11 -05:00
Yuya Nishihara
679696a5fe tags: use full hash for formatter output as in log or annotate commands 2014-09-21 12:50:48 +09:00
Yuya Nishihara
b70e3d719f tags: change field name of formatter output to be the same as log command
Since -T option is not public yet, this won't break backward compatibility.
2014-09-21 12:46:23 +09:00
Yuya Nishihara
40faa84ff9 files: correct topic of formatter 2014-09-21 12:38:47 +09:00
Matt Mackall
2f833205d7 help: mention mode in hg log --removed help (issue4381) 2014-09-21 10:31:34 -05: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
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
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
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
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
FUJIWARA Katsunori
97d5636e1b commands: make the warning message for "patch --partial" translatable
This patch makes the warning message for "patch --partial"
translatable: this message was introduced by a0ab8b02be69, and there is
no reason to prevent this from being translatable.
2014-08-01 02:14:24 +09:00
Alexandre Garnier
c20b1f5371 debuginstall: handle quoted path for editor (issue4316)
When using an editor path with spaces and options, you can set 'ui.editor'
to '"/path to your/editor" -opt' and it works fine but 'hg debuginstall'
is complaining about it because it simply splits the editor and
tests presence of '"/path'.
Now correctly parse 'ui.editor' string by handling quoted path.
2014-07-31 10:31:56 +01:00
FUJIWARA Katsunori
5f213b8584 doc: unify help text for "--edit" option
This patch changes help text for "--edit" option of commands below:

  - fetch
  - qnew
  - qrefresh
  - qfold
  - commit
  - tag

This unification reduces translation cost, too.

This patch chooses not "further edit commit message already specified"
(of "hg commit") but "invoke editor on commit messages" as unified
help text for "--edit" option, because the latter is much older than
the former.
2014-07-30 00:14:52 +09:00
FUJIWARA Katsunori
3c5c28c967 doc: unify help text for "--message" option
This patch changes help text for "--message" option of commands below
for unification.

  - sign (of gpg)
  - tag

This unification reduces translation cost, too.

This patch doesn't change the description for "--message" of "hg
rebase" below, because this should contain "collapse" word to explain
its purpose (only for "--collapse") clearly.

    use text as collapse commit message
2014-07-30 00:13:59 +09:00
Alexander Becher
8b1b69abc7 graft: add a reference to revsets to the help text (issue3362) 2014-07-28 10:05:17 +02:00
Pierre-Yves David
3efa776f85 resolve: add parenthesis around "no more unresolved files" message
This message may be confused with an error message. Adding parenthesis around it
will make it more recognisable as an informative message.
2014-07-26 03:32:49 +02:00
Matt Mackall
f648f507dd templates: re-add template listing support
We used to have --style nosuch to list templates, but --style is now
merged with --template/-T where random strings are acceptable
templates. So we reserve 'list' to allow listing templates.
2014-07-25 15:35:09 -05:00
Nathan Goldbaum
46f5e72040 resolve: report no argument warning using a hint
With this change resolve and revert produce consistent output when run with no
arguments:

$ hg resolve
abort: no files or directories specified
(use --all to remerge all files)

$ hg revert
abort: no files or directories specified
(use --all to revert all files)
2014-07-24 14:29:08 -07:00
Matt Mackall
97770302de version: don't traceback if no extensions to list (issue4312) 2014-07-23 11:16:22 -05:00
Wagner Bruna
00765540ed commands: fix typo in import documentation 2014-07-20 15:06:12 -03:00
Matt Mackall
b08b629028 merge with stable 2014-09-22 16:14:08 -05:00
Matt Mackall
4821ef7629 commands: deprecate the parents commands
It's replaced by 'hg summary' or hg log -r 'parents(foo)' and
doesn't need to take up space in our command list anymore.
2014-09-22 16:03:07 -05:00
Yuya Nishihara
6ecd008e93 annotate: port to generic templater enabled by hidden -T option
If the selected formatter is other than plainformatter, raw data are passed
to the formatter.  In this case, it isn't necessary (and not possible) to
calculate column widths.

Field names are substituted to be the same as "log" command.

There are a few limitations:

 - "binary file" message is not included in formatted output.
 - no data structure for multiple files. all lines are packed to single list.
2014-09-17 23:21:20 +09:00
Yuya Nishihara
2ee83c76d8 annotate: split functions to get data without applying text formatting
This prepares for porting to generic templater API, where raw data should
be passed to the formatter.

makefunc() is necessary to build closure in list comprehension.
2014-09-16 23:40:24 +09:00
Yuya Nishihara
a29f66e753 annotate: remove unused variable in calculation of column widths 2014-08-29 06:19:32 +02:00
Yuya Nishihara
698aecb7df annotate: build format string separately from annotation data
This prepares for porting to generic templater API.

Note that we cannot use '%*s' to pad white spaces because it doesn't take
into account character widths, as described in b021170a2284.
2014-08-29 05:36:52 +02:00
Yuya Nishihara
00c17ceef6 annotate: remove redundant check for empty list of annotation data
It isn't necessary because zip(*pieces) returns [] if pieces are empty,
and pieces are empty only if lines are empty.
2014-08-29 05:09:59 +02:00
Matt Mackall
402d63aa73 locate: add pointer to files command in help 2014-09-16 11:08:29 -05:00
Matt Mackall
d3c288a6a7 locate: deprecate in favor of files 2014-03-16 13:29:08 -05:00
Matt Mackall
aa7d73cbbb commands: add hidden -T option for files/manifest/status/tags
These commands have generic formatting support but no way to enable it
yet. When this feature is more fully developed, this flag will be unhidden.
2014-09-15 13:15:07 -05:00
Matt Mackall
e7503a440b files: add new command unifying locate and manifest functionality 2014-09-12 18:32:46 -05:00
Matt Mackall
5bfd322b62 ui: move samplehgrcs from config
config is generic code that doesn't know about Mercurial usage, so
this was at the wrong layer
2014-09-11 12:26:12 -05:00
Augie Fackler
dcd5b5a4f4 commit: correctly check commit mutability during commit --amend
The right way to check if a context is mutable is to call .mutable(),
not to compare .phase() with public.
2014-08-19 14:33:31 -04:00