Commit Graph

2092 Commits

Author SHA1 Message Date
Matt Mackall
1d5abac148 help: consolidate topic hooks in help.py
This removes loops like cmdutil->revset->help->extensions->cmdutil and
simplifies the code.
2011-05-13 12:57:27 -05:00
Matt Mackall
d184ed2af2 extensions: drop maxlength from enabled and disabled
This is a bad/silly API. Instead calculate maxlength in one place in help
it's used and simplify all the callers.
2011-05-13 11:04:51 -05:00
Sune Foldager
b5be0ed65d debugrevlog: many improvements 2011-05-12 22:37:52 +02:00
Sune Foldager
8f3ebca381 add debugrevlog command
Displays data and statistics about revlogs, including generaldelta details.
2011-05-12 18:22:49 +02:00
Sune Foldager
3d7c8d3ac3 order commands alphabetically 2011-05-12 16:21:01 +02:00
Adrian Buehlmann
bd06e02be8 commands: use a decorator to build table incrementally
this allows to define the table entries near the command functions
2011-05-12 08:14:04 +02:00
Matt Mackall
72b9ca1b3b cmdutil: make_file to makefileobj 2011-05-10 16:08:47 -05:00
Matt Mackall
cf2d9729ae cmdutil: make_filename -> makefilename 2011-05-10 16:08:46 -05:00
Matt Mackall
e53ca7b463 cmdutil: bail_if_changed to bailifchanged 2011-05-10 16:08:46 -05:00
Martin Geisler
58a533fee9 help: add -c/--command flag to only show command help (issue2799) 2011-05-10 14:42:53 +02:00
Martin Geisler
0f668c1b4f help: give hint about 'hg help -e' when appropriate
The hint is only given if a command shadows an extension with the same
name and when that extension has a multi-line module docstring.
2011-05-10 13:19:05 +02:00
Martin Geisler
7564668184 commit: improve --date help text 2011-04-26 12:55:26 +02:00
Kevin Bullock
4669edf97c identify: further clarification of help
Following on to 9010cb9bd620, correct a minor grammar issue, re-wrap to
72 columns, and further clarify wording.
2011-04-19 13:33:43 -05:00
Idan Kamara
44990ce111 identify/help: say what the command does first, mention bookmarks 2011-04-19 00:41:47 +03:00
Miloš Hadžić
b3d3d7aa76 push/outgoing: print remote target path even if there's an error (issue2561)
This is a simple patch to make hg push/hg outgoing print their remote target
path even if the operation fails. I'm not sure if the original behavior was by
design.

This patch also changes one test to reflect the changed behaviour.
2011-03-17 22:55:02 +01:00
Augie Fackler
43844331a5 help command: use safehasattr instead of hasattr 2011-07-25 15:36:13 -05:00
Augie Fackler
ce21ec52f9 debugignore: use getattr instead of hasattr 2011-07-25 16:36:56 -05:00
Augie Fackler
fdd2f9d735 globally: use safehasattr(x, '__call__') instead of hasattr(x, '__call__') 2011-07-25 16:24:37 -05:00
Matt Mackall
e7ac311a48 merge with stable 2011-07-22 17:17:23 -05:00
Augie Fackler
761e80b9ae summary: allow color to highlight active bookmark 2011-07-21 15:52:08 -05:00
Augie Fackler
2847cf3f0e summary: show bookmarks separate from tags and note active mark (issue2892) 2011-07-18 07:53:26 -05:00
Matt Mackall
4a89ce9319 commit: suppress spurious new head message for duplicate commit (issue2893) 2011-07-13 16:43:18 -05:00
Martin Geisler
8b87ff203b merge with stable 2011-07-07 10:34:19 +02:00
Martin Geisler
364d063687 commands: use mergetoolopts when a command supports --tool 2011-07-07 10:19:37 +02:00
Idan Kamara
7396d00ec0 commands, merge: call setconfig on the right ui
In practice this doesn't change anything since ui == repo.ui here, but setting
repo.ui explicitly here is clearer since hg.merge will use repo.ui later on.
2011-07-05 14:36:33 +03:00
Benoit Boissinot
bd2935644e bookmarks: fix update of the current bookmark during rename
We need to get rid of the previous bookmark after changing current bookmark.
2011-03-13 15:42:24 +01:00
Kevin Bullock
111736008c id: add bookmarks to id
Since bookmarks are no longer merged with repo.tags() as of
8e2d23f4bd25, they don't show up in `hg id` as they used to. This adds
them back into the summary that `hg id` prints, and adds a
-B/--bookmarks flag alongside the -t/--tags and -b/--branch options.

Note this introduces a slight backwards-incompatibility: the summary
printed by `hg id` now separates bookmarks from tags with a space, as
seen below, instead of running it into the tags list.

Default summary output:

  $ hg id
  db815d6d32e6 tip/tag1 bm1/bm2

Output with --bookmarks:

  $ hg id --bookmarks
  bm1 bm2

See also 5672c9e8202d which adds bookmarks back into `hg summary`.
2011-02-18 17:09:08 -06:00
Jonathan Nieder
be4a063fb7 backout: clarify which changesets are new in help text
Plus another wording tweak ("default behavior -> "behavior without
--merge").

Suggested by Kevin Bullock.
2011-02-11 21:17:27 -06:00
Martin Geisler
6d0223473c commands: update year to 2011 in version string 2011-02-25 11:39:19 +01:00
Martin Geisler
276fc6ed07 commands: mark strings for translation 2011-02-24 15:35:22 +01:00
David Soria Parra
cfd53141e2 summary: add bookmarks to summary 2011-02-21 23:27:45 +01:00
David Soria Parra
2d34c64dae bookmarks: issue a warning if remote doesn't support comparing bookmarks
We want to issue a warning and abort comparing bookmarks if remote doesn't
support it. Otherwise hg out -B will list you outgoing bookmarks that cannot
be pushed to the remote repository using hg push -B.
2011-02-21 22:22:12 +01:00
David Soria Parra
fe7c493017 bookmarks: mark new bookmark as current if it points to the current dirstate
hg bookmark -r ancestorrev X will not mark X as the current bookmark anymore.
If you want to point a bookmark to a ancestor rev you will use hg update to
move to it. This will set the current bookmark.
2011-02-20 00:57:55 +01:00
David Soria Parra
12aa64e430 bookmarks: make track.current=True default behaviour and remove option (BC) 2011-02-16 01:29:26 +01:00
David Soria Parra
e0c062923b update: preserve possible bookmark name to set current bookmark correctly 2011-02-16 01:28:42 +01:00
Kevin Bullock
f9d396be75 bookmarks: update help text since moving into core
Clarifies the help text for the bookmarks command regarding the
requirements for pushing or pulling bookmarks.
2011-02-14 23:59:21 -06:00
jfh
48eb3f266f debugignore: catch the case when ignore.includepat doesn't exist
In testing of my recent addition of a debugignore command, some of my MacHg
users uncovered the exceptional case that if there is no ignore patterns of any
kind then a traceback occurred. Catch and fix this case.
2011-02-15 23:23:16 +13:00
Dan Villiom Podlaski Christiansen
ec590d5cd4 explicitly close files
Add missing calls to close() to many places where files are
opened. Relying on reference counting to catch them soon-ish is not
portable and fails in environments with a proper GC, such as PyPy.
2010-12-24 15:23:01 +01:00
jfh
76026ecba1 add debugignore which yields the combined ignore patten of the .hgignore files
For GUI clients its sometimes important to know which files will be ignored and
which files will be important. This allows the GUI client to skipping redoing a
'hg status' when the files are ignored but have changed. (For instance, a
typical case is that the "build" directory inside some project is ignored but
files in it frequently change.)
2011-01-15 16:02:03 +01:00
David Soria Parra
6759d1e574 localrepo: sort hg bookmark output
sort bookmarks before we write them to stdout to get a predictable output.
2011-02-11 20:35:32 +01:00
Matt Mackall
d27d1fae16 bookmarks: move push/pull command features to core 2011-02-10 13:46:28 -06:00
Matt Mackall
75941859fe bookmarks: merge current tracking on update into core 2011-02-10 13:46:28 -06:00
Matt Mackall
7f7e9f2814 bookmarks: merge incoming/outgoing into core 2011-02-10 13:46:28 -06:00
Javi Merino
5ca27e6961 doc: Add back quotes around filenames
Filenames starting with a dot (.hg and .hgignore) confuse man when
creating the ps documentation with "man -t hg >hg.ps" if they are not
enclosed in back quotes.
2011-02-05 13:59:34 +00:00
Martin Geisler
6090144a5b merge with stable 2011-02-04 09:17:07 +01:00
Jonathan Nieder
59cebab2ef backout: make help more explicit about what backout does
The help for backout explains:

   The backout command merges the reverse effect of the reverted
   changeset into the working directory.

Unfortunately, that does not make it obvious to a newcomer what the
backout command does.  Since it performs a 3-way merge, what is the
common ancestor?  Will the result be automatically committed?  What is
this reverted changeset --- is it the rev passed with -r on the
command line or its inverse?

So try to clarify the description, avoiding jargon and being
explicit about what happens from the user's perspective.

Thanks to Gilles Moris, Steve Borho, Kevin Bullock, and timeless for
help.
2011-02-03 00:27:44 -06:00
Yuya Nishihara
da93c3bd0b url: add --insecure option to bypass verification of ssl certificates
If --insecure specified, it behaves in the same way as no web.cacerts
configured.

Also shows hint for --insecure option when _verifycert() failed. But currently
the hint isn't displayed on SSLError, because it needs a certain level of
changes.
2011-01-29 23:23:24 +09:00
Mads Kiilerich
0c2d4a2e7e merge with stable 2011-02-01 01:55:45 +01:00
Adrian Buehlmann
18144d9b0d commit: use the term SCM instead of RCS
for consistency.

see also da931fd0b5b6
2011-01-18 14:16:27 +01:00
Martin Geisler
d2eec2cbbc commands: clarify which aliases "hg help -v" show (issue2572) 2011-01-05 10:47:35 +01:00
Adrian Buehlmann
721e368ac1 rename util.unlink to unlinkpath 2011-01-02 19:34:41 +01:00
Martin Geisler
dc8a50e193 merge with stable 2011-01-05 15:56:03 +01:00
Kevin Bullock
6d031e2cdb tag: abort if not at a branch head (issue2552)
Since it's usually only desirable to make tag commits on top of branch
heads, abort if the working dir parent is not a branch head. -f/--force
may be passed to commit at a non-head anyway.

Does not abort if working dir parent is a named branch head but not a
topological head.
2010-12-06 22:04:10 -06:00
Kevin Bullock
90e6b3e885 tag: fix uncommitted merge check and error message (issue2542)
This patch corrects the check for tagging on an uncommitted merge. We
should never commit a new tag changeset on an uncommitted merge, whether
or not --rev is specified. It also changes the error message from:

  abort: cannot partially commit a merge (do not specify files or patterns)

to the much more accurate (and terse):

  abort: uncommitted merge

Local tags are ok.
2010-12-07 08:02:54 +01:00
Mads Kiilerich
b89ce1b270 extensions: warn about invalid extensions when listing disabled commands
Invalid extensions in hgext/ could in some cases cause a crash when searching
for unknown commands in disabled extensions.

With this change we issue a warning if extracting commands from the extensions
fails. Traceback is available on request.

Reported on https://bugzilla.redhat.com/show_bug.cgi?id=663183 with forest.py.
2010-12-26 00:43:49 +01:00
Matt Mackall
fbcb895f80 merge with stable 2010-12-14 17:10:01 -06:00
Adrian Buehlmann
ca7126202b serve: fix doc typo 2010-11-26 18:45:35 +01:00
Richard Hopkins
67793c0851 gpg, commands: fixed util.abort to util.Abort typos
gpg: Fixed util.abort typo after entering wrong password.
commands: Fixed util.abort typo in debugindex.
2010-11-09 20:25:56 +00:00
Matt Mackall
dbab506672 debugindex: add --format flag to allow debugging parentdelta
-f 1 shows extra data from revlogv1 (aka revlogng) including flags and size

(based on a patch by Pradeepkumar Gayam <in3xes@gmail.com>)
2010-10-30 02:47:35 -05:00
Matt Mackall
15ad3a76d6 merge with stable 2010-12-01 18:47:40 -06:00
Matt Mackall
8b31da4540 branch: operate on branch names in local string space where possible
Previously, branch names were ideally manipulated as UTF-8 strings,
because they were stored as UTF-8 in the dirstate and the changelog
and could not be safely converted to the local encoding and back.

However, only about 80% of branch name code was actually using the
right encoding conventions. This patch uses the localstr addition to
allow working on branch names as local strings, which simplifies
handling so that the previously incorrect code becomes correct.
2010-11-24 15:56:32 -06:00
timeless
f425b70af2 revert: improve merge advice and favor its error over all 2010-11-20 20:41:48 +02:00
Martin Geisler
573e60523a merge with stable 2010-11-11 07:23:38 +01:00
Martin Geisler
9d82b9ed1f check-code: using and/or/not as a function is bad style 2010-11-11 00:08:09 +01:00
Matt Mackall
72b5ba88f5 commands: add revset support to most commands 2010-11-04 16:21:28 -05:00
Steve Borho
1b8a5c4173 import: add another line feed to message join string
Changeset descriptions are not guaranteed to have a trailing carriage
return.
2010-11-04 11:33:57 -05:00
Steve Borho
4259758ee2 import: --no-commit should update .hg/last-message.txt
The patch parser goes through all of that trouble extracting the
commit message from the patch file.  It seems such a waste not to
use it.
2010-10-21 16:04:34 -05:00
Gilles Moris
23f58d26b8 log: do case insensitive search for --user option 2010-10-20 15:32:35 +02:00
Mads Kiilerich
eaea535bf7 subrepo: propagate non-default pull/push path to relative subrepos (issue1852) 2010-10-27 00:28:40 +02:00
Matt Mackall
4d7b056fed traceback: point to BugTracker on the wiki 2010-10-25 13:06:37 -05:00
Matt Mackall
b6427b4a0a version: replace email address with url to reduce private mail 2010-10-24 16:02:10 -05:00
Patrick Mezard
c832c42c0c revsets: generate predicate help dynamically 2010-10-23 19:21:51 +02:00
Steve Borho
e74d5a4302 backout: add --tool argument for specifying merge tool 2010-10-22 11:58:43 -05:00
Mads Kiilerich
1c09b9028f help: improve merge-tools topic, describe --tool and clarify details
This doesn't make it simpler, but it makes it more correct.

With help from erikz, mg and abuehl.
2010-10-22 17:08:15 +02:00
Martin Geisler
9a658564bb commands: mark tip:0 as literal text
If left unquoted, this is seen as a link to '0' using protocol 'tip'
because of some over-eager link-finding magic in Docutils.
2010-10-21 21:26:32 +02:00
Steve Borho
a3baf6a2e7 merge: implement --tool arguments using new ui.forcemerge configurable
ui.forcemerge is set before calling into merge or resolve commands, then unset
to prevent ui pollution for further operations.

ui.forcemerge takes precedence over HGMERGE, but mimics HGMERGE behavior if the
given --tool is not found by the merge-tools machinery.  This makes it possible
to do:  hg resolve --tool="python mymerge.py" FILE

With this approach, HGMERGE and ui.merge are not harmed by --tool
2010-10-19 22:33:52 -05:00
Steve Borho
c299e2623a merge: when --tool is specified, disable HGMERGE by setting to empty string
HGMERGE has different semantics than ui.merge.  HGMERGE should hold the name
on an executable in your path, or an absolute tool path.  As such, it's not
safe to simply copy the user's specified --tool value into HGMERGE.  Instead,
we disable HGMERGE by setting it to an empty string.
2010-10-18 23:20:14 -05:00
Adrian Buehlmann
b9ef72891e Revert: capitalization doc fix 2010-10-17 00:45:34 +02:00
Steve Borho
e484985865 merge: add --tool argument to merge and resolve
These arguments are shorthand for --config ui.merge, but they also
override HGMERGE if it is found in the user's environment.
2010-10-15 23:00:45 -05:00
Gilles Moris
16cffc19ee backout: provide linear backout as a default (without --merge option)
This changes backouts changeset to retain linear history, .e. it is committed
as a child of the working directory parent, not the reverted changeset
parent.

The default behavior was previously to just commit a reverted change as a
child of the backed out changeset - thus creating a new head. Most of
the time, you would use the --merge option, as it does not make sense to
keep this dangling head as is.
The previous behavior could be obtained by using 'hg update --clean .' after a
'hg backout --merge'.

The --merge option itself is not affected by this change. There is also
still an autocommit of the backout if a merge is not needed, i.e. in case
the backout is the parent of the working directory.

Previously we had (pwd = parent of the working directory):
                  pwd     older
backout           auto    merge
backout --merge   auto    commit

With the new linear approach:
                  pwd     older
backout           auto    commit
backout --merge   auto    commit

auto: commit done by the backout command
merge: backout also already committed but explicit merge and commit needed
commit: user need to commit the update/merge
2010-09-10 10:28:18 +02:00
Augie Fackler
457b3d77e0 update: use revsingle to enable use of revsets as update targets (issue1993) 2010-10-11 10:07:42 -05:00
Benoit Boissinot
19dff6e720 merge with mpm 2010-10-11 13:26:29 -05:00
Dirkjan Ochtman
5cfefa5c93 commands: add move alias for the rename command
svn provides move, and it's also a standard tool on Windows.
2010-10-11 13:49:53 +02:00
Matt Mackall
a3ff3a53e2 util: make wrap() require a width argument
This keeps hgweb's help engine from poking at file descriptors that
don't exist.
2010-10-10 18:02:52 -05:00
Brodie Rao
78b26c82ec showconfig: don't accept multiple sections and one config item
Showconfig now behaves as documented and only accepts one section.name argument
or a number of section names.
2010-10-09 16:55:33 -05:00
Augie Fackler
42c8b2cf07 termwidth: move to ui.ui from util 2010-10-10 10:06:36 -05:00
Kevin Bullock
3d8e7943fe help: improve description of update --check 2010-10-07 23:34:21 -05:00
Matt Mackall
9ccbd76ee4 revsets: introduce revsingle helper
revsingle returns a context for the last revision of the supplied revspec
2010-10-07 18:24:29 -05:00
Martin Geisler
922824bfe1 heads: mention STARTREV in synopsis and help for --rev
Before this change, "hg help heads" said

  hg heads [-ac] [-r REV] [REV]...

      [...]
      If STARTREV is specified, only those heads that are descendants
      of STARTREV will be displayed.
      [...]

   -r --rev REV       show only heads which are descendants of REV
   [...]

which made little sense since there are two things called REV in the
synopsis and nothing called STARTREV.

A little digging reveals that the "[-r REV]" part of the synopsis was
introduced in 3acdabb0ef1d, changed to "[-r STARTREV]" in
68df96e9e749, and then changed back to "[-r REV]" in 5c78ba00bf0c.

The last change seems to be based on a patch[1] on our mailinglist
that actually *inserted* STARTREV again in the help for the command
line option itself. For some reason, the patch was changed to remove
STARTREV from the synopsis.

This change finally makes the help consistent by putting STARTREV back
into the help in all places where it is needed:

  hg heads [-ac] [-r STARTREV] [REV]...

      [...]
      If STARTREV is specified, only those heads that are descendants
      of STARTREV will be displayed.
      [...]

   -r --rev STARTREV  show only heads which are descendants of STARTREV
   [...]

This was not possible until 7ba070acb8f7, which introduced the
possibility of naming the meta variables for each option.

[1]: http://mercurial.markmail.org/message/qgc55gd4fam4ogvz
2010-10-01 23:16:11 +02:00
Mads Kiilerich
11c8cc29c9 init: expand destination url as a configured paths
Most commands expands configured paths when repositories are specified, just as
the urls help says. Clone also expands the destination path. Clone is morally
equivalent to init + push/pull, so init should also expand the destination path
- and that is what this patch makes it do.

There is no really good usecases for this and in most cases it doesn't matter,
but consistency is nice, and otherwise we would have to document the exception.
2010-09-29 01:32:51 +02:00
Mads Kiilerich
afaab15e7e serve: let --web-conf help reference hgweb 2010-09-29 01:32:50 +02:00
Erik Zielke
ddbd88fdcf incoming/outgoing: Fix recursion on sub repositories
Incoming and outgoing are fixed so they go through the whole three of
repositories instead of only visiting first level of sub repositories.
2010-09-24 12:00:55 +02:00
Christian Ebert
3fb88c8dbb Use more note admonitions in help texts 2010-09-23 16:31:38 +02:00
Erik Zielke
c732a9771b Use note admonition 2010-09-22 16:23:55 +02:00
Martin Geisler
b4116c95c0 merge with stable 2010-09-23 10:59:21 +02:00
Brodie Rao
20c102ca36 grep: only catch re.error when compiling regular expressions 2010-09-22 19:15:27 -05:00
Mads Kiilerich
82136a3aba merge with stable 2010-09-23 01:59:02 +02:00
Mads Kiilerich
48773bdeed log: include unmodified-in-merge files in log diff/stat (issue2383)
f02da4369319 assumed that walkchangerevs called prep with all relevant matched
filenames, but actually it only contains the names of files changed in the
relevant changeset. That meant that log diff/stat of merges missed the diff for
files only changed in the other branch.

This is a minimal fix for making sure we only use fns when we are following and
thus will have problems with merges anyway ...
2010-09-23 01:23:16 +02:00
Peter Arrenbrecht
c3d38bfaec merge: delay writing the mergestate during until commit is called
This speeds up merges of lots of files considerably.
2010-09-06 17:35:49 +02:00
Martin Geisler
34af0cf109 subrepo: add support for 'hg archive' 2010-09-20 15:46:17 +02:00
Martin Geisler
d37ba034d5 incoming: recurse into subrepositories with --subrepos/-S flag
As with push and outgoing, the optional source path is ignored for the
subrepositories. Fixing this is Issue1852.
2010-09-13 13:09:31 +02:00
Martin Geisler
e849a4fa16 incoming: move code from commands to cmdutil
This makes it easier to reuse it in a recursive fashion for subrepos.
2010-09-13 13:09:30 +02:00
Martin Geisler
2346ea8e9e outgoing: recurse into subrepositories with --subrepos/-S flag
As with push, the optional destination path is ignored for the
subrepositories, i.e., they are always compared with their default
push path. Fixing this is Issue1852.
2010-09-13 13:09:26 +02:00
Martin Geisler
d191f04663 outgoing: move code from commands to cmdutil
This makes it easier to reuse it in a recursive fashion for subrepos.
2010-09-13 13:09:24 +02:00
Martin Geisler
cb93a10b9b add: recurse into subrepositories with --subrepos/-S flag 2010-09-13 13:09:20 +02:00
Martin Geisler
186cdcc54b add: move main part to cmdutil to make it easier to reuse 2010-09-13 13:09:11 +02:00
Martin Geisler
112ea7d5ed patch: break import cycle with cmdutil
The patch module imported cmdutil but used it only in updatedir.
2010-09-13 13:08:09 +02:00
Dirkjan Ochtman
fcf4736e92 check-code: fix ternary expression introduced in edd0d998158f 2010-09-08 15:16:03 +02:00
Dirkjan Ochtman
7846080481 bisect: warn about ending on a merge with only one side marked 2010-09-08 13:48:25 +02:00
Dirkjan Ochtman
fe46f658e0 bisect: allow revsets in addition to single revs (issue2360) 2010-09-08 12:53:15 +02:00
Martin Geisler
b34e1ad2c0 add: clarify that repo[None].add returns rejected filenames 2010-09-07 10:30:29 +02:00
Martin Geisler
e9c2a20771 diff: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Martin Geisler
f2188b5b90 status: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Brodie Rao
16ed03215d remove: properly set return code when warnings are issued
This removes the warn() function in favor of issuing warnings directly
for each kind of file that Mercurial won't remove.

This also uses three separate translatable strings instead of using
string formatting to build the message. This should make it easier to
localize.
2010-08-30 20:27:25 -04:00
Martin Geisler
756848e3f7 pull: lowercase error message 2010-09-01 12:05:57 +02:00
Sune Foldager
71bfee650b debugindex(dot): try to access filelogs through repo, if possible
If a repository is accesible, first treat the filename as a working copy file
and try to open its filelog. Fallback to opening the file directly as a
revlog, as before.
2010-09-01 15:03:45 +02:00
Sune Foldager
0a9170f5e6 debugdata: try to access filelogs through repo, if possible
If a repository is accesible, first treat the filename as a working copy file
and try to open its filelog. Fallback to opening the file directly as a
revlog, as before.
2010-09-01 14:55:03 +02:00
Martin Geisler
516e74e526 merge with stable 2010-09-01 12:28:34 +02:00
Brodie Rao
5a1e1994ac help: refer to user configuration file more consistently
Currently, a number of commands and help topics mention the user hgrc
file in different ways. Among these are following:

1. .hgrc - "please specify your commit editor/username in your .hgrc
file", bookmarks, color, hgk, pager, hg help environment

2. $HOME/.hgrc - hg help paths, hgrc(5), hg(1)

3. ~/.hgrc - hgrc(5)

In addition to being inconsistent, none of these make sense on
Windows. This patch replaces the above with a more general term of
"[your] configuration file".
2010-08-27 22:36:35 -04:00
Martin Geisler
5f46f16fb7 Lowercase error messages 2010-08-29 22:37:58 +02:00
Martin Geisler
c3c7fa090f Merge with stable 2010-08-30 13:00:22 +02:00
Brodie Rao
d1905b7d87 mail/hgweb: support service names for ports (issue2350)
This adds util.getport(port) which tries to parse port as an int, and
failing that, looks it up using socket.getservbyname(). Thus, the
following will work:

    [smtp]
    port = submission

    [web]
    port = http

This does not apply to ports in URLs used in clone, pull, etc.
2010-08-28 12:31:07 -04:00
Martin Geisler
cb36142754 Merge with stable 2010-08-29 22:55:37 +02:00
Brodie Rao
0f9d940cb9 cleanup: remove unused variables 2010-08-27 13:32:40 -04:00
Martin Geisler
2f9eb9bd07 revert: wrap long line 2010-08-25 16:40:49 +02:00
Martin Geisler
bfea979db3 util: remove lexists, Python 2.4 introduced os.path.lexists 2010-08-25 16:23:32 +02:00
Matt Mackall
fa11c5cbae debuginstall: report installpath 2010-08-20 15:31:05 -05:00
Jeremy Whitlock
0a6d3a397f color: enable branches support
This commit updates the branches command to use ui.label for the branch names
and the changeset.  This implementation allows assigning colors to the four
states of a branch: active, closed, current and inactive.  While you can
configure color for the four states, only current and closed have default colors
of green and black bold respectively.
2010-07-28 23:05:03 -06:00
Xavier Snelgrove
edea98c84f revert: use opts.get
If you want to programatically perform a revert right now you need to
include a date=False parameter due to the use of opt["date"] instead
of opt.get("date").
2010-08-13 13:59:26 -04:00
Martin Geisler
ec0bf03276 Merge with stable 2010-08-15 18:13:46 +02:00
Martin Geisler
90ff407862 debugbuilddag: escape backslash properly in help string 2010-08-15 17:33:03 +02:00
Greg Ward
b38d220736 commit: explicitly document the existence of "last-message.txt" 2010-08-14 14:57:33 +02:00
Martin Geisler
fb68103f19 Merge with stable 2010-08-13 10:28:59 +02:00
Mark Edgington
f3ee05373b resolve: updated help documentation for improved clarity 2010-08-12 22:48:22 +02:00
Martin Geisler
c3f9a46ceb Merge with stable 2010-08-11 12:30:18 +02:00
Martin Geisler
eeae22999b commands: use round parenthesis in 'hg head --active' help
This is the style used in the rest of the help strings.
2010-08-11 12:21:27 +02:00
Matt Mackall
9cc346f0b4 help: fix bytes/digit confusion for hashes
spotted by FUJIWARA Katsunori <fujiwara@ascade.co.jp>
2010-07-31 18:27:03 -05:00
Matt Mackall
272a0b3fc3 Merge with stable 2010-07-27 16:04:00 -05:00
Benjamin Pollack
728f9bcc7e tag: do not allow tag names to consist solely of whitespace (issue2307)
(simplification and test by mpm)
2010-07-27 14:40:25 -04:00
Patrick Mezard
14211b6209 debugbuilddag: build repository content in binary mode 2010-07-26 23:26:15 +02:00
Nicolas Dumazet
7a95a27065 bundle: lookup revisions after addbranchrevs
When addbranchrevs extends revs, it adds changeset hashes, and not node ids.
Which means that we have to lookup for revisions _after_ the addbranchrevs
call, instead of before.
2010-07-20 18:29:00 +09:00
Mads Kiilerich
b098dc8c48 revert: rename original to .orig instead of copying (issue2282)
By renaming before reverting the content of the file we ensure that we handle
and break hardlinks properly.

Handling of other hardlinks to .orig is somebody elses problem.
2010-07-13 03:04:14 +02:00
Steve Losh
aaac1bb52d commands: fix update's help to be more accurate
Branches can have multiple heads, so it doesn't make sense to speak of "the
head of the current branch". What update really does is try to update to the
*tip* of the current branch.
2010-07-14 18:28:12 -04:00
FUJIWARA Katsunori
2f9dbb12f7 i18n: use encoding.colwidth() for correct column width
Some encoding and language combinations (e.g.: UTF-8 and Japanese)
cause encoding characters into sequence of bytes more than column
width of them.

So, encoding.colwidth() should be applied instread of len() on i18n
strings.

In addition to it, formatting by '%*s'/'%-*s' also uses "number of
bytes" to calculate space padding size, and should be fixed, too.
2010-07-18 01:06:50 +09:00
Nicolas Dumazet
517eb64655 merge with stable 2010-07-22 15:14:22 +09:00
Matt Mackall
33994da433 Merge with stable 2010-07-20 15:07:10 -05:00
Martin Geisler
7f537e599c Merge with stable 2010-07-19 00:43:34 +02:00
Martin Geisler
138130c348 archival: move commands.archive.guess_type to archival.guesskind
The list of suffixes for each kind of archive belongs in archival.
Renamed function to fit with out code style.
2010-07-14 20:25:31 +02:00
Dirkjan Ochtman
e647af81b9 commands: addremove does similarity 100 by default 2010-07-13 17:30:29 +02:00
Martin Geisler
5fbbb27c25 Merge with stable 2010-07-09 14:21:45 +02:00
Arnab Bose
a9ac0e99d7 commands: mention "hg status -C" in addremove help 2010-07-09 13:31:37 +02:00
Steve Losh
c2cf2592b2 dispatch: add shell aliases
This patch adds git-style "shell aliases" to Mercurial.

Any alias with a definition beginning with a '!' will be treated as a shell
alias. For example:

    [alias]
    echo = !echo
    qempty = !hg qrefresh -X "`hg root`" ; echo Emptied patch "`hg qtop`"

    $ hg echo foo
    foo
    $ hg qempty
    Emptied patch foo
    $
2010-07-07 18:49:43 -04:00
Robert Bauck Hamar
d6a84c6ef2 commands: only warn when reopening the workdir's branch
When commiting, a check is made to see if one of the parents is a
closed head. However this did not check that the branch of the commit
is the same as the closed head, so one could get a warning message on
the sequence

  hg commit --close-branch
  hg branch new-branch
  hg commit

or when merging in a closed head.
2010-07-07 14:11:59 +02:00
Yuya Nishihara
910c40b6b6 log: fix missing diff output for hg log -p in sub directory
prep(ctx, fns) receives paths relative to repository root, not cwd.
2010-07-02 23:49:06 +09:00
Nicolas Dumazet
1624d50ea1 commands: document return values of add and paths commands 2010-07-04 17:05:17 +09:00
Mads Kiilerich
812bb21f4d log: follow filenames through renames (issue647)
In commands.log a displayer was initialized from
cmdutil.show_changeset() with the initial matchfn (which designates
the specified files which only is correct in the highest revision in
the range). prep() is handed the correct list of files, but
displayer.show() didn't use that list but keept using the original
matchfn.

The matchfn argument to cmdutil.show_changeset() wasn't specified in
other places and is only used in .show(), so now we give the matchfn
as an optional parameter to .show().

We do however still have to detect --patch and --stat from opts in
show_changeset() and let it imply a matchall, but that can now be
overruled with the new .show() matchfn parameter.
2010-06-29 12:12:34 +02:00
Mads Kiilerich
07f64c28d2 revert: Make it clearer when not to use revert 2010-06-28 15:08:01 +02:00
Matt Mackall
5c92f50408 merge: document how to 'undo' a merge 2010-06-27 17:41:43 -05:00
Matt Mackall
e4cf775b71 addchangegroup: pass in lock to release it before changegroup hook is called
Currently, callers of addchangegroup first acquire the repository
lock, usually to check that an unbundle request isn't racing. This
means that changegroup hook actions that might write to a repo get
stuck waiting for a lock. Here, we add a new optional lock parameter
and update all the callers. Post-1.6 we may make it non-optional.
2010-06-25 13:47:28 -05:00
Martin Geisler
547f89d8a5 commands: advertise "hg help revsets" in help for log 2010-06-18 21:35:21 +02:00
Matt Mackall
3902a6d8f6 pushkey: add debugpushkey command for testing 2010-06-16 16:05:47 -05:00
Greg Ward
20b557f443 merge: when current branch has 1 or > 2 heads, actually abort.
Currently merge just prints abort-like messages to stderr and then
exits with a misleading status 0 (cleverly disguised as "False").
With this change it raises Abort, just like every other fatal error.
2010-06-14 16:06:52 -04:00
Martin Geisler
e996783e84 commands: get rid of generic exception in debugbuilddag 2010-06-15 09:53:50 +02:00
Martin Geisler
96576cd383 commands: format is a Python2.6 function 2010-06-11 18:54:10 +02:00
Peter Arrenbrecht
b9ce7f49a5 debugbuilddag: build a changelog dag from a concise description
Useful in tests to quickly build a complex DAG in an empty repo.
Handles local tags and named branches.
Options to, at each rev,
 - create a new file,
 - overwrite the same file,
 - append to the same file,
 - write to a specific line in a mergeable file.
Can run shell commands during DAG buildup.
2010-06-10 11:49:48 +02:00
Peter Arrenbrecht
a9d00c7c41 debugdag and debugindexdag: emit changelog/revlog DAGs as concise text
Mainly useful for reusing DAGs somewhere else, for example for attaching
them to a bug report, or for importing them into other environments
(like my test environment for incoming/outgoing discovery).
2010-06-10 11:48:45 +02:00
Matt Mackall
1cf1295d6e summary: report copies and renames 2010-06-09 16:39:25 -05:00
FUJIWARA Katsunori
ce06b102df help: show value requirement and multiple occurrence of options
this helps users to know what kind of option is:

  - no value is required(flag option)
  - value is required
  - value is required, and multiple occurrences are allowed

each kinds are shown as below:

 -f --force              force push
 -e --ssh CMD            specify ssh command to use
 -b --branch BRANCH [+]  a specific branch you would like to push

if one or more 3rd type options are shown, explanation for '[+]' mark
is also shown as footnote.
2010-06-06 17:25:00 +09:00
Gilles Moris
54d30f05ab commit: fix display of 'created new head' message (issue2186)
To avoid recurrent fixes for the display of this message, a summary table with
all case combinations has been added to the code.
Basically, there is two condition for the message to be printed:
* this is not an initial (named branch or topo) root
* none of the parents are in the current branch heads
2010-06-08 22:28:42 +02:00
Steve Borho
0d0e614fc9 Merge backout 2010-06-08 15:52:56 -05:00
Steve Borho
b82bd4f289 Backed out changeset: 1bfde817782c 2010-06-08 15:52:41 -05:00
Dirkjan Ochtman
af6b696f0f move working dir/dirstate methods from localrepo to workingctx 2010-06-07 20:03:32 +02:00
Steve Borho
e91613380a color: labeled text should be passed to ui.write() as ui.labeled
Some implementations of ui.label() (HTML versions in particular) must escape
the provided text and then markup the text with their tags.  When this marked
up text is then passed to ui.write(), we must label the text as 'ui.labeled'
so the implementation knows not to escape it a second time (exposing the initial
markup).

This required the addition of a 'ui.plain' label for text that is purposefully
not marked up.

I was a little pedantic here, passing even ' ' strings to ui.label() when it
would be included with other labeled text in a ui.write() call.   But it seemed
appropriate to lean to the side of caution.
2010-06-03 23:18:18 -05:00
Dirkjan Ochtman
cf1de649bd move discovery methods from localrepo into new discovery module 2010-06-07 18:35:54 +02:00
FUJIWARA Katsunori
9cce255bec replace Python standard textwrap by MBCS sensitive one for i18n text
Mercurial has problem around text wrapping/filling in MBCS encoding
environment, because standard 'textwrap' module of Python can not
treat it correctly. It splits byte sequence for one character into two
lines.

According to unicode specification, "east asian width" classifies
characters into:

   W(ide), N(arrow), F(ull-width), H(alf-width), A(mbiguous)


W/N/F/H can be always recognized as 2/1/2/1 bytes in byte sequence,
but 'A' can not. Size of 'A' depends on language in which it is used.

Unicode specification says:

   If the context(= language) cannot be established reliably they
   should be treated as narrow characters by default

but many of class 'A' characters are full-width, at least, in Japanese
environment.

So, this patch treats class 'A' characters as full-width always for
safety wrapping.

This patch focuses only on MBCS safe-ness, not on writing/printing
rule strict wrapping for each languages

MBCS sensitive textwrap class is originally implemented
by ITO Nobuaki <daydream.trippers@gmail.com>.
2010-06-06 17:20:10 +09:00
Matt Mackall
a1c4034fda revset: add a debugrevspec command 2010-06-01 11:18:57 -05:00
Matt Mackall
86ebd43d71 remoteui: move from cmdutil to hg 2010-06-01 11:18:57 -05:00
Martin Geisler
02f8de2883 commands: document --new-branch flag for push 2010-05-25 09:57:19 +02:00
Martin Geisler
c5e5ad33a2 Merge with stable 2010-05-25 09:56:26 +02:00
Faheem Mitha
f0ea5d41d2 commands: updates to push docstring.
With contributions from mg, hstuart, timeless, and vsh.
2010-05-24 21:52:33 +05:30
Sune Foldager
f9f5488566 push: add --new-branch option to allow intial push of new branches
Compare this to --force which allows anything to be pushed. With --new-branch,
only changesets to named branches not present on the and changesets not
introducing additional heads on existing branches are allowed.

Developed by
  Henrik Stuart <henrik.stuart@edlund.dk>
  Sune Foldager <cryo@cyanite.org>
2010-05-21 15:22:29 +02:00
Martin Geisler
efb4a38a04 Use our custom hg reStructuredText role some more
I missed these occurrences on my first scan through the source.
2010-05-18 16:31:10 +02:00
Steve Losh
6c5a8fed4b tag: add -e/--edit option for modifying the commit message 2010-05-15 23:33:22 -04:00
Henri Wiechers
7134ed3f0f help: add -e/--extension switch to display extension help text 2010-01-20 20:24:20 +02:00
Martin Geisler
c1f08a81f6 debugbuilddag: read DAG from stdin if not given on cmdline 2011-05-09 18:11:08 +02:00
Martin Geisler
08ab74f879 debugbuilddag: output progress information 2011-05-09 14:40:49 +02:00
Adrian Buehlmann
4163cf2e6f rename util.find_exe to findexe 2011-05-08 20:35:46 +02:00
Patrick Mezard
e0378ee5bd patch: make patch()/internalpatch() always update the dirstate 2011-05-08 17:48:31 +02:00
Patrick Mezard
88e958194e patch: move updatedir() from cmdutil into patch
Also, create an artificial wdutil.py to avoid import cycles between patch.py
and cmdutil.py.
2011-05-08 17:48:30 +02:00
Sune Foldager
bae0240022 debugindex: change output for generaldelta revlogs
For generaldelta revlogs, reporting the deltaparent instead of the chain base
makes more sense, since that's what's actually stored in the revlog.
2011-05-07 23:14:36 +02:00
Sune Foldager
88485e9322 revlog: calculate base revisions iteratively
This is in preparation for generaldelta, where the revlog entry base field is
reinterpreted as the deltaparent. For that reason we also rename the base
function to chainbase.

Without generaldelta, performance is unaffected, but generaldelta will suffer
from this in _addrevision, since delta chains will be walked repeatedly.
A cache has been added to eliminate this problem completely.
2011-05-07 22:40:14 +02:00
Patrick Mezard
da2bf866c1 debugbuilddag: simplify tags serialization a bit 2011-05-07 17:25:02 +02:00
Wagner Bruna
8d97c7a927 commands, i18n: add translation hint for split message 2011-05-06 15:48:04 -03:00
Matt Mackall
ac5d056e58 merge with abuehl 2011-05-06 13:04:24 -05:00
Matt Mackall
05c3219fba merge with crew 2011-05-06 11:50:58 -05:00
Adrian Buehlmann
b79bd6d178 rename util.set_signal_handler to setsignalhandler 2011-05-06 15:41:04 +02:00
Peter Arrenbrecht
635fef062f summary: run discovery only once for in/out against same repo
Reuses the result of findcommonincoming if default and default-push
are the same.
2011-05-06 14:45:13 +02:00
Peter Arrenbrecht
d4abc4d642 discovery: resurrect findoutgoing as findcommonoutgoing for extension hooks
discovery.findoutgoing used to be a useful hook for extensions like
hgsubversion. This patch reintroduces this version of findcommonincoming
which is meant to be used when computing outgoing changesets.
2011-05-06 14:44:18 +02:00
Adrian Buehlmann
e981d64ef2 rename path_auditor to pathauditor
The Mercurial 1.9 release is moving a lot of stuff around anyway and we are
already moving path_auditor from util.py to scmutil.py for that release.

So this seems like a good opportunity to do such a rename. It also strengthens
the current project policy to avoid underbars in names.
2011-05-06 09:54:06 +02:00
Martin Geisler
42c642ca22 annotate: use real Booleans instead of 0/1 2011-05-06 11:11:55 +02:00