Commit Graph

772 Commits

Author SHA1 Message Date
Adrian Buehlmann
2689b8a7ea mq: rename parse_series to parseseries 2011-06-13 11:55:46 +02:00
Adrian Buehlmann
323edaf5bd mq: rename find_series to findseries 2011-06-13 11:54:25 +02:00
Adrian Buehlmann
7ec3827482 mq: rename series_guards to seriesguards 2011-06-13 11:40:27 +02:00
Adrian Buehlmann
6eb8082b17 mq: rename full_series to fullseries 2011-06-13 11:06:11 +02:00
Patrick Mezard
6aaca90508 patch: turn patch() touched files dict into a set 2011-06-11 14:14:11 +02:00
Peter Arrenbrecht
d836ee3cea hg: add opts argument to clone for internal remoteui 2011-06-08 18:24:33 +02:00
Patrick Mezard
f99a853422 localrepo: add savecommitmessage() to write last-message.txt 2011-06-04 15:56:48 +02:00
Idan Kamara
69cc9dd98e mq: no need to make a copy of seriesopts
the command decorator takes care of copying the
options (introduced in a1338167b2ad)
2011-05-30 21:44:03 +03:00
Martin Geisler
57e33178d6 mq: print "'foo' 'bar'", not "['foo', 'bar']" when showing guards
The internal list representation of guards was leaking into the
output. The guards were always printed using repr(guard) and that
style was kept.

When "hg qguard -l" prints several guards for a patch, it does so by
joining the names with " " and that style was used for the error
messages too.
2011-05-31 08:47:16 +02:00
Idan Kamara
1c58f33fac mq: allow --mq for qrecord 2011-05-27 17:49:54 +03:00
Matt Mackall
c6e850b04b context: make forget work like commands.forget
Switch users of wctx.delete(..., False) to forget.
2011-05-26 17:15:35 -05:00
Matt Mackall
97c6e7b48d dirstate: rename forget to drop
It has substantially different semantics from forget at the command
layer, so change it to avoid confusion.

We can't simply combine it with remove because we need to explicitly
drop non-added files in some cases like commit.
2011-05-26 17:15:35 -05:00
Idan Kamara
91b788592f record: check patch name is valid before prompting in qrecord 2011-05-24 19:17:02 +03:00
Idan Kamara
9f1caed9d1 mq: use checkpatchname
This also fixes a bug where qrename would allow
renaming a patch to a reserved name.
2011-05-24 19:16:51 +03:00
Idan Kamara
d59ad12260 mq: wrap patch file name checks in a function 2011-05-24 19:16:51 +03:00
Idan Kamara
e6848b9ffb mq: strip all leading slashes from url when importing
When trying to import a url that ends with a slash
os.path.basename() would return an empty string. So
when seeing a leading slash, remove it and infer the
patch name from the remaining url.

e.g. `hg qimport http://paste.pocoo.org/raw/xxx/`
deduced '.' to be the patch name. Now we'll deduce 'xxx'.
2011-05-20 21:20:24 +03:00
Idan Kamara
34655369cc mq: check patch name is valid before reading imported file 2011-05-20 21:19:33 +03:00
Patrick Mezard
78738c3822 patch: remove patch.patch() cwd argument 2011-05-19 22:44:01 +02:00
Patrick Mezard
42f681d4d9 patch: add lexists() to backends, use it in selectfile()
At this point, all applydiff() filesystem calls should pass through fsbackend.
2011-05-17 23:46:38 +02:00
Matt Mackall
0832007f60 scmutil: drop aliases in cmdutil for match functions 2011-05-13 14:58:24 -05:00
Matt Mackall
cf07129983 scmutil: move revsingle/pair/range from cmdutil
This allows users at levels below the command layer to avoid import loops.
2011-05-13 14:06:28 -05:00
Martin Geisler
0edbd90511 mq: use cmdutil.command decorator 2011-05-12 14:25:08 +02:00
Matt Mackall
81206f7383 check-code: complain about set.isdisjoint 2011-05-08 11:39:24 -05: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
Patrick Mezard
2ab321beb7 mq: explicitly updatedir() even if patch() fails
It already works that way in practice, and we intend to merge updatedir() into
patch().
2011-05-08 17:48:29 +02:00
Idan Kamara
707c7fe40d mq: allow to qpop/push with a dirty working copy (issue2780)
It's safe to do so if the sets of changed files in the
working copy and patches are disjoint.
2011-05-06 19:55:46 +03:00
Idan Kamara
28e4be21c2 mq: don't hide the patch module 2011-05-06 19:03:45 +03:00
Idan Kamara
ea58266774 mq: loosen except clause when reading patch headers 2011-05-06 18:45:12 +03:00
Idan Kamara
7489f95c93 mq: add a 'mq()' revset predicate that returns applied mq csets 2011-05-06 16:07:35 +03:00
Idan Kamara
64876670a4 mq: don't suggest to refresh when qpushing with no applied patches 2011-05-04 23:12:23 +03:00
Matt Mackall
bf126992e1 merge with stable 2011-05-03 22:04:23 -05:00
Kevin Bullock
a19d7654b7 mq: strip extra whitespace from node ids in header (issue2790)
This makes `hg qpush --exact` work with patches created by `hg export`.
2011-05-03 11:46:02 -05:00
timeless
4f44952021 remove unused variables 2011-05-01 17:20:40 +02:00
Dan Villiom Podlaski Christiansen
511c941422 prevent transient leaks of file handle by using new helper functions
These leaks may occur in environments that don't employ a reference
counting GC, i.e. PyPy.

This implies:
 - changing opener(...).read() calls to opener.read(...)
 - changing opener(...).write() calls to opener.write(...)
 - changing open(...).read(...) to util.readfile(...)
 - changing open(...).write(...) to util.writefile(...)
2011-05-02 10:11:18 +02:00
Idan Kamara
856702f469 mq: add '.' and '..' to list of forbidden patch names
When an empty string is being passed to normname
it would return '.' causing checkfile() to always
return that a patch with that name exists.
2011-04-29 22:21:13 +03:00
timeless@gmail.com
4f2e8b67dc mq: fix qselect help for qguard 2011-03-29 16:45:23 +03:00
Stefano Tortarolo
d1da6cf615 mq: fix typo in docstring 2011-03-15 14:55:16 +01:00
Idan Kamara
6862ebb98f mq: be more explicit on invalid patch name message 2011-04-29 22:21:13 +03:00
Matt Mackall
3b61150db3 merge with stable 2011-04-30 03:44:31 -05:00
Patrick Mezard
5457fb5aec strip: make it clear that --force discards changes (issue310) 2011-04-29 14:56:23 +02:00
Pierre-Yves David
7b3f2de931 mq: prevent traceback when qfinish patches not in series.
When mq status entry referencing a patches that is not in series  `hg qfinish
-a` used to issue a traceback. This states is inconsistent but might happen
regularly when people misuse hg up -mq.

This changeset prevent hg from crashing. The faulty entry is finished anyway and
a warning is issued.
2011-04-25 14:03:12 +02:00
Adrian Buehlmann
cf126bb7dd move opener from util to scmutil 2011-04-20 19:54:57 +02:00
Matt Mackall
a8dd64dcb0 misc: replace .parents()[0] with p1() 2011-04-04 16:21:59 -05:00
Martin Geisler
0b9696bd15 merge with stable 2011-03-29 16:25:48 +02:00
Martin Geisler
f881346b4c mq: do not let qrefresh write bad patch 2011-03-13 16:18:46 +01:00
Martin Geisler
3334dc51b6 mq: forbid commit of merge involving mq patches 2011-03-02 14:09:06 +01:00
Matt Mackall
d0fa4e0180 mq: fix qpush recursion in _findtags when status file is wrong (issue2664)
test from timeless to guard against regressing this
2011-02-28 17:41:40 -06:00
Pierre-Yves David
fa5d7584dd mq: gracefully handle malformated status file
This patch prevent mq to crash when .hg/patches/status contains Malformed lines
(without ":"). Blank lines are ignored and other malformed lines issue a
warning.
2011-02-11 13:10:39 +01:00
André Sintzoff
d724f20ddb mq: remove undo after a qimport 2011-02-15 20:02:52 +01: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
Steve Borho
4d71f24e4c merge with stable 2011-02-14 14:12:48 -06:00
Afuna
acdbba3dff mq: catch attempt to qpush to an earlier patch (issue2587)
We can't assume that all pushable patches early in the series have already been
applied. If a hg qselect is done while you already have patches applied, some
patches with guards may now be pushable, even though they come earlier in the
series.

So instead of checking only applied patches, explicitly check where we are in
the series against the position of the patch we want to qpush to.
2011-02-12 16:08:41 +08:00
Patrick Mezard
7700d1350b mq: factor out push conditions checks
Some extensions (e.g. hgsubversion) completely override push command. Because
extensions load order is unspecified, if hgsubversion loads before mq, mq
checks about not pushing applied patches will be bypassed. Short of finding a
way to fix load order, extracting the checking logic will allow
hgsubversion-like extensions to run the check themselves.
2011-01-31 22:16:33 +01:00
Matt Mackall
6c9be0381b mq: avoid using revlog.nodemap unnecessarily 2011-01-11 17:06:07 -06:00
Adrian Buehlmann
721e368ac1 rename util.unlink to unlinkpath 2011-01-02 19:34:41 +01:00
Steve Borho
4ef6c62600 mq: record more data in patchheader class (no behavior changes)
* parse branch and nodeid header lines
* remember the line number where diffs started

Combined, these make mq.patchheader() very useful for parsing and
preserving a patch header through edits. TortoiseHg will use the
nodeid and parent to display these header datums in the graph when
patches are unapplied, and uses diffstartline to parse patch files
using record.parsepatch().
2010-12-31 17:09:38 -06:00
Matt Mackall
49ec3df937 merge with stable 2011-01-01 18:42:04 -06:00
Jacek Sowiński
d5b7a5d84f strip: typo bugfix related to '--nobackup -> --no-backup' rename (issue2377)
'--no-backup' in cmdline means *'no_backup'* in code'
2010-12-31 15:14:51 +01:00
Kevin Bullock
5c61f5f136 mq: update .hgsubstate if subrepos are clean (issue2499)
This patch prevents MQ from creating an inconsistent subrepo state. If
the .hgsub file has been changed, and none of the subrepos have
uncommitted changes, creating or updating a patch (using qnew, qrefresh,
or qrecord) will update .hgsubstate accordingly.

If any subrepos _do_ have uncommitted changes, qnew/qrefresh/qrecord
will abort.

Thanks to pmezard for proposing this solution.
2010-12-07 22:14:43 -06:00
Kevin Bullock
ed11f126c8 backout 0880564992de 2010-12-07 22:14:43 -06:00
Kevin Bullock
79f5039252 mq: ignore subrepos (issue2499)
If MQ allows modifying .hgsub or .hgsubstate in a patch, it can easily
lead to an inconsistent subrepo state. This patch prevents qrefresh from
adding any modifications to .hgsub or .hgsubstate to a patch. The user
is warned that these files are not included in the patch.

The tests test both the slightly irrational and the pathological cases.
2010-11-16 13:06:07 -06:00
Martin Geisler
02c90a666d qnew: distinguish between existing file and directory (issue2464) 2010-10-29 14:06:06 +02:00
Martin Geisler
3bd0773df5 qnew: give better feedback when doing 'hg qnew foo/' (issue2464) 2010-10-29 15:25:21 +02:00
Patrick Mezard
1ba47f6d3d mq: qrename should not touch the dirstate if src is untracked (issue2460) 2010-10-28 22:04:33 +02:00
Thomas Arendsen Hein
6fd4e6aaec coding style: fix gratuitous whitespace after Python keywords 2010-12-03 11:30:45 +01:00
Matt Mackall
8e2f7d14eb merge with stable 2010-11-22 13:11:46 -06:00
Steve Losh
72ee3af1d8 mq: add an '-e/--exact' option to qpush
This patch adds an '--exact/-e' option to qpush that will try to push the
patches in the correct location in the DAG.  Specifying this option does the
following:

* If --move is specified, abort. It makes no sense to move a patch to the front
  of the queue and try to apply it to its parent, because its parent is one of
  the patches we just moved it in front of!
* If patches are already applied, abort. We don't want patch changesets
  scattered throughout the DAG.
* If local changes are present, abort unless --force is used, as usual.
* Find the first patch we're going to push (if we're pushing multiple patches
  with a target or --all).
* If that patch doesn't have a parent, abort, obviously.
* If the parent doesn't exist in the repo, abort.  Something is wrong.
* Update to the parent, then continue pushing the patches as normal.
2010-11-17 21:18:44 -05:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Martin Geisler
8e20190ebb mq: fix comment to reflect change in 900672e7d1f7 2010-11-17 09:06:38 +01:00
Kevin Bullock
fb0785e3d1 mq: clean up unused variable in qrefresh
Removes the unused variable `aa2` that holds the list of deleted files
returned from repo.status().
2010-11-16 13:06:04 -06:00
Nicolas Dumazet
f4ae25089e mq: use sets instead of lists for speed
The code eventually converts data through sets to ensure unicity:
do it earlier to allow faster __contains__ lookups and avoid
`del l[l.index(x)]` kind of code.
2010-11-07 22:03:28 +09:00
Martin Geisler
41f0f0af10 mq: expand 'repo' -> 'repository' in error message 2010-10-26 18:01:35 +02:00
Martin Geisler
79f93adec2 mq: mark strings that should not be translated 2010-10-26 17:59:21 +02:00
timeless
788c88e3ef qrestore: trying to improve the English 2010-10-26 14:41:58 +03:00
Wagner Bruna
ac73474eb7 mq: mark string for i18n 2010-10-20 12:29:55 -02:00
Wagner Bruna
e934c64ad0 strip: support revision sets 2010-10-18 18:31:38 -02:00
Erik Zielke
69888281fd mq: switched to `` around * * *
So it can be parsed by rst.
2010-10-18 14:37:50 +02:00
Augie Fackler
42c8b2cf07 termwidth: move to ui.ui from util 2010-10-10 10:06:36 -05:00
Augie Fackler
35723d1610 strip: add --keep flag to avoid modifying wc during strip
Fixes issue1564.
2010-10-09 11:02:11 -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
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
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
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
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
Erik Zielke
c732a9771b Use note admonition 2010-09-22 16:23:55 +02: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
Patrick Mezard
614db673f4 Merge with stable 2010-09-20 22:29:13 +02: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
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
Patrick Mezard
de8b1fa045 mq: add newline after qfold warning 2010-09-10 22:36:04 +02:00
Martin Geisler
5f46f16fb7 Lowercase error messages 2010-08-29 22:37:58 +02: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
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
Matt Mackall
eef168b604 merge with stable 2010-08-19 10:25:41 -05: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
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
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
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
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