Commit Graph

655 Commits

Author SHA1 Message Date
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