Commit Graph

760 Commits

Author SHA1 Message Date
Nicolas Dumazet
5a000fb762 strip: support multiple revisions 2010-07-17 00:47:06 +09: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
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
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
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
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
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
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
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
Matt Mackall
f8809566c2 merge with stable 2011-03-23 09:20:40 -05:00
Martin Geisler
47a3f1a049 merge with stable 2011-03-14 14:05:19 +01:00
Nicolas Dumazet
517eb64655 merge with stable 2010-07-22 15:14:22 +09:00
Brendan Cully
5c49b19eb5 mq: evaluate --user before invoking editor with -e (issue2289) 2010-07-15 10:41:41 -07: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
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
Yuya Nishihara
adbae861a8 mq: fixed ENOENT when qrename to new/directory.patch
MQ patch name can contain slashes, e.g. 'foo/bar.patch'.

Currently "qnew foo/bar.patch" works, but
"qrename foo/bar.patch new/dir.patch" fails with
"No such file or directory".

Also added test case for "qnew foo/bar.patch"
2010-03-28 15:23:11 +09:00
Vishakh H
7839628449 mq: qimport cleanup on fail (issue2214)
save state of successfully added patches and ensure
cleanup on the way out.
2010-06-29 03:09:42 +05:30
Gilles Moris
de632dde6b mq: explicit exit code when patch is already on top 2010-06-22 21:36:09 +02:00
Gilles Moris
ed9f9e6f02 mq: fix qpush --move for selected guarded patches
In the case of guarded patch, the patch could not be found because the
full_series list contains also the guard value appended to each patch name.
As we already checked that the patch is pushable above in the code, we just
have to use the series list (which doesn't contains guard value) to get the
patch index.
2010-06-22 09:49:51 +02:00
Dirkjan Ochtman
75e5a3fcef mq: __str__ falls back to __repr__ 2010-06-17 15:53:26 +02:00
Greg Ward
1b6a40bfe8 mq: make 'qdelete <patchidx>' work again.
This just backs out b51fc1a46a02 (a minor code cleanup that
accidentally broke qdelete) and adds a test.
2010-06-16 22:00:02 -04:00
Dan Villiom Podlaski Christiansen
de6e2d6afa mq: use ui.formatted() instead of ui.plain(). 2010-06-07 15:33:03 +02: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
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
Martin Geisler
bd1de7cf0d mq: use hg reST role some more 2010-06-08 14:12:46 +02: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
Matt Mackall
86ebd43d71 remoteui: move from cmdutil to hg 2010-06-01 11:18:57 -05:00
Cédric Duval
06eedc4b82 mq: prevent the creation of a queue whose name is already taken
Each check is moved under the code handling the relevant option, and
a new one is added for --create. This fixes duplicated entries being
added to the queues list.
2010-06-03 20:40:23 +02:00
Henrik Stuart
ac61fc4db1 mq: fix naming issues for qqueue directories 2010-06-02 19:39:45 +02:00
Martin Geisler
4644ff1a96 mq: mention qqueue in module docstring 2010-05-30 23:24:10 +02:00
Ronny Pfannschmidt
4362059a98 make transactions work on non-refcounted python implementations 2010-05-27 17:47:40 +02:00
Henrik Stuart
9ec8c20547 mq: support multiple patch queues using qqueue 2010-05-29 20:32:39 +02:00
Martin Geisler
b457854adf mq: remove unneeded local variable in delete 2010-05-24 00:55:42 +02:00
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
Matt Mackall
a5aceec057 strip: drop deprecated -b from synopsis 2010-05-19 20:20:16 -05: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
Patrick Mezard
1c127410a2 mq: mention qfinish in qimport help 2011-03-03 21:42:15 +01:00
Eric Eisner
21d3c16701 mq: make use of output labeling for summary 2010-05-07 16:51:45 -04:00
Martin Geisler
f93965f673 mq: mark error message for translation 2010-05-07 23:31:49 +02:00
Martin Geisler
0133c2f995 mq: mark string for translation 2010-05-07 23:28:07 +02:00
Matt Mackall
7a237857b0 mq: add a line to hg summary 2010-05-05 20:53:45 -05:00
Matt Mackall
7f6aa6252c Merge with stable 2010-05-01 15:15:35 -05:00
Faheem Mitha
5fe5a6e7b6 mq: rewrite strip docstrings
This patch is joint work with ilowe.
2010-05-01 23:04:49 +05:30
Mads Kiilerich
ee95467b21 mq: qpush --move, reorder patch series and apply only the patch
This makes it less necessary to edit .hg/patches/series manually.
2010-04-30 15:05:51 +02:00
Yuya Nishihara
e1d422d1b5 commands: refactor diff --stat and qdiff --stat
`opts['unified'] = '0'` can be replaced by `diffopts.context = 0`.
2010-04-07 00:45:20 +09:00
Yuya Nishihara
a3e35890c8 mq: fix opts['unified'] = '0' to take effect when qdiff --stat
`opts['unified'] = '0'` tries to reduce the number of lines to be
processed by patch.diffstat, but here it does not affect diffopts,
thus it does not make sense.

Instead, we can change `diffopts.context` directly.

Added test case for qdiff --stat.
2010-04-07 00:10:54 +09:00
Martin Geisler
f1853c5e82 Use hg role in help strings 2010-04-22 10:24:49 +02:00
Matt Mackall
399ebe1c0f Merge with stable 2010-04-19 17:00:02 -05:00
Dan Villiom Podlaski Christiansen
3b0b530a9d mq: only highlight/label patch name for qseries.
Restore the behaviour introduced in 6805fe267fe5, which was
accidentally removed when labelling was introduced in af5046e50cc6.
2010-04-15 18:12:28 +02:00
Matt Mackall
e4c06cc26b mq: promote qnew, demote qinit in short help 2010-04-11 14:25:02 -05:00
Steve Borho
c7ec998a7b localrepo: add desc parameter to transaction
All callers to localrepo.transaction() must supply a transaction description.
The description and the existing repository tip are then stored
(transactionally) into .hg/undo.desc; where rollback can later find it.
2010-04-09 17:23:35 -05:00
Matt Mackall
b0e809f105 Merge with stable 2010-04-07 14:44:51 -05:00
Henrik Stuart
c77aceb840 mq: use util.unlink instead of os.unlink and os.removedirs
If, on Windows, your repository and working copy are in a reparse point and you
use os.removedirs, you will remove non-empty reparse points, disabling the
reparse point. See @6b1369445b7b.
2010-04-07 16:55:01 +02:00
Brodie Rao
e46074c7b3 color: colorize based on output labels instead of parsing output
By overriding ui.write(), ui.write_err(), ui.popbuffer(), and ui.label(),
the color extension can avoid parsing command output and simply colorize
output based on labels.

As before, the color extension provides a list of default colors for
core commands/labels. Other extensions can provide their own defaults by
specifying a colortable dict (similar to cmdtable).

In this process, --color is promoted to a global option and the deprecated
--no-color option is removed.
2010-04-02 15:22:17 -05:00
Brodie Rao
9422709db6 qseries: make use of output labeling 2010-04-02 15:22:14 -05:00
Brodie Rao
a7217d1b38 qdiff: make use of output labeling 2010-04-02 15:22:11 -05:00
Brodie Rao
28173d35ba qguard: make use of output labeling 2010-04-02 15:22:12 -05:00
Matt Mackall
0726edad79 Merge with stable 2010-04-01 17:51:59 -05:00
Matt Mackall
d287a71ee7 Merge with i18n 2010-04-01 17:40:47 -05:00
Wagner Bruna
0d7a0676a9 mq: remove reference for deprecated -f option
-f is the default behaviour since a4e731b2164f
2010-04-01 19:32:08 -03:00
Brendan Cully
3f85d60b3e Merge with stable 2010-03-31 15:09:59 -07:00
Michael Glassford
268693c3a0 Add missing --mq option to hg log.
Since norepo is a string, not a list, the norepo check was matching
command names against any substring in norepo. This fix splits norepo
into a list of commands.
2010-03-31 10:59:00 -04:00
Sune Foldager
8d7f484a9b merge with stable 2010-03-26 17:09:56 +01:00
Sune Foldager
7c4049acf8 localrepo: change _updatebranchcache to use a context generator 2010-03-26 17:02:23 +01:00
Patrick Mezard
3a9ceece66 Merge with crew-stable 2010-03-23 22:59:31 +01:00
Patrick Mezard
ff276d3f72 mq: fix qcommit documentation wrt --mq option 2010-03-23 10:18:46 +01:00
Benoit Boissinot
40a289572d mq: allow lines starting with '--- ' in patch messages 2010-03-18 19:26:56 +01:00
Brendan Cully
791f92f6bd Merge with stable 2010-03-18 14:36:24 -07:00
Benoit Boissinot
f39aa4fcb7 mq: do not try to delete non-existent files (regression from 5f2a56be1e3e) 2010-03-14 22:17:10 +01:00
Martin Geisler
4936f759eb Merge with stable 2010-03-14 22:21:48 +01:00
Benoit Boissinot
5337e0f1bd mq: don't use regexp when not necessary 2010-03-14 19:09:55 +01:00
Cédric Duval
5526bbffdb mq: fix init with nonexistent or non-local repository 2010-03-14 18:46:38 +01:00
Cédric Duval
f7452aeef3 mq: no longer refer to deprecated qinit -c command 2010-03-14 19:21:24 +01:00
Cédric Duval
b91592cdc4 mq: don't mention qinit as a "common task"
Without -c, it is a no-op (the queue is implicitly initialized by all
relevant commands if needed), and queue repositories with -c are an
advanced usage of mq, and not otherwise required.
2010-03-14 19:17:06 +01:00
Benoit Boissinot
79921b5a72 mq: use xrange/enumerate instead of += 1 2010-03-14 14:53:20 +01:00
Benoit Boissinot
9be5c5ce37 mq: don't use len(list) unless necessary 2010-03-14 14:45:01 +01:00
Benoit Boissinot
8b8c0315c4 mq: find_series() simplify and don't use regexps 2010-03-14 12:08:14 +01:00
Benoit Boissinot
4f9affc968 mq: fix coding style (missing space) 2010-03-14 11:12:51 +01:00
Benoit Boissinot
cea219ac52 mq: qsave creates entries with the left part empty (':patchname') 2010-03-14 11:12:07 +01:00
Benoit Boissinot
18dd3c4c26 mq: simplify statusentry(), fix restore broken by 6099aebf81d9 2010-03-14 01:35:54 +01:00
Benoit Boissinot
2aba9d3b98 mq: use context API 2010-03-14 01:06:58 +01:00
Benoit Boissinot
2d9b1f0eb3 mq: simplify qparents calculation 2010-03-14 01:01:17 +01:00
Benoit Boissinot
d5eca3183b mq: simplify commit message generation 2010-03-14 00:53:55 +01:00
Benoit Boissinot
4b556a742a mq: avoid many hex/bin conversions, keep the binary node when possible 2010-03-14 00:36:10 +01:00
Isaac Jurado
eb02fcecf2 mq: Remove -f from qnew command syntax.
In 27e33e529fab the -f option was not completely removed from the help message.
2010-04-17 15:35:34 +02:00
Dan Villiom Podlaski Christiansen
a911d6d8e4 mq: toggle truncating using ui.plain() rather than ui.interactive()
This enables truncated messages when using `qseries' with the `pager'
extension.
2010-04-15 14:06:07 +02:00
Benoit Boissinot
e0e2445d35 mq: simplify and use context API 2010-03-13 12:57:20 +01:00
Benoit Boissinot
8fab2b5659 mq: avoid a (potentially expensive) repo.status(unknown=True) call 2010-03-13 00:08:06 +01:00
Benoit Boissinot
25e7dd806e mq: all_files can be a set, remove dangerous default values 2010-03-13 00:02:33 +01:00
Benoit Boissinot
04d99f9fbc patch/diff: move patch.export() to cmdutil.export()
This API change will allow us to break a cycle between patch and cmdutil.
2010-03-08 19:43:24 +01:00
Matt Mackall
84afa4dd8f mq: drop -Q in favor of --mq only 2010-03-05 17:24:52 -06:00
Sune Foldager
533ddd28b6 mq: disallow : in patch names (issue2065) 2010-03-05 10:49:56 +01:00
Sune Foldager
868689388b mq: disallow # (and : on Windows) in patch names (issue2065) 2010-03-04 14:23:54 +01:00
Benoit Boissinot
10dba63dce mq: simplify --mq handling / keep compatibility with other extensions
reported by edgimar on IRC
2010-02-28 19:43:21 +01:00
Benoit Boissinot
7dae5be27b i18n: mark more strings for translation 2010-02-19 02:23:38 +01:00
Brendan Cully
4b383ed9c8 mq: iterate over a copy of the command table keys (fixes issue2045).
I hope.
2010-02-17 14:35:11 -08:00
Brendan Cully
0a7c012eeb mq: unify implementation of qinit and init -Q 2010-02-15 00:16:59 -08:00
Martin Geisler
0d92b94dfa mq: more instructive use of "--" in qguard help (issue2040) 2010-02-15 00:12:10 +01:00
Matt Mackall
a2acbc421b fix up a bunch of check-code warnings 2010-02-09 14:12:22 -06:00
Henrik Stuart
16f156af74 mq: remove unused import 2010-02-10 21:17:58 +01:00
Brendan Cully
7de7b4555d mq: incorporate mq repo config when using --mq
For example, incoming should use the paths defined in .hg/patches/hgrc
instead of .hg/hgrc.
2010-02-10 10:58:11 -08:00
Brendan Cully
3743c1ee43 mq: make init -Q do what qinit -c did 2010-02-08 10:50:00 +01:00
Brendan Cully
de80ca9367 mq: add -Q option to all commands not in norepo 2010-02-08 10:23:44 +01:00
Steve Losh
eea597d740 mq: add parent node IDs to MQ patches on qrefresh/qnew
The goal of this patch is to add the IDs of the parents of applied MQ patches
into the patch file headers whenever qnew or qrefresh are run.

This will serve as a reminder of when the patches last applied cleanly and
will let us do more intelligent things in the future, such as:

    * Resolve conflicts found when qpushing to a new location by merging
      instead of simply showing rejects.

    * Display better diffs of versioned MQ patches because we can tell how the
      patched files have changed in the meantime.

Here are the new rules this patch introduces.  They are checked in this order:

    * If a patch currently has old, plain-style patch headers ("From:" and
      "Date:") do not change the style or add any new headers.

    * If the 'mq.plain' configuration setting is true, only plain-style
      headers will be used for all MQ patches.

    * qnew will initialize new patches with HG-style headers and fill in the
      "# Parent" header with the appropriate parent node.

    * qrefresh will refresh the "# Parent" header with the current parent of
      the current patch.
2010-02-07 10:47:54 -05:00
Augie Fackler
2df305a808 mq: fix deprecation mention, line length 2010-02-07 16:03:38 +01:00
Augie Fackler
03f43e09ea qnew: ignore force option
This makes the default behavior the same as qnew --force, and
deprecates the force option.
2010-02-07 07:37:05 -06:00
Dirkjan Ochtman
d5c4ebd0b0 mq: fix typo, thanks pmezard 2010-02-07 14:53:17 +01:00
Patrick Mezard
1ce5274987 Merge with crew-stable 2010-02-07 14:43:21 +01:00
Dirkjan Ochtman
e11a173bf9 mq: don't warn on qpush against a branch head 2010-02-07 14:06:05 +01:00
Dirkjan Ochtman
38666f1574 mq: deprecate qinit and qcommit 2010-02-07 13:49:52 +01:00
Dirkjan Ochtman
7144a20940 mq: deprecate qsave, qrestore and related options 2010-02-07 12:34:02 +01:00
Dan Villiom Podlaski Christiansen
7bb072742b mq: remove qrefresh slow path (issue2025)
The slow path/fast path distinction has existed since mq was added to Mercurial
in 2006. The slow path was used whenever the refreshed revision wasn't the tip
2010-02-06 18:36:27 +01:00
David Soria Parra
ab20fd09d8 mq: Do not translate import message that are appended to commits.
We should not translate the "imported patch" message. The translated message
confuses the detection whether the user has not updated the commit message yet.
We try to avoid to translate generated commit messages.
2010-01-20 23:23:18 +01:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Patrick Mezard
e9130008f6 mq: preserve --git flag when folding patches
Without this, folding a git patch into a regular one downgrades the resulting
patch to a regular patch.
2010-01-01 19:53:05 +01:00
Patrick Mezard
a9ef9386bc mq: preserve --git flag when merging patches
Without this, merging a patch queue without diff.git=1 downgrades all git
patches to regular patches, losing data in the process.
2010-01-01 19:53:05 +01:00
Patrick Mezard
f07dfd4d40 mq: stop caching and sharing diff options
Several mq commands mutate the shared options which causes hard to track bugs
when multiple calls are combined.
2010-01-01 19:53:05 +01:00
timeless
7f202fbf9b mq: qnew -f should reject merge working directories 2009-12-23 13:09:11 +01:00
Nicolas Dumazet
6afdc121ac mq: qpop: remove added files before re-adding removed files
We need to do this to avoid file/directories conflicts.
This causes patches removing a committed file and replacing it
with a directory to be "unpoppable".
2009-12-11 15:09:52 +09:00
Dan Villiom Podlaski Christiansen
d5e8634932 qseries: don't truncate the patch name (issue1912)
Instead of truncating the entire output line of `qseries', only the
summary is truncated.
2009-11-17 22:16:41 +01:00
Brendan Cully
1ce45ec1c3 Allow import --no-commit over an applied MQ patch.
Since it only changes the working directory, it does not matter whether a patch is
applied. This change makes it easier to use hg import --no-commit instead of patch.
2009-11-16 11:31:08 -08:00
Martin Geisler
85252bdcb6 diff: change --inverse to --reverse
This fixes an incompatibility with patch(1), which also uses --reverse
for reversed diffs. The --inverse flag was added in 0f0383897d54. That
name was chosen over --reverse since it was thought that --reverse
would make --rev ambiguous.

It turns out that both flags can co-exist, with the cost that --rev
can no longer be shortened to --r and --re. Since one can always use
the short -r option, this is not a real problem.
2009-11-14 14:21:53 +01:00
Martin Geisler
ff95857722 mq: fix literal blocks in docstrings 2009-11-11 00:05:12 +01:00
Martin Geisler
1f42ec8873 mq: do not call ui.username unless it is necessary
After changeset 54b67f7bd5df, ui.username will abort by default if no
username is set. It is therefore wrong to call ui.username when a
username was provided on the command line.
2009-11-07 00:13:05 +01:00
Yannick Gingras
ed1d8b7e7a diff: add --inverse option
Most of the time, one can reverse a diff by swapping the revisions passed with
-r but it happens that if you use the global -R, and diff against the tip of
the current repo, you can't swap the revisions. One use-case for that is
reviewing changes from a bundle before unbundling. One could also pipe the
output of `hg diff` to a command line filter that reverses the diff, but that
would remove the benefit from color diffs. Therefore, having an option in
`hg diff` to reverse a diff is a good thing.

The option flag selection was tricky. GNU patch uses -R/--reverse but -R is
already used as a global option and --reverse would make --rev ambiguous.
2009-11-05 15:18:56 +01:00
Brodie Rao
7c2f2247c5 diffstat: with --git, mark binary files with Bin
Normally, diffs without any text insertions or deletions are reported
as having 0 lines changed by stock diffstat. Compatibility is
preserved with stock diffstat in this case, but when using --git,
binary files are marked with Bin as a means of clarification.

git diff --stat does something similar, though it also includes the
old and new file sizes.
2009-10-25 02:53:33 +02:00
Brodie Rao
8c7629d9e4 diff: add --stat for diffstat output
diff/qdiff --stat invokes patch.diffstat() on the diff output.

When in interactive mode, the output's maximum width is determined by the
terminal's width.
2009-10-25 02:52:35 +02:00
Martin Geisler
48349e3ff0 Merge with crew-stable 2009-10-16 00:45:18 +02:00
Benoit Allard
f444222eca mq: fix traceback for qpush inexistant-patch with no patch applied 2009-10-16 00:09:18 +02:00
Stephen Rasku
15c682540c mq: changed help for qpop -f to reflect actual behaviour 2009-10-14 21:21:09 -07:00
Martin Geisler
9f1896c083 do not attempt to translate ui.debug output 2009-09-19 01:15:38 +02:00
Matt Mackall
921ef4d657 Merge qprev/qnext backout 2009-09-14 17:29:47 -05:00
Matt Mackall
77949f88d1 Backed out premature qprev/qnext removal 2009-09-14 16:39:24 -05:00
Thomas Arendsen Hein
9df07442ce Add new flag [-1] to synopsis of qapplied/qunapplied 2009-09-11 16:58:19 +02:00
Dirkjan Ochtman
4fc1177ba0 mq: get rid of qnext, qprev and qtop 2009-08-19 12:51:07 +02:00
Dirkjan Ochtman
d825977cb1 mq: add options to qapplied/qunapplied to act like qprev/qnext 2009-08-19 12:50:46 +02:00
Martin Geisler
476e39b88f mq: don't mention qtop in module doc string
(qtop was removed in 5b1bcf3885fe)
2009-08-21 16:58:30 +02:00
David Soria Parra
7af1039389 mq: Parse commit message after we find start of changeset patch
patch.extract extracts just the message below HG changeset patch. So to not
parse comments above the patch, we reset the message if we find a changeset
patch as we know the commit message comes after the changeset patch data.
This is similar to the behavior of patch.extract.

The drawback of this approach, after a qref -e the comment above HG changeset
patch is gone. Without this patch the message would become part of the commit
message in the HG changset patch part.
2009-07-28 15:36:28 +02:00
Yann E. MORIN
e5e948735c mq: re-phrase the qrefresh help about the user and date options 2009-08-12 10:57:18 +02:00
Yann E. MORIN
b58fccf06d mq: add the date with qrefresh, even if missing (issue1768)
When setting the date with qrefresh (-d|-D), and the patch does have
neither a 'Date:' nor a '# Date' header, add the date field as such:

- if the patch has a 'From:' header, add a 'Date:' header
- otherwise, upgrade to Mercurial extended patch format and add '# Date'
2009-08-12 10:57:27 +02:00
Yann E. MORIN
ac0ee93ebf mq: upgrade the patch to HG format when adding the author name with qrefresh
When setting the author field with qrefresh (-u|-U), and the patch does have
neither a 'From:' nor a '# User' header, add the author name as such:

- if the patch has a 'Date:' header, add a 'From:' header
- otherwise, upgrade to Mercurial extended patch format and add # From
2009-08-12 10:48:18 +02:00
Yann E. MORIN
171901b514 mq: add function to check if a header exists in a patch 2009-08-12 10:46:16 +02:00
Yann E. MORIN
95c7683f34 mq: fix coding style in qrefresh 2009-08-12 10:46:03 +02:00
Martin Geisler
d1c63312f6 Merge with crew-stable 2009-08-01 00:36:22 +02:00
Martin Geisler
827c92ac3e mq: wrap docstrings at 70 characters 2009-07-26 01:53:49 +02:00
Martin Geisler
ae0794fd45 coding style: use a space after comma
I left a cases like 'lambda x,y:' alone -- the lack of a space does
not bother me as much when the variables are single letters.
2009-07-22 23:12:54 +02:00
Brendan Cully
09920a4acd Merge with hg 2009-07-16 21:05:24 -07:00
Martin Geisler
3951831e0b commands: use minirst parser when displaying help 2009-07-16 23:25:26 +02:00
Greg Ward
b0c72fe36d localrepo: factor _findtags() out of tags() (issue548).
This makes in-memory caching the sole responsibility of localrepo,
eliminating some localrepo code that was duplicated in mq and
bookmarks.
2009-07-16 10:39:41 -04:00
Martin Geisler
88a6656cb1 mq: use ui.status when pushing and popping patches 2009-07-10 23:24:35 +02:00
Mads Kiilerich
b3ac6d2456 mq: qpop now tells which patches are popped
When navigating through a patch series by qpushing and qpopping it was easy to
get lost because qpop was silent. I found myself often running qnext after qpop
to see which patch I just dropped - especially if I was about to qrm it. This
patch makes qpop more symmetric to qpush by showing which patches are
applied/"unapplied".

I think it is a good change even though it changes output by adding a new line
of output.
2009-07-09 23:59:03 +02:00
Martin Geisler
3571ef287c mq: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Alejandro Santos
1ef2fb42a7 compat: use 'key' argument instead of 'cmp' when sorting a list 2009-07-05 11:02:00 +02:00
Dan Villiom Podlaski Christiansen
1d4adbe287 mq: align columns in verbose qseries output. 2009-06-27 15:28:44 +02:00
Martin Geisler
d8c14d7c74 mq: standardize qfinish cmdline help string 2009-06-27 12:13:40 +02:00
Dirkjan Ochtman
1c6c4a9bc7 extensions: fix up description lines some more 2009-06-24 12:25:56 +02:00
Dirkjan Ochtman
501eaa4cfb mq: compact & rewrap documentation for qdelete command 2009-06-24 12:03:13 +02:00
Cédric Duval
8a280aa6dc mq: no longer mention the deprecated qdelete's --revision option
The option will no longer show up in the list, unless --verbose is used.

'qdel -r' has been deprecated in favor of qfinish since the 1.1 release.
It is still fully functional, but new users need not learn about it.
2009-06-23 22:20:25 +02:00
Cédric Duval
dbcec5595d extensions: improve the consistency of synopses
Trying as much as possible to consistently:
 - use a present tense predicate followed by a direct object
 - verb referring directly to the functionality provided
   (ie. not "add command that does this" but simple "do that")
 - keep simple and to the point, leaving details for the long help
   (width is tight, possibly even more so for translations)

Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom
Podlaski Christiansen and others for the helpful suggestions.
2009-06-22 15:48:08 +02:00
Dirkjan Ochtman
9685cd7ac9 mq: fix error message for qpush inexistent-patch (issue1702) 2009-06-21 17:34:33 +02:00
Dirkjan Ochtman
12ed4dc982 mq: unify code for qdel -r and qfin 2009-06-19 13:58:22 +02:00
Dirkjan Ochtman
d6eb9e3f55 mq: warn about finalizing patches without cset message 2009-06-19 12:37:29 +02:00
Patrick Mezard
7039de96dc Make mq, record and transplant honor patch.eol 2009-06-15 00:03:27 +02:00
Adrian Buehlmann
d4fe84d762 mq: eliminate warning on qpush with empty series
Warning was "DeprecationWarning: use lock.release instead of del lock"
2009-06-08 20:02:44 +02:00
Benoit Boissinot
125a85ec87 use new style classes 2009-06-10 15:10:21 +02:00
timeless
fb33de67af Generally replace "file name" with "filename" in help and comments. 2009-06-09 09:25:17 -04:00
timeless
3ccbc308d0 Spell Mercurial as a proper noun 2009-06-09 09:25:31 -04:00
Matt Mackall
19bea6fdda mq: fix commit prototype 2009-06-03 17:07:41 -05:00
Matt Mackall
c1213eaf9d commit: drop the now-unused files parameter 2009-06-01 14:11:32 -05:00
Matt Mackall
e12da484f7 mq: drop unneeded files args for commit 2009-06-01 13:51:21 -05:00
Cédric Duval
dc685aa920 mq: rename setheader to updateheader and fix comment 2009-05-30 19:37:01 +02:00
Cédric Duval
ee45037723 mq: initializing patchheader class directly from patch content
The patch header needs only be read in order to instantiate the class,
and as such it makes more sense to do it within the class.
2009-05-30 19:18:29 +02:00
Martin Geisler
5b4e5428df replace "i in range(len(xs))" with "i, x in enumerate(xs)"
The remaining occurrences should be the ones where "xs" is mutated or
where "i" is used for index arithmetic.
2009-05-26 22:59:52 +02:00
Martin Geisler
4176f5b789 replace xrange(0, n) with xrange(n) 2009-05-25 23:06:11 +02:00
Martin Geisler
0a365d5ca2 use 'x is None' instead of 'x == None'
The built-in None object is a singleton and it is therefore safe to
compare memory addresses with is. It is also faster, how much depends
on the object being compared. For a simple type like str I get:

            | s = "foo" | s = None
  ----------+-----------+----------
  s == None | 0.25 usec | 0.21 usec
  s is None | 0.17 usec | 0.17 usec
2009-05-20 00:52:46 +02:00
Simon Heimberg
478d2c2e22 mq: new method invalidate
Introduce method invalidate (similar to dirstate and repo).
2009-05-05 10:29:34 +02:00
Simon Heimberg
ed59692bba mq: only read files when needed
use util.propertycache as in dirstate
2009-05-04 03:35:42 +02:00
Patrick Mezard
e76a7010bb Merge with crew-stable 2009-05-17 20:00:11 +02:00
David Frey
6d5875bc34 mq: abort qfold upon local changes (issue1662) 2009-05-16 16:20:37 -07:00
Dirkjan Ochtman
1e9b20dc8f mq: qpush shouldn't complain if working dir is at a non-tip head 2009-05-15 15:21:17 +02:00
Dirkjan Ochtman
43d9564cff some modernization cleanups, forward compatibility 2009-05-13 14:08:39 +02:00
Dirkjan Ochtman
9b104a6a4a mq: add -P/--push option to qimport 2009-05-12 11:15:54 +02:00
Simon Heimberg
b21a1df0f0 mq: simpler check of first character of guard name 2009-05-04 03:49:57 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
2f9b02c62d replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
2009-04-26 16:50:44 -05:00
Matt Mackall
6708d0e299 add cmdutil.remoteui
remoteui sorts out the issues of getting ssh config options from the
local repo into the remote one while not copying other options like hooks.
2009-04-26 16:50:43 -05:00
Martin Geisler
e2222d3c43 replace set-like dictionaries with real sets
Many of the dictionaries created by dict.fromkeys were emulating sets.
These can now be replaced with real sets.
2009-04-22 00:57:28 +02:00
Martin Geisler
44aa7e92d1 util: use built-in set instead of util.unique 2009-04-22 00:56:06 +02:00
Ronny Pfannschmidt
0cd168d6ec switch lock releasing in the extensions from gc to explicit 2009-04-22 02:01:22 +02:00
Martin Geisler
52ce98c9a8 help texts: write command line switches as -a/--abc 2009-04-18 14:40:21 +02:00
David Frey
feea6494c8 Update qimport help explaining how to read a patch from stdin (Issue371) 2009-04-18 00:21:11 -07:00
Martin Geisler
42fa3800bd expand "rev" to "revision" in help texts 2009-04-07 23:06:50 +02:00
Martin Geisler
249541da43 expand "repo" to "repository" in help texts 2009-04-07 22:58:05 +02:00
Martin Geisler
ea1734b579 expand "dir" to "directory" in help texts 2009-04-07 22:47:56 +02:00
Martin Geisler
ac7200b59d mq: word-wrap help texts at 70 characters 2009-04-04 23:18:03 +02:00
Martin Geisler
04b0d911a3 Change double spaces to single spaces in help texts. 2009-04-04 21:09:43 +02:00
Peter Arrenbrecht
a2d3e23eef cleanup: drop variables for unused return values
They are unnecessary. I did leave them in localrepo.py where there is
something like:

  _junk = foo()
  _junk = None

to free memory early. I don't know if just `foo()` will free the return
value as early.
2009-03-23 13:13:02 +01:00
Matt Mackall
1a2d87e4e1 mq: handle empty patches more gracefully (issue1501) 2009-02-16 17:37:23 -06:00
Augie Fackler
7131a2f8b7 fancyopts: Parse options that occur after arguments.
This changes the behavior of qguard in the case of setting negative guards, as -- will now always be required.
Fixes issue1402.
Doc fixes for mq by mpm.
2009-02-10 13:26:00 -06:00
John Mulligan
53dbf005c3 mq: allow qclone's -p option to use path alias
Add support for running 'hg qclone -p foo bar' where foo is a path
alias defined in the [paths] section of an hgrc file.
2009-01-25 13:49:15 -05:00
Matt Mackall
9ca84951ff mq: remove import of revlog 2009-01-12 10:59:08 -06:00
Matt Mackall
e0735a1762 error: move repo errors
rename NoCapability to CapabilityError
2009-01-12 10:42:31 -06:00
Martin Geisler
dc4fd3bf46 mq: lowercase output
This extension produces quite a lot of informational messages during
its normal operation and it is hard to say which strings can be
changed and which cannot.
2009-01-03 17:15:21 +01:00
Dirkjan Ochtman
aabce1d60c mq: allow qpop if popped revisions are not working dir parents 2009-01-12 09:07:02 +01:00
Dirkjan Ochtman
59115793ee mq: refactor the pop code to be more readable and allow more changes 2009-01-12 09:53:55 +01:00
Dirkjan Ochtman
b62067242a merge with crew-stable 2009-01-12 09:13:45 +01:00
Bernhard Leiner
bf4052120f mq: make qnew patch format consistent with qrefresh (issue1457) 2009-01-12 09:12:35 +01:00
Dirkjan Ochtman
7898fef4da merge with crew-stable 2009-01-06 10:33:57 +01:00
Jason Orendorff
500c43b1e4 mq: don't warn about ambiguous patch name when using patch index (issue1439) 2009-01-06 10:30:22 +01:00
Benoit Boissinot
722aaa1329 merge with crew 2009-01-04 21:49:37 +01:00
Patrick Mezard
c8f0bb9bb7 mq: drop copy records when refreshing regular patches (issue1441)
Copy information was saved in a common loop, then refined in a git-only block.
The problem was the latter did filter out renames occuring in the current
patch and irrelevant to commit. In the non-git case, copy records still existed
in the dirstate, referencing removed files, making the commit to fail. Git and
non-git copy handling paths are now separated for simplicity.

Reported by Gary Bernhardt
2009-01-04 21:32:40 +01:00
Martin Geisler
23608038bf lowercase help output
Changes docstrings to begin with a lowercase word. Only docstrings
used in help output is changed.

Scripts are not expected to grep the output of 'hg help' so this
change should pose no problem with regard to the compatibility rules.
2009-01-03 17:15:15 +01:00
Martin Geisler
a88ad2d84e mq, i18n: mark strings for translation 2009-01-03 16:15:11 +01:00
Brendan Cully
2a3d6b72af mq: add --mq option to some commands
This causes them to operate on the queue repository as qcommit does, and
is nicer than hg -R $(hg root)
2008-12-23 09:46:40 -08:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Martin Geisler
692fa1ab13 Merge with stable 2010-01-22 17:15:58 +01:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Patrick Mezard
0972f8c158 mq: qdiff with the same diff options than qrefresh (issue1350)
Specifically, if current patch is a git patch and mq.git=keep, diff in git
mode.
2010-01-01 21:49:05 +01:00
Patrick Mezard
071f2dab4e mq: upgrade to git patch when necessary (issue767) 2010-01-01 21:21:34 +01:00
Patrick Mezard
9bddfaea09 Merge with crew-stable 2010-01-01 20:52:05 +01:00
Patrick Mezard
723e585611 mq: untangle git patch detection 2009-12-29 16:00:29 +01:00
Brendan Cully
cf56fc8fc1 mq: filter out empty commit messages in qfold 2008-12-01 20:10:02 -08:00
Brendan Cully
d745a27d99 mq: drop copy sources removed during qfold
(see issue1405)
2008-12-01 20:09:10 -08:00
Benoit Boissinot
22d9484189 Catch both IOError and OSError, fix regression introduced by 0018648194a9 2008-11-26 18:23:35 +01:00
Matt Mackall
c163f654f6 Merge with crew 2008-11-25 16:24:22 -06:00
Brendan Cully
02f74c1e7a mq: recover more gracefully from interrupted qrefresh (issue1216) 2008-11-23 18:08:19 -08:00
Brendan Cully
52891625ce mq: use atomictempfiles during patch refresh 2008-11-23 16:07:47 -08:00
Brendan Cully
d967180a6e mq: create patch header class to abstract header manipulation 2008-11-22 14:04:42 -08:00
Brendan Cully
63fa2faa43 mq: gracefully abort qpush/qgoto to guarded patch (issue1186) 2008-11-23 00:44:31 -08:00
Matt Mackall
4e3875be62 update help on git diffs 2008-11-18 15:35:34 -06:00
Dirkjan Ochtman
2f6d26d640 patch: turn patch.diff() into a generator
This should even be a little faster than passing in an fp argument.
2008-11-03 16:48:23 +01:00
Dirkjan Ochtman
4af26a1f84 help: commands supporting --git point to the gitdiffs topic (issue1352) 2008-11-03 16:31:47 +01:00
Dirkjan Ochtman
76c4ba2df5 mq: reflow qnew help, add help for options 2008-11-03 16:30:21 +01:00
Brendan Cully
05dded9051 mq: use cmdutil.matchfiles instead of match for qnew -f.
Closes issue1368.
2008-10-30 12:38:24 -07:00
Benoit Boissinot
ea7fe6dacc remove unused variables 2008-10-28 19:25:26 +01:00
Benoit Boissinot
311e4870b2 use our urlopener (proxy handling, etc) instead of urllib 2008-10-27 21:50:16 +01:00
Matt Mackall
e564d351f3 extensions: use new wrapper functions 2008-10-22 17:34:52 -05:00
Matt Mackall
bebeb261d5 findcmd: have dispatch look up strict flag 2008-10-22 17:34:08 -05:00
Dirkjan Ochtman
f5ea74b223 clean up trailing spaces, leading spaces in C 2008-10-20 14:57:04 +02:00
Mads Kiilerich
905ce16584 mq: Fix --qrefresh --short to work with --exclude and --include
pmezard expects
	hg qref -s -X b
to apply the -X to the list of files in the patch, and thus remove b from the
patch.
That's how it worked before c302ef4372b2. That change seemed sensible, but it
wasn't...

mpm says
	(17:22:30) pmezard_: kiilerix1: do you mean that -X should be forbidden with -s ?
	(17:22:54) pmezard_: kiilerix1: and --include too
	(17:23:03) mpm: No because you should be able to say hg qref -s foo* -X foo-bar
so mpm expects
	hg qref -s -X b *
to apply the -X to the list of files in the working directory, and thus don't
include b in the patch

This patch tries to make both usecases work by creating a matchfn which uses
the include/excludes but not the filelist.
2008-10-19 16:31:24 +02:00
Brendan Cully
428ac5338a mq: heavy rearrangement of qnew to make it recover reliably from errors.
Closes issue1269.
2008-10-18 21:52:22 -07:00
Brendan Cully
c935fe6e01 mq: abort qnew -f if any file in an explicit list cannot be read 2008-10-18 20:45:53 -07:00
Brendan Cully
eeb6237595 mq: make qimport -f work properly. Closes issue1255.
From Bernhard Leiner.
2008-10-18 17:29:45 -07:00
Brendan Cully
08cb02aa5a mq: let qimport read patches from URLs 2008-10-18 16:40:01 -07:00
Brendan Cully
cc98fdf26c mq: do not invoke editor until just before patch creation. Closes issue1346. 2008-10-18 16:33:10 -07:00