Commit Graph

2818 Commits

Author SHA1 Message Date
Kevin Bullock
8aa3fefad9 bookmarks: add paragraph on pushing and pulling to help
Text adapted from http://mercurial.selenic.com/wiki/BookmarksExtension
2010-10-19 12:40:09 -05:00
Martin Geisler
77ce66fb6a check-code: find trailing whitespace 2010-10-20 10:13:04 +02:00
timeless
2c0786a591 convert: kill trailing whitespace 2010-10-20 10:07:38 +02:00
timeless
4edbb771f8 convert: fix typo in comment 2010-10-20 10:02:54 +02:00
Wagner Bruna
e934c64ad0 strip: support revision sets 2010-10-18 18:31:38 -02:00
Augie Fackler
02148d71df interhg: use uisetup() instead of module-load side effects
This fixes an infinite recursion bug caused by visiting a bad subpage
of the help handler repeatedly, which caused the wrapper for the
templater's escape filter to get installed twice and resulted in
infinite recursion.
2010-10-16 18:09:47 -05:00
Erik Zielke
69888281fd mq: switched to `` around * * *
So it can be parsed by rst.
2010-10-18 14:37:50 +02:00
timeless
73617c6e5a patchbomb: move command option help from the extension (patchbomb) to the command (email) 2010-10-17 14:00:01 +03:00
Paul Molodowitch
d3b62a0e94 bookmarks: better fix for issue2016 (lookup infinite recursion)
af2e49ed3c19 partially reverted by Patrick Mézard <pmezard@gmail.com>
2010-10-07 13:44:17 -07:00
Brodie Rao
c97e40185c convert/darcs: support changelogs with bytes 0x7F-0xFF (issue2411)
This is a followup to dd4fb29994d3, which only fixed the conversion of
patches with UTF-8 metadata.

This patch allows a changelog to have any bytes with values
0x7F-0xFF. It parses the XML changelog as Latin-1 and uses
converter_source.recode() to decode the data as UTF-8/Latin-1.

Caveats:

- Since the convert extension doesn't provide any way to specify the
  source encoding, users are still limited to UTF-8 and Latin-1.

- etree will still complain if the changelog has bytes with values
  0x00-0x19. XML only allows printable characters.
2010-10-01 10:15:04 -05:00
Erik Zielke
0c1276bb2d mq: removed -m from qpush help (Issue2401)
The -m option became deprecated in changeset 1e63d4dee4f6,
but the option still appeared in the help line for the qpush
command
2010-09-27 09:19:48 +02:00
Patrick Mezard
42663f256e convert/darcs: improve unsupported format detection (issue2172) 2010-09-24 00:04:07 +02:00
Patrick Mezard
bc1ff8ebda bookmarks: fix _bookmarks/lookup() reentrancy issue (issue2016)
_bookmarks is loaded lazily and calls super.lookup(). Unfortunately, branch and
tags caches initializations also recurse in lookup() and end up trying to
access _bookmarks again. Massive confusion ensues.

I considered fixing all branches and tags cache loading to avoid recursing in
lookup() but it would add complexity to otherwise working code provided lookups
are performed on nodes or revnums.
2010-09-24 00:03:58 +02:00
Patrick Mezard
23ced90ea0 mq: always require --force when pushing patches (issue2363)
--force was not necessary when passing --rev since cb494d252290, but this
behaviour is usually harmful when branch names are passed instead of explicit
revisions.
2010-09-22 23:51:10 +02:00
Dan Villiom Podlaski Christiansen
4a1790f181 mq: fix the deprecation comment for qsave & qrestore.
Changeset 1e63d4dee4f6 deprecated qsave and qrestore. In the
deprecating comment, users were referred to 'rebase --mq' which -- at
the time the message was written -- didn't exist. Currently, on the
default branch, rebase *does* take a '--mq' option, but it probably
doesn't do what Dirkjan expected it to do when he wrote the message.

In the original, deprecating commit, little context was provided as to
why this change was made. Based on my recollection, concensus at the
Paris Sprint in February 2010 was that one of the problems with MQ was
that it exposed far too many commands. Notable among these were qsave
& qrestore: very few core developers understood what they did and even
fewer (none, IIRC) actually used them. However, they couldn't be
removed; not only do the usual backwards compatibility reasons apply,
but the hg book refers to them.
2010-09-20 13:31:02 +02:00
Patrick Mezard
979ccf4590 Use lexists() instead of exists() where appropriate 2010-09-20 21:46:56 +02:00
Patrick Mezard
0988572cc6 convert/svn: fix broken symlink renames in svn sink 2010-09-20 21:46:39 +02:00
Steve Borho
6c61bc3690 eol: setup the repo.ui in reposetup()
This fixes problems some have reported using the eol extension
together with TortoiseHg.  It ensures the ui associated with the
repository has the preupdate.eol hook configured.
2010-09-15 17:46:51 -05:00
Sune Foldager
cd1204adbe color: add win32 support for non-black background
This complicates the code a bit, since attributes need to be masked together
correctly before they are applied. Perhaps the code should be redesigned at
some point, but this works well for now.
2010-09-13 16:12:25 +02:00
Brodie Rao
1833e73f70 convert/darcs: handle non-ASCII metadata in darcs changelog (issue2354)
Given a commit author or message with non-ASCII characters in a darcs
repo, convert would raise a UnicodeEncodeError when adding changesets
to the hg changelog.

This happened because etree returns back unicode objects for any text
it can't encode into ASCII. convert was passing these objects to
changelog.add(), which would then attempt encoding.fromlocal() on
them.

This patch ensures converter_source.recode() is called on each piece
of commit data returned by etree.

(Also note that darcs is currently encoding agnostic and will print
out whatever is in a patch's metadata byte-for-byte, even in the XML
changelog.)
2010-09-10 09:30:50 -05:00
Christian Ebert
55548a8056 keyword: explain file-wise expansion in help 2010-09-10 16:58:13 +02:00
Martin Geisler
074f6b21a9 convert: help string cleanups 2010-09-10 00:36:01 +02:00
Martin Geisler
6765286f85 convert: better quoting in help text 2010-09-10 00:30:36 +02:00
Martin Geisler
e1be8b3f05 convert: show example splice, author, and branch map entries in help
Also document that

- empty lines are skipped and comment are supported in author map

- whitespace is not allowed in branch map entries since we split on it
  when parsing the file
2010-09-10 00:22:46 +02:00
Martin Geisler
2dfd084474 bookmarks: break long line found by check-code 2010-09-02 17:07:02 +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
bab69a5062 churn: do not crash on malformed lines in alias file 2010-08-29 22:46:00 +02:00
Ronny Pfannschmidt
1a68305741 churn: do not crash on empty lines in alias file 2010-08-29 10:54:22 +02:00
Martin Geisler
5f46f16fb7 Lowercase error messages 2010-08-29 22:37:58 +02:00
timeless
6c6a718e86 progress: dropping superfluous space from units 2010-07-20 20:53:48 +02:00
Nicolas Dumazet
6b618a96de outgoing: unify common graphlog.outgoing and hg.outgoing code 2010-10-15 05:21:51 +02:00
Nicolas Dumazet
15e204f50d bundlerepo: unify common code into a new getremotechanges
The pattern where we fetch incoming remote changes and return
them as a local bundlerepo seems common. It's nicer to have this
code unified.
2010-10-14 22:41:43 +02:00
Christian Ebert
89ad77f3b8 keyword: only use expensive fctx.cmp when needed
Restrict expensive cmp to cases when:

- comparing against working directory
and
  - encode filters active
  or
  - path is configured for keyword expansion
2010-10-14 22:53:17 +02:00
Nicolas Dumazet
171049119e incoming: unify code for incoming and graphlog.incoming 2010-10-14 21:36:00 +02:00
Christian Ebert
94017a6ef9 keyword: code cleanup
- move preselection of expansion candidates for rollback
  and record into helper function
- same overwrite order in rollback and record:
  1. modified, 2. added
- self.wlock() inside kwrepo class instead of repo.wlock()
2010-10-12 12:49:23 +01:00
Matt Mackall
b37df2f50a merge with stable 2010-10-12 16:25:38 -05:00
Augie Fackler
0f661dc6d3 bookmarks: add revset for referencing bookmarks 2010-10-10 12:40:25 -05:00
Matt Mackall
61e35e253a fetch: fix and document exit codes (issue2356) 2010-10-11 14:39:13 -05:00
Nicolas Dumazet
04cf1f6b57 filectx: use ctx.size comparisons to speed up ctx.cmp
Comparing sizes is cheaper than comparing file contents, as it does not
involve reading the file on disk or from the filelog.

It is however not always possible: some extensions, or encode filters,
change data when extracting it to the working directory.
2010-07-27 23:07:30 +09:00
Brodie Rao
64fa99143f pager: don't run pager if nothing is written to stdout/stderr
This decides when to run the pager based on the first call to
ui.write() and ui.write_err(). This has the side effect of not the
output of subprocesses that write output before hg does.
2010-10-10 12:21:49 -05:00
Brodie Rao
6b1702dd44 pager: add global --pager=<auto/boolean> option 2010-10-10 12:21:48 -05:00
Brodie Rao
32f9e577c3 color: add global option in extsetup() instead of globally
This prevents side effects from occurring when importing the color
extension.
2010-10-10 12:21:36 -05:00
Augie Fackler
42c8b2cf07 termwidth: move to ui.ui from util 2010-10-10 10:06:36 -05:00
Christian Ebert
090eecd7fd keyword: enforce subn method via boolean switch
There are only 2 patterns to choose, and so far only 1 case
where kwtemplater.re_kw.subn is applied on data read from
the working directory: when recording added files.

With this change the code reflects more closely the boolean
character of the switch and underlines the special case.
2010-10-10 00:38:57 +01:00
Christian Ebert
f2c0019bd0 keyword: fix weeding of expansion candidates when recording
Rearrange tests to check this, i.e. that there are changes
in other files, not only the recorded one.
2010-10-10 00:30:09 +01:00
Augie Fackler
35723d1610 strip: add --keep flag to avoid modifying wc during strip
Fixes issue1564.
2010-10-09 11:02:11 -05:00
Patrick Mezard
095f60fafa patch: always raise PatchError with a message, simplify handling 2010-10-09 15:13:08 -05:00
Dan Villiom Podlaski Christiansen
cf9291fa61 mq: silence spurious output.
When using a versioned patch repository, you would get a spurious
warning when deleting and adding the same patch.

Before:

  $ hg qdelete --keep 3.diff
  $ hg qimport --existing 3.diff
  adding 3.diff to series file
  3.diff already tracked!

After:

  $ hg qdelete --keep 3.diff
  $ hg qimport --existing 3.diff
  adding 3.diff to series file
2010-10-09 11:53:48 -05:00
Dan Villiom Podlaski Christiansen
f7370d289b mq: handle deleting the same patch twice in one command (issue2427) 2010-10-09 10:36:50 -05:00
Augie Fackler
07c793d057 progress: make sure stderr has isatty before calling (issue2191) 2010-10-09 09:55:52 -05:00
Nicolas Dumazet
afb08fe68c inotify: raise correct error if server is already started in a deep repository
When path is too long to be an Unix socket address, we create a socket in a
temporary directory and link from the long path to the shorter one.
But checks in server code at startup were insufficient in this case, and used
to raise an unclear "tried linking .hg/inotify.sock to a temporary socket but
.hg/inotify.sock already exists"
2010-10-09 15:41:53 +02:00
Christian Ebert
cdefb1362f keyword: switch kwtemplater.record in kw_dorecord()
Obsoletes the need for a global recordcommands variable.
2010-10-08 18:39:46 +01:00
Christian Ebert
924a741c44 keyword: specific regular expressions depending on read mode
More safeguarding against accidental (un)expansion:

Reading filelog: act only on \$(kw1|kw2|..)\$ as keywords are always
                 stored unexpanded.
Reading wdir:    act only on \$(kw1|kw2|..): [^$\n\r]*? \$ as we only
                 are interested in expanded keywords in this situation.
                 Note: we cannot use ..): [^$\n\r]+? \$ because e.g.
                 the {branch} template might be empty.

hg record is a special case as we read from the working directory and
need one regex each for modified and added files. Therefore test
recording an added file.

This way we finally also forbid sequences like $Id:  $ being treated
as keywords.
2010-10-08 18:39:46 +01:00
Christian Ebert
c7f6297b25 keyword: disable expansion in kwfilelog.read() if file renamed in node
Simplifies kwfilelog.cmp() and avoids fiddling with/importing revlog.

Reorder imports alphabetically.
2010-10-08 18:39:46 +01:00
Christian Ebert
05408dc4ec keyword: make iskwfile() a weeding method in lieu of a boolean
Update iskwfile docstring.
2010-10-08 18:39:46 +01:00
Christian Ebert
f6775a8777 keyword: support copy and rename
copy/rename destinations being unversioned and possibly ignored by
the extension should not contain expanded keywords.

Files copied/renamed from an ignored source are not touched.

Add tests covering both of the above cases, plus the corner case of
cp symlink foo; hg cp -A symlink foo (where foo becomes a regular file).
2010-10-08 18:39:46 +01:00
Christian Ebert
6ced1f0e94 keyword: refactor kwtemplater.overwrite()
Make kwexpand, kwshrink restricted commands - i.e. read from
filelog without expansion for substition in kwtemplater.overwrite,
and set/unset restricted mode for overwrite() in in kwcommitctx
and the dorecord wrapper.

Preselect candidates when working on changed files (rollback, record)
outside kwtemplater class, and remove 6th argument from overwrite().

Avoid duplicate substitution/search in overwrite():
Only go into restricted read mode when reading from filelog.
rollback and record read from the working directory, where
restricted mode would already shrink keywords before overwrite()
either expands or shrinks them again.

This ensures that the usual automatic operations on keywords
are turned off during overwrite() and only overwrite() itself
acts on them.

Reduce manifest calculation to the cases where it is needed.

Move helper function for expansion removal outside kwtemplater class.
2010-10-08 18:39:46 +01:00
Christian Ebert
7faf4b3245 keyword: use workingctx to detect modified and added files after rollback 2010-10-01 02:13:31 +02:00
Christian Ebert
8c9ae08c43 keyword: rename variable "cfiles" to "changed" for clarity 2010-10-01 02:13:31 +02:00
Erik Zielke
e46861ba72 mq: Removed extra ... in short help for qdelete
Update to d7d43954f372, which left a ... too much, after removing
-r [REV]
2010-09-30 12:37:45 +02:00
Erik Zielke
0e2a10ee21 mq: removed short option in help for deprecated options
Removed help for deprecated short option for:
  -n NAME for qpush
  -n NAME for qpop
  -r REV for qdelete|qremove|qrm
2010-09-27 11:27:58 +02:00
Mads Kiilerich
bf24a5099a mq: explain qpush -f better 2010-09-29 01:32:50 +02:00
Juan Pablo Aroztegi
ddaf681e52 transplant: add the transplanted revset predicate
This adds support to identify a particular transplanted changeset or set
of changesets. The argument is optional. Examples:

hg log -r 'transplanted(1234 or 2345)'
hg log -r 'transplanted()'
2010-09-28 19:36:05 +02:00
Mads Kiilerich
edf2794bd1 graphlog: style with header and footer (issue2395)
The glog command didn't emit header and footer from the style, as demonstrated
by "hg glog --style xml". Asciiart combined with xml markup hardly makes sense,
but header and footer might however be useful for adding for example html pre
tags around the graph.
2010-09-28 02:58:00 +02:00
Erik Zielke
9f22da182d mq: removed return from callers to patchheader.qseries
Some callers to patchheader.qseries returned the value
further, but pathcheader.qseries does not explicitly
return anything. It was confusing this was returned
further
2010-09-23 15:18:10 +02:00
Erik Zielke
f65e38950f mq: added return 0 on success
I have added return 0 on success in docstrings of
the different not deprecated mq commands.
2010-09-23 16:56:32 +02:00
Martin Geisler
1bb28d1ed3 merge with stable 2010-09-27 10:20:19 +02:00
Christian Ebert
405806c3f9 keyword: support rollback by restoring expansion to previous values
Prevent spurious differences in the working directory
after a rollback.

Add tests for several rollback situations.
2010-09-26 19:18:41 +02:00
Christian Ebert
9915bf5605 keyword: do not expand at all during diff
Always shrink and never expand keywords during a diff operation.
Avoid user distraction e.g. because of spurious differences
appearing in the commit editor.
2010-09-26 19:18:41 +02:00
Christian Ebert
24b171fdd3 keyword: restore restricted read mode value after overwriting
Even though just enforcing expansion after overwriting files in
the working directory caused no problems that we know of, this avoids
a potential source of problems (e.g. in collaboration other extensions)
at no costs.
2010-09-26 19:18:41 +02:00
Matt Mackall
51b3b09c8f backout most of 26e0b9a8ce0d 2010-09-24 12:46:54 -05:00
Patrick Mezard
bb3259c957 Merge with stable 2010-09-24 00:17:04 +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
Brodie Rao
7362459729 cleanup: use x in (a, b) instead of x == a or x == b 2010-09-23 00:02:31 -05:00
Matt Mackall
b05cd46be9 merge with stable 2010-09-22 18:29:41 -05:00
Matt Mackall
6b5c5e35ef merge with stable 2010-09-20 16:56:57 -05:00
Matt Mackall
f764dbce14 merge with crew 2010-09-20 16:56:44 -05:00
Patrick Mezard
614db673f4 Merge with stable 2010-09-20 22:29:13 +02:00
Peter Arrenbrecht
1aec67382d transplant: maintain list of transplants in dict 2010-09-16 16:00:29 +02:00
Matt Mackall
14e058119e merge with crew 2010-09-16 16:07:22 -05:00
Steve Borho
8230ece29c Merge with stable 2010-09-15 17:48:03 -05:00
Will Maier
0641d40bd9 bookmarks: set VALUE in push/pull 2010-09-14 21:45:43 -05:00
Christian Ebert
e3631413e0 mq: rename strip --nobackup option to --no-backup (issue2377)
Same option name as for hg revert --no-backup.
Deprecate strip --nobackup.
2010-09-14 22:11:53 +02:00
Christian Ebert
3cef19604e mq: consistently use opts.get() to prevent potential KeyError 2010-09-14 22:11:46 +02:00
Sune Foldager
060a59a3cc merge with stable 2010-09-13 16:25:13 +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
Yuya Nishihara
0c49a1c065 patchbomb: show progress when sending emails or writing mbox 2010-09-12 16:10:41 +09:00
Christian Ebert
47b2eb085f patchbomb: consistent code style in getaddrs() 2010-09-11 18:08:00 +02:00
Martin Geisler
28afb23368 merge with stable 2010-09-12 14:00:40 +02:00
Patrick Mezard
de8b1fa045 mq: add newline after qfold warning 2010-09-10 22:36:04 +02:00
Martin Geisler
6335a7f166 merge with stable 2010-09-10 20:19:16 +02:00
Martin Geisler
964567ee35 convert: move -A option to --authormap 2010-09-10 20:11:42 +02:00
Christian Ebert
57eed7cac3 patchbomb: add --confirm option to show series details and ask for confirmation
--confirm presents same prompt as --diffstat, but does not write
a diffstat to the messages' bodies.

A simple test simulating a negative response is included.
2010-09-10 15:32:22 +02:00
Christian Ebert
c4731e2be5 patchbomb: let diffstat prompt only once with complete summary
This changes the behaviour of --diffstat.
Before the user was asked for confirmation of each patch with its
description and diffstat, and a final summary.

Now there is only one prompt right before sending with a final
summary which does not include the patch descriptions, but the
message details and the diffstats:

  Final summary:

  From: sender
  To: recipient(s)
  Cc: (if present)
  Bcc: (if present)
  Reply-To: (if present)
  Subject: [patch 0 of x [flags]] intro (if present)
      a |  28 ++++++++++++++++++++++++++++
      b |  15 +++++++++++++++
  Subject: [patch 1 of x [flags]] subject
      a |  28 ++++++++++++++++++++++++++++
  [ ... ]

  are you sure you want to send (yn)?
2010-09-10 15:32:14 +02:00
Martin Geisler
5e2d304679 patchbomb: rename argument to avoid shadowing patch module 2010-09-10 15:56:13 +02:00
Martin Geisler
0447137bce convert: deprecate --authors in preference for --authormap
This aligns the authormap option with the other three mapping options.
The old --authors option is still supported and 'hg help convert -v'
will still show it.
2010-09-10 01:34:14 +02:00
Christian Ebert
c71ec4c740 patchbomb: show prompt and selection in non-interactive mode
Akin to 023d1310d8a4 for the custom patchbomb prompt.
2010-09-08 08:31:07 +02:00
Christian Ebert
c44df41dfd patchbomb: use ui.promptchoice for diffstat to allow localization of choices
The extra check for ui.interacive from patchbomb's prompt function is not
needed here.

Format boolean prompt as in filemerge.py.
2010-09-08 08:31:07 +02:00
Martin Geisler
77e923da30 merge with stable 2010-09-10 01:04:32 +02:00
Martin Geisler
e783fa28e6 convert: better grouping of command line flags in help
We normally put related command line flags after one another.
2010-09-10 00:07:38 +02:00
Martin Geisler
e9c2a20771 diff: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Martin Geisler
db48f8551c merge with stable 2010-09-02 17:28:20 +02:00
Peter Arrenbrecht
29816e62a9 transplant: fix var name conflict introduced by 2bc37c36314e 2010-09-18 08:30:11 +02:00
Matt Mackall
cdb9f7c881 bundlerepo: restore close() method 2010-09-20 16:14:05 -05:00
Matt Mackall
40f75a026a bundlerepo: drop unused close() method 2010-09-17 19:03:13 -05:00
Martin Geisler
c27c54faec clone, patch, convert: use hex(nullid) instead of '0'*40 2010-09-02 12:08:13 +02:00
Augie Fackler
2ad9623e97 color: accept usual boolean values as synonyms for always and never 2010-08-28 21:57:36 -05: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
Steve Borho
17ad59ab74 color: handle more Windows console errors
If your application is being built as a non-console application,
stdout is not a valid handle and raises an exception:

pywintypes.error: (6, 'DuplicateHandle', 'The handle is invalid.')

Alternatively, non-console applications launched outside of a
console will return None from GetStdHandle instead of raising an
exception.
2010-08-27 22:24:47 -05:00
Christian Ebert
63a3341098 patchbomb: remove unneeded line continuation 2010-08-25 23:26:18 +01:00
Brodie Rao
0f9d940cb9 cleanup: remove unused variables 2010-08-27 13:32:40 -04:00
Brodie Rao
203cf2fbd9 cleanup: remove unused imports 2010-08-27 13:32:38 -04:00
Dan Villiom Podlaski Christiansen
5e79668de4 mq: extend support for the --mq argument to extension commands
This allows commands like `purge' to accept the --mq option.
2010-08-13 16:05:08 +02:00
Martin Geisler
1fa82565d6 Merge with stable 2010-08-23 22:22:05 +02:00
Martin Geisler
130528a2c3 bookmarks: guard against listing bookmarks on unsupported repos
This fixes clones and pulls from statichttprepository repos.
2010-08-23 22:16:56 +02:00
Matt Mackall
979717003c bookmarks: fix long line 2010-08-19 17:33:46 -05:00
Matt Mackall
73968a1cf2 merge with stable 2010-08-19 17:29:13 -05:00
David Soria Parra
ebfeb45938 bookmarks: Check if the bookmark to delete exists on the remote 2010-08-19 15:04:21 -04:00
Brodie Rao
5c97a02c1e convert: use encoding.encoding instead of locale.getpreferredencoding()
The latter may not return useful results in certain OS X environments.
2010-08-18 10:53:52 -04:00
Brodie Rao
e752297abf convert: properly set encoding for gnuarch converter 2010-08-18 10:53:50 -04:00
Mads Kiilerich
b27d1fd3b8 mq: don't inherit default and default-push paths with --mq (issue2333)
Configuration from the outer repo is inherited to the patches repo when --mq is
used.

In case the patches repo only has paths.default configured but the outer repo
has paths.default-push then the inherited default-push will win. Very
confusing.

Inheriting the default paths is however wrong in all sane cases, so now we
explicitly remove them.
2010-08-18 02:43:45 +02:00
Matt Mackall
a628b4fc64 merge with stable 2010-08-19 11:51:30 -05:00
Matt Mackall
eef168b604 merge with stable 2010-08-19 10:25:41 -05:00
Benoit Boissinot
21c145b776 rebase: recompute the set of skipped rev when using --continue (issue2330) 2010-08-13 18:02:02 +02: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
Yann E. MORIN
87f9cf5483 mq/qqueue: add --purge option to delete a queue and its patch dir
qqueue --delete only deletes the reference to the queue, and leaves
the associated patch directory behind. There is no Mercurial-way of
getting rid of that patch directory afterward.

This patch adds the --purge option to qqueue, that deletes the queue
from the list, and also removes the associated patch dir. If the queue
was non-existant, but the patch dir was, it is removed nonetheless.

This is to avoid manual intervention in the .hg directory.
2010-08-18 23:37:19 +02:00
Yann E. MORIN
dac7d3c59b mq/qqueue: commonalise the queue deletion code 2010-08-18 23:34:28 +02:00
Renato Cunha
cedeb488b2 mq: save qrefresh message for easy recovery in case it fails (issue2062)
Currently, if you start editing a commit message from qrefresh -e and, for any
reason: forget you were editing it, leave the editor open and start qpopping
and qpushing, when you decide to save your commit message, it is going to fail.
This patch copies the commit behavior of saving the message contents in
$HGROOT/.hg/last-message.txt before continuing.
2010-08-16 16:35:20 -03:00
Greg Ward
41733adeb2 inotify: show the exact command used to start the server 2010-08-13 13:16:34 -04:00
Yann E. MORIN
087fc5dff2 mq/qqueue: enable renaming of active queue 2010-08-15 13:29:46 +02:00
Yann E. MORIN
cc2af00728 mq/qqueue: split _setactive
Prepare _setactive to be called without checking for applied patches.
2010-08-15 16:48:08 +02:00
Martin Geisler
e7bd3fc69a Merge with stable 2010-08-14 03:30:35 +02:00
Dan Villiom Podlaski Christiansen
7cf0dd907b qguard: label patch names by status when listing guards 2010-08-05 12:25:53 +02:00
Nicolas Dumazet
5a000fb762 strip: support multiple revisions 2010-07-17 00:47:06 +09:00
Martin Geisler
c3f9a46ceb Merge with stable 2010-08-11 12:30:18 +02:00
Martin Geisler
14ab4a3d21 convert: less shouting in SVN sink warning 2010-08-11 12:29:20 +02:00
Daniel J. Lauk
770d0f10a6 convert: Using --dest-type svn crashed, if the source repo used tags.
The convert extension requires puttags(self, tags) to return a sequence
for a multi-variable assignment.  If puttags implicitly returns None,
the code will break when trying to un-pack None for assignment.
2010-08-11 11:46:06 +02:00
Martin Geisler
b81cf438a9 graphlog: mark --branch as incompatible with --graph
The --only-branch option was deprecated in e783d3972bda and --branch
was added instead. But the graphlog extension was not updated to match
the change.
2010-08-11 12:19:01 +02:00
Brodie Rao
6d1ff05d76 color: call correct superclass method in write_err
Without this fix, any calls to write_err would go to stdout instead of
stderr, and calls during pushbuffer would cause unpack ValueErrors on
popbuffer.
2010-08-02 10:48:31 -04:00
timeless
4c60b4bbe9 convert/progress: use plural and avoid retrieving 2010-07-30 10:38:54 +03:00
Brodie Rao
52fb27575c color: pass write/write_err to win32print correctly (issue2312) 2010-08-01 16:26:02 -04:00
Martin Geisler
31fb6a81be bookmarks: replace var used as a Boolean with a Boolean 2010-08-10 16:55:38 +02:00
Yann E. MORIN
04d8f4ca7e mq/qqueue: --list does not print (active) with --quiet
For scripting purposes, it can be convenient to get a simple listing of
available queues, without indication of the active one.

--quiet documentation change removed by Patrick Mézard.
2010-08-08 22:49:01 +02:00
Alecs King
87357bf43e minor style fix: hgext/rebase.py:157 -- line too long
found by a run of check-code
2010-08-07 12:55:30 +08:00
Brodie Rao
0f7e715bdb hgcia/color: remove star imports
This plays nicer with demandimport and allows pyflakes to detect undefined
names.
2010-08-03 13:02:11 -04:00
Matt Mackall
8b11223ff6 Merge with stable 2010-08-02 10:55:51 -05:00
Matt Mackall
a807136972 qfinish: fix range logic for --applied
qbase:qtip can include non-mq csets, use qbase::qtip instead
2010-08-01 16:02:56 -05:00
timeless
ead95bc677 rebase/progress: Adding progress for rebasing 2010-07-20 20:53:48 +02:00
timeless
220a53c8c9 record: count lines changed as the number of lines added or removed
per "record" hunk
Record deals in hunks which are tighter than traditional patch hunks,
really only a single run of additions/removals. Another addition, even a
line after a fixed line is treated as a new hunk by record.
2010-07-22 18:47:46 +03:00
Matt Mackall
c11fac2ec1 Merge with stable 2010-07-31 18:12:50 -05:00
Nicolas Dumazet
2476f9eec3 merge with stable 2010-07-31 11:41:58 +09:00
Nicolas Dumazet
fd74fbf55f merge crew and main 2010-07-31 11:05:11 +09:00
Nicolas Dumazet
1f6d6b4984 merge crew and main 2010-07-31 11:04:33 +09:00
Nicolas Dumazet
5d294189fa mq: clarify the fact that qimport is trying to read a file
"hg qimport tip" would throw "abort: unable to read tip" before this.
2010-07-31 10:50:29 +09:00
Nicolas Dumazet
e1fdb57c43 mq: correct qimport documentation 2010-07-29 17:18:17 +09:00
Nicolas Dumazet
255cce8ee5 merge with stable 2010-07-29 12:10:22 +09:00
Patrick Mezard
f59b5d9c39 mq: fix qimport --name --existing --force on win32
os.rename() does not overwrite existing targets on Windows.
2010-07-28 11:07:20 +02:00
Matt Mackall
671535ddb7 Merge with stable 2010-07-25 21:20:05 -05:00
Christian Ebert
e697dd5558 keyword: move collecting of [keyword] patterns to reposetup (issue2303)
When cloning, prevent [keyword] filename patterns configured locally
in the source directory to persist during the update in the destination.

a) move [keyword] retrieval (back) to reposetup
b) remove the corresponding global kwtools attributes

Add test cases.
2010-07-25 20:01:33 -05:00
Idan Kamara
5f043a6812 bookmarks: don't allow name to contain whitespaces only 2010-07-24 11:20:21 +03:00
Nicolas Dumazet
32a65647b1 mq: document possible combination of -e and -n for qimport 2010-07-23 23:43:43 +09:00
Nicolas Dumazet
fa54ef46b3 mq: support "qimport --existing --name renametothis thatexistingpatch"
Before this change, the command would abort with a not too clear "patch
renametothis does not exist" error.

This change makes:
  qimport --existing --name renametothis thatexistingpatch
equivalent to:
  qimport --existing thatexistingpatch; qrename thatexistingpatch renametothis
2010-07-21 11:53:09 +09:00
Patrick Mezard
3153012325 cleanup: typos 2010-07-26 22:29:49 +02:00
Patrick Mezard
56b24c94c7 bookmarks: sort diffbookmarks() output 2010-07-26 22:26:12 +02:00
Mads Kiilerich
ef1e88d17c convert: warn on superfluous / in paths
shlex is really a bad parser for this line-based format ...
2010-07-20 15:49:28 +02:00
David Soria Parra
a1c3bcbbfe inotify: remove unused variable 2010-07-24 22:15:22 +02:00
Matt Mackall
3a240dadce convert: handle closed branch heads in hg-hg conversion (issue2185) 2010-07-25 17:18:35 -05:00
Nicolas Dumazet
cea01fc92a bookmarks: rewrite _bookmarks method documentation 2010-07-21 12:41:18 +09:00
Greg Ward
692cfc05a8 transplant: crash if repo.commit() finds nothing to commit
(makes issue2135, issue2264 more obvious, but does nothing to fix
either one)

This seems to happen in two distinct cases:
  * patch.patch() claims success but changes nothing (e.g.
    the transplanted changeset adds an empty file that already
    exists)
  * patch.patch() makes changes, but repo.status() fails to report them

Both of these seem like bugs in other parts of Mercurial, so arguably
it's not transplant's job to detect the failure to commit.  However:
  * detecting the problem as soon as possible is desirable
  * it prevents a more obscure crash later, in transplants.write()
  * there might be other lurking (or future) bugs that cause
    repo.commit() to do nothing

Also, in the case of issue2264 (source changesets silently dropped by
transplant), the only way to spot the problem currently is the crash
in transplants.write().  Failure to transplant a patch should abort
immediately, whether it's user error (patch does not apply) or a
Mercurial bug (e.g. repo.status() failing to report changes).
2010-07-18 21:29:29 -04:00
Vishakh H
fb390f5f84 mq: cleanup status if applied mq is stripped (issue1881)
stripping of applied mq patches leads to wrong state recorded in status
file. find all mq patches that will be affected and clean up status file
before strip.
2010-07-20 20:37:29 +05:30
Greg Ward
08b5f707c3 inotify: make inotifydirstate.status() returns a tuple of lists.
This makes it consistent with dirstate.status(), which is important if
there are other extensions messing with the output of status().  Those
extensions can safely assume that dirstate.status() returns a tuple of
lists, because its docstring says it does.  But
inotifystatus.dirstate() returns a list of lists, which can break
those other extensions.
2010-07-20 14:00:47 -04:00
Gilles Moris
6e5b8353f9 qpush --move: move the right patch even with comment lines
9af52509546a caused that we find the index of the moving patch in self.series
but look it up in self.full_series. The difference between these is that
full_series also contains comment lines, and we thus moved the wrong patch.

Use back self.full_series to find the moving patch, but take care of striping
the patch guard markers before comparing the patch name. Test cases have been
added for comments and empty lines in self.full_series, and for the case of
guarded patches.

Original patch contributed by Mads Kiilerich <mads@kiilerich.com>
2010-07-10 21:23:00 +02:00
Brodie Rao
e68a4f5865 bookmarks: ensure current bookmark is updated when specified with -r .
"hg bookmark -r . foo" should be equivalent to "hg bookmark foo".
2010-07-14 11:02:20 -04: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
Christian Ebert
15f0c93000 keyword: add extra datefilters in a single update call 2010-07-15 10:24:31 +02:00
Brendan Cully
5c49b19eb5 mq: evaluate --user before invoking editor with -e (issue2289) 2010-07-15 10:41:41 -07:00
Renato Cunha
b6d6b8775c removed exception args indexing (not supported by py3k)
Py3k removed __getitem__ for exception classes. The correct way of
getting the exception arguments is by using the args method.
2010-07-14 23:03:21 -03:00
Renato Cunha
0ef348b9d4 record: removed 'has_key' usage
Py3k has removed the dictionary has_key method. This patch implements
a one argument function that can be used as a callback by hg.revert in
the record extension.
2010-07-14 22:58:29 -03:00
Martin Geisler
b620743b6b Merge with stable 2010-07-14 21:30:50 +02:00
Henrik Stuart
c4714744e5 merge stable to default 2010-07-14 20:41:01 +02:00
Nicolas Dumazet
658e3fee6a merge with stable 2010-07-13 22:56:01 +09:00
Nicolas Dumazet
9085ce94e6 mq: qrepo.add(mq.added) inside save_dirty inside of doing it manually
This should make the MQ API more transparent: callers only have to
call save_dirty, and no mq.added magic or knowledge is required.
2010-07-13 22:30:01 +09:00
Renato Cunha
6de8a70a9d inotify: check all components of filenames against hgignore (issue884)
With inotify enabled, files that should be ignored could be detected as
untracked by mercurial. This behavior was wrong because inotify's filestatus
implementation only matched filenames against ignore patterns, instead of
checking if other elements of their paths matched them. This patch fixes the
behavior by checking the file paths against the ignore patterns.

A new test has also been added to the main inotify test to prevent any
regressions.
2010-07-06 22:22:18 -03:00
Renato Cunha
f1db4f7c25 inotify: Port of the C module to py3k.
This patch accomplishes the port of the inotify C module to py3k by #including
mercurial's util.h file, and by defining the necessary boilerplate code
required by py3k through conditional compilation.
2010-07-02 16:22:59 -03:00
Renato Cunha
e091197571 inotify: Better implementation of the event string representation.
This patch reimplements the event_repr function. It got mostly rewritten to
eliminate the need for conditional compilation of the module when building in
py3k. The trick there (thanks to Antoine Pitrou) is to use the % operator to
let the python interpreter format the string to be returned.
2010-07-02 16:21:46 -03:00
Renato Cunha
d43bcc0e6e inotify: make proper use of Python API to get object size.
In older python versions, it was ok to access an object's type by accessing its
ob_type "member". With python 2.6+, the proper way of accessing it is via
Py_TYPE(object). This patch implements the correct call for the inotify
extension. When under python < 2.6, this macro is defined in mercurial's
util.h.
2010-07-02 16:21:42 -03:00
Martin Geisler
5fbbb27c25 Merge with stable 2010-07-09 14:21:45 +02:00
Mads Kiilerich
337e489bbe convert: cleanup of filemap help text
Clarify that:
- Specified paths are matched by comparing name of file or directory.
- Line order (thus) doesn't matter.
- Rename doesn't imply include.
2010-07-08 15:44:14 +02:00
Martin Geisler
9fd4048b8f Merge with stable 2010-07-06 20:43:19 +02:00
Martin Geisler
03193efb11 Merge with stable 2010-07-03 02:06:07 +02:00
Martin Geisler
7b12009341 zeroconf: small fixes in docstring
Use reST role for consistency, import small part of Debian's
proposed_upstream__correct-zeroconf-doc patch from

  http://svn.debian.org/viewsvn/python-apps/packages/mercurial/trunk/debian/patches/
2010-07-03 01:56:09 +02:00
Nicolas Dumazet
2d7fd252ec rebase: small cosmetic cleanups 2010-07-12 19:04:07 +09:00
Nicolas Dumazet
a34bba6494 rebase: re-add patches to mq repo after rebase
Since b4eaab2f8dee, we are adding patches after the qimport call, and not
inside it anymore. Correct updatemq to match the new behaviour.
2010-07-13 20:12:32 +09:00
Nicolas Dumazet
5651c754f9 mq: reset self.added after the mq transaction instead of inside qimport
It seems wiser to reset mq.added at the end of the mq transaction instead of at
the beginning of a qimport call: this way, calling several times qimport()
without saving mq state in-between does not overwrite the previous value of
mq.added (this happens, for example in rebase, where we import several patches
in a batch before calling .save_dirty() )
2010-07-12 17:55:23 +09:00
Brodie Rao
6f58bfc15e color/progress: subclass ui instead of using wrapfunction (issue2096)
This resolves the issue of hg cmd --mq not being colorized. This was due
to color wrapping only the instance of ui passed to dispatch._runcommand(),
which isn't the same ui object that mq.mqcommand() receives. After dispatch
calls extensions.loadall(), it makes sure any changes to ui.__class__ in
uisetup are propagated.

progress is updated to wrap ui in the same manner because wrapfunction
doesn't play well when ui.__class__ has been replaced by another extension
(orig will point to the old class method instead of color's).
2010-07-01 19:23:26 -05:00
Renato Cunha
1b3435e951 churn: remove tuple parameter unpacking (deprecated in py3k) 2010-07-01 19:27:03 -03:00