Commit Graph

3087 Commits

Author SHA1 Message Date
Adrian Buehlmann
6eb8082b17 mq: rename full_series to fullseries 2011-06-13 11:06:11 +02:00
Matt Mackall
aa85ea1250 hg: split peer and repo lookup tables 2011-06-11 14:14:52 -05:00
Patrick Mezard
3680e66462 patch: generalize the use of patchmeta in applydiff()
- Add patchmeta.copy() and emit copies from iterhunks. Modifying patchmeta
  instances in applydiff() makes things simpler.
- Rename selectfile() into makepatchmeta(). It is responsible for creating
  patchmeta for regular patches.
- Pass patchmeta objects to patchfile() directly

patchmeta instances were associated with git patches, for regular patches we
had to pass additional variables to tell the patch intent to patchfile().
Instead, we generate patchmeta for regular patches and pass them. This will
also help with patch filtering by matcher objects.
2011-06-11 14:17:25 +02:00
Patrick Mezard
6aaca90508 patch: turn patch() touched files dict into a set 2011-06-11 14:14:11 +02:00
Matt Mackall
efecb99535 hg: change various repository() users to use peer() where appropriate
This gets all the easy cases (peers that aren't also used as repositories).
2011-06-10 11:43:38 -05: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
2b3f15b0fa color: check if ui is already a subclass of colorui before wrapping it
since it's possible to reuse the ui object (see 6772a32edec7)
between dispatch calls, the ui might have been wrapped already.

we could probably move this test up a bit but leaving it here
allows updates to take effect by extstyles() and configstyles().
2011-06-02 00:43:34 +03:00
Idan Kamara
02f21a70dc util: add helper function isatty(fd) to check for tty-ness 2011-06-02 00:43:34 +03:00
Peter Arrenbrecht
421dba9540 color: fix --color=always when output is piped
Also restructures the mode determination as discussed on IRC.
I tried to simplify the code too, while keeping the original
semantics except for the case of --color=always.
2011-05-25 18:48:00 +02:00
Martin Geisler
af8a35e078 check-code: flag 0/1 used as constant Boolean expression 2011-06-01 12:38:46 +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
Patrick Mezard
d4b7db6294 patch: use temporary files to handle intermediate copies
git patches may require copies to be handled out-of-order. For instance, take
the following sequence:

  * modify a
  * copy a into b

Here, we have to generate b from a before its modification. To do so,
applydiff() was scanning for copy metadata and performing the copies before
processing the other changes in-order. While smart and efficient, this approach
complicates things by handling file copies and file creations at different
places and times. While a new file must not exist before being patched a copied
file already exists before applying the first hunk.

Instead of copying the files at their final destination before patching, we
store them in a temporary file location and retrieve them when patching. The
filestore always stores file content in real files but nothing prevents adding
a cache layer. The filestore class was kept separate from fsbackend for at
least two reasons:

- This class is likely to be reused as a temporary result store for a future
  repository patching call (entries just have to be extended to contain copy
  sources).

- Delegating this role to backends might be more efficient in a repository
  backend case: the source files are already available in the repository itself
  and do not need to be copied again. It also means that third-parties backend
  would have to implement two other methods. If we ever decide to merge the
  filestore feature into backend, a minimalistic approach would be to compose
  with filestore directly. Keep in mind this copy overhead only applies for
  copy/rename sources, and may even be reduced to copy sources which have to
  handled ahead of time.
2011-05-27 21:50:10 +02:00
Patrick Mezard
e6f284be06 patch: refactor file creation/removal detection
The patcher has to know if a file is being created or removed to check if the
target already exists, or to actually unlink the file when a hunk emptying it
is applied. This was done by embedding the creation/removal information in the
first (and only) hunk attached to the file.

There are two problems with this approach:

- creation/removal is really a property of the file being patched and not its
  hunk.

- for regular patches, file creation cannot be deduced at parsing time: there
  are case where the *stripped* file paths must be compared. Modifying hunks
  after their creation is clumsy and prevent further refactorings related to
  copies handling.

Instead, we delegate this job to selectfile() which has all the relevant
information, and remove the hunk createfile() and rmfile() methods.
2011-05-27 21:50:09 +02:00
Idan Kamara
1c58f33fac mq: allow --mq for qrecord 2011-05-27 17:49:54 +03:00
Adrian Buehlmann
63c4bf2469 rebase: add option --tool/-t for 'pull --rebase'
This makes 'pull --rebase' consistent with the merge command, which already
provides that option to control the merges
2011-05-27 10:03:29 +02:00
Idan Kamara
a7eca9ebe7 record: fix options placeholder 2011-05-26 19:00:47 +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
67e075c860 record: alias qrecord to qnew -i/--interactive 2011-05-24 19:17:22 +03:00
Idan Kamara
dcebc5aaa6 record: add qrefresh -i/--interactive
interactively select changes to refresh
2011-05-24 19:17:19 +03:00
Idan Kamara
d4250f0ae0 record: add an option to backup all wc modifications
Also, don't create a backup dir if we have no files to backup.

This is essential for qrefresh --interactive. Since we can't
select individual files to qrefresh without eliminating already
present changes, we have to backup all changes in the working
copy to avoid refreshing unaccepted hunks.

(thanks to Patrick for the idea)
2011-05-24 19:17:04 +03: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
3d12bdbaa8 graphlog: remove unused arg from _wrapcmd 2011-05-23 23:22:47 +03:00
Idan Kamara
1e15ba1cc3 record: use cmdutil.command decorator 2011-05-22 16:10:03 +03:00
Idan Kamara
9966d26707 record: suggest the right command when running non interactively 2011-05-22 16:10:02 +03:00
Idan Kamara
10ac959d0b patchbomb: pass --git argument to diffstat 2011-05-20 21:04:45 +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
Matt Mackall
66805ccfed revlog: stop exporting node.short 2011-05-21 15:01:28 -05:00
Patrick Mezard
78738c3822 patch: remove patch.patch() cwd argument 2011-05-19 22:44:01 +02:00
Patrick Mezard
2bda8cbde2 patch: add a workingbackend dirstate layer on top of fsbackend
_updatedir() is no longer used by internalpatch()

The change in test-mq-missingfiles.t comes from workingbackend not considering
the missing 'b' file as changed, thus not calling addremove() on it.
2011-05-18 23:48:17 +02:00
Patrick Mezard
514ff73602 patch: set desired mode when patching, not in updatedir()
This patch and the following aim at merging _updatedir() actions into
_applydiff().
2011-05-18 23:48:13 +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
Patrick Mezard
431a9d156a patch: extract fs access from patchfile into fsbackend
Most filesystem calls are already isolated in patchfile but this is not enough:
renames are performed before patchfile is available and some chmod calls are
even done outside of the applydiff call. Once all these calls are extracted
into a backend class, we can provide cleaner APIs to write to a working
directory context directly into the repository.
2011-05-17 23:46:15 +02:00
Javi Merino
c3168645be extdiff: grammar "allows to" -> "allows one to"
The verb to allow requires a direct object.

Lintian, a Debian tool to find common mistakes, reported it. I'm not a
native english speaker but I think this is correct.
2011-05-15 18:00:22 +01: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
Cédric Krier
47d1def71c hgcia: Handle URL like in notify (issue2406)
The URL must be composed with baseurl and webroot like in notify
2011-05-11 18:18:50 +02:00
Adrian Buehlmann
25e3fc2c76 graphlog: use cmdutil.command decorator 2011-05-12 20:27:35 +02:00
Adrian Buehlmann
31d8f478f5 purge: use cmdutil.command decorator 2011-05-12 20:14:42 +02:00
Adrian Buehlmann
8200df2be6 patchbomb: use cmdutil.command decorator 2011-05-12 18:27:05 +02:00
Adrian Buehlmann
846e72e877 transplant: use cmdutil.command decorator 2011-05-12 17:50:07 +02:00
Adrian Buehlmann
5a15b69857 rebase: use cmdutil.command decorator 2011-05-12 17:09:56 +02:00
Martin Geisler
249808f0a8 keyword: use cmdutil.command decorator 2011-05-12 14:31:07 +02:00
Martin Geisler
1a6e3991ac gpg: use cmdutil.command decorator 2011-05-12 14:31:01 +02:00
Martin Geisler
0edbd90511 mq: use cmdutil.command decorator 2011-05-12 14:25:08 +02:00
Matt Mackall
cf2d9729ae cmdutil: make_filename -> makefilename 2011-05-10 16:08:46 -05:00
Matt Mackall
e53ca7b463 cmdutil: bail_if_changed to bailifchanged 2011-05-10 16:08:46 -05:00
Martin Geisler
bb9f7dd3c5 progress: add speed format
This is not enabled by default, but the user can add it by setting
progress.format.

We might want to let the estimate format output a speed instead of an
ETA if there is not total. Currently estimate just returns the empty
string in that case.
2011-05-09 16:41:45 +02:00
Adrian Buehlmann
b0bff1062c rename util.is_exec to isexec 2011-05-08 20:45:47 +02:00
Adrian Buehlmann
4163cf2e6f rename util.find_exe to findexe 2011-05-08 20:35:46 +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
f63ca22ee0 record: unconditionally update the working dir after patching 2011-05-08 17:48:29 +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
Patrick Mezard
5f00d486d3 progress: remove useless statement left by 3e633b77d339 2011-05-07 17:25:12 +02: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
Matt Mackall
ac5d056e58 merge with abuehl 2011-05-06 13:04:24 -05:00
Matt Mackall
2f01bc4c58 merge with stable 2011-05-06 11:51:18 -05:00
Adrian Buehlmann
5573dff691 rename util.os_link to oslink 2011-05-06 15:34:34 +02:00
Adrian Buehlmann
e94d06bb79 rename explain_exit to explainexit 2011-05-06 15:31:09 +02:00
Adrian Buehlmann
0e6715fa28 rename util.set_binary to setbinary 2011-05-06 15:25:35 +02:00
Adrian Buehlmann
c415440828 rename util.set_flags to setflags 2011-05-06 15:22:31 +02:00
Idan Kamara
353dfef2b7 transplant: remove unneeded loop over repo in revset 2011-05-06 16:00:48 +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
9afabe8fdd transplant: fix revset doc 2011-05-06 15:37:38 +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
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
Nicolas Dumazet
892f3cacb5 zeroconf: notify the Zeroconf threads when hg exits
Zeroconf launches two threads in the background, and they wait on
Condition objects to exit. We need to call Zeroconf.close() to
release those conditions so that threads can gracefully exit.

This means that an interrupt on the hg process will now gracefully
propagate to the Zeroconf children, fixing that bug which did not
allow us to kill an `hg serve` process.
2011-04-30 19:36:59 +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
Patrick Mezard
2cbeb4b9c6 extdiff: fix broken symlinks handling (issue1909) 2011-04-29 08:04:46 +02:00
Patrick Mezard
95e7147cd4 convert: make filemap prune useless branch closing revs (issue2774)
A branch closing revision only applies if one of its parents belongs to the
branch being closed. Otherwise the filemap can prune it too.
2011-04-20 23:15:18 +02:00
Stefano Tortarolo
e2565790ee rebase: don't mark file as removed if missing in parent's manifest (issue2725) 2011-03-27 13:34:20 +02:00
Martin Geisler
9e82c0f40f patchbomb, help/hgweb: do not refer to config files as hgrc files 2011-04-01 12:14:42 +02: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
Martin Geisler
a0a2144b94 i18n: don't mark trivial string for translation 2011-03-16 17:38:25 +01:00
Martin Geisler
87e06b967c relink: mark abort message for translation 2011-03-16 15:34:45 +01:00
Martin Geisler
ba5898d620 relink: avoid trying to lock the same repo twice 2011-03-16 15:34:10 +01:00
Patrick Mezard
ec6a1a3ed2 convert/svn: fix _iterfiles() output in root dir case (issue2647)
When converting directory additions/replacement with project directory set to
root, _iterfiles() sometimes returned paths starting with a slash making
following svn calls to fail.

I could not reproduce the issue with hand-crafted repositories.

Report and first analysis by Clinton Chau <clinton@clearcanvas.ca>
2011-03-14 21:35:31 +01:00
Brodie Rao
2fb8bf1f24 pager: don't page stderr if it's being redirected (issue2541) 2011-01-04 00:24:34 +11:00
Adrian Buehlmann
62ca9f7af6 color: port to using ctypes (issue2687)
replacing usage of pywin32, which was removed for Mercurial 1.8
2011-03-11 11:14:21 +01:00
Martin Geisler
e450b1ed50 color: don't mention internal function in docstring
The render_text function actually never existed, the docstring
probably meant the render_effects function instead.
2011-03-14 13:54:25 +01:00
Martin Geisler
f881346b4c mq: do not let qrefresh write bad patch 2011-03-13 16:18:46 +01:00
Klaus Koch
b52874b751 graphlog: give meaningful error if more than one file is given 2011-03-13 15:04:13 +01:00
Steve Borho
f61b2a6d58 eol: do not abort when win32text is found, only warn
The win32text extension does not break eol or vice-versa, so it is not a fatal
error to have both of them enabled.  It's just folly.  So spewing warnings in
this condition is preferrable to aborting.  When both extensions are enabled,
the user now sees:

% hg st
the eol extension is incompatible with the win32text extension
win32text is deprecated: http://mercurial.selenic.com/wiki/Win32TextExtension
M hgext/eol.py
2011-03-13 10:03:06 -05:00
Martin Geisler
390c2e4c55 transplant: avoid the word "rebase" when we mean "transplant" 2011-03-13 12:44:35 +01:00
Martin Geisler
459f5e46b7 transplant: explain that changesets are copied, not moved 2011-03-13 12:43:52 +01:00
Martin Geisler
27aa536556 eol: use dirstate methods to clear dirstate
This fixes a race that was observed when status was called before and
after clearing the dirstate.
2011-03-12 12:11:09 +01:00
Georg Brandl
93c5588eaa hgcia: accept "queued." xmlrpc return as success 2011-03-06 11:30:57 +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