Commit Graph

274 Commits

Author SHA1 Message Date
Alexander Solovyov
b4af7f7817 cmdutil: cleanup imports 2010-05-27 22:50:04 +03:00
Peter Arrenbrecht
10bda79606 rename: make --after work if source is already in R state
I routinely want to use `hg addrem` and then fix up missed renames
manually using `hg mv -A`. This patch allows me to record such
renames from a source in state R to a target in state A.
2010-05-26 16:16:47 +02:00
Matt Mackall
a02b5a5fd1 commands: initial audit of exit codes
bisect: clarify None return
bundle: return 1 on no changes
clone: return result code
copy: limit errors to 0/1
commit: return 1 on no changes
forget: return 1 on errors
grep: return 1 if no match found
remove: return 1 on errors
resolve: return 1 if something fails to resolve
rollback: return 1 if no rollback data
2010-05-15 17:48:49 -05:00
Steve Losh
cbd3276a2b cmdutil: Warn when trying to copy/rename --after to a nonexistant file.
Currently running 'hg rename --after foo.txt bar.typo' is a silent no-op.  This patch adds a warning.  It also updates the copy and rename tests.

No actual functionality is changed.

fixes issue 1822
2010-05-01 18:39:40 -04:00
Yuya Nishihara
539b379b8c log: add --stat for diffstat output
log --stat shows diffstat in place of patch output.
2010-04-01 00:35:12 +09:00
David Greenaway
70b803a04d Move 'findrenames' code into its own file.
The next few patches will increase the size of the "findrenames"
functionality. This patch simply moves the function into its own
file to avoid clutter building up in 'cmdutil.py'.
2010-04-03 11:58:16 +11: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
Nicolas Dumazet
2e5722b300 log: remove useless condition
for "copied" to be not None, it requires follow=True
2010-04-23 15:24:11 +09:00
Matt Mackall
399ebe1c0f Merge with stable 2010-04-19 17:00:02 -05:00
Yuya Nishihara
b7e5bbb3f3 remoteui: copy http_proxy settings
http_proxy settings of current repo's .hg/hgrc should be available
on remoteui, so that the httprepo can use them when pulling via http.
2010-04-08 00:13:33 +09:00
Martin Geisler
608d0cbf81 cmdutil: do not translate trivial string 2010-04-05 01:00:14 +02:00
Brodie Rao
3a2a2b8869 cmdutil: make use of output labeling in changeset_printer 2010-04-02 15:22:07 -05:00
Matt Mackall
6e515e4e5d progress: drop extra args for pos=None calls (issue2087) 2010-03-17 18:15:16 -05:00
Martin Geisler
652e04c99c progress: use a verb in present participle 2010-03-15 18:40:00 +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
Benoit Boissinot
7c20de57d6 addremove: avoid fetching data again and again 2010-03-08 00:01:12 +01:00
Benoit Boissinot
467b4c41ef addremove: add progress support for similarity search 2010-03-08 00:00:03 +01:00
Benoit Boissinot
fe5ad60ee3 addremove: atomically update the dirstate
In case someone hits ^C during the similarity search, properly rollback
2010-03-07 23:59:28 +01:00
Brodie Rao
892ba5a830 remove unused imports 2010-02-14 01:52:31 -05: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
Patrick Mezard
4b42e59a7a util: make spawndetached() handle subprocess early terminations
The file-based synchronization introduced by 670de588e29e hangs when the child
process fails before terminating the handshake, which the previous pipe-based
version handled correctly. To fix this, the parent polling loop was fixed to
detect premature terminations of the child process.
2010-02-06 16:50:00 +01:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
cd3ef170f7 Merge with stable 2010-01-19 22:45:09 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Patrick Mezard
b47d7635f5 templatekw: fix extras, manifest and showlist args (issue1989)
Removing the explicit parameters from keywords signature is easier than copying
and reproducing the original argument list.
2010-01-18 22:59:32 +01:00
Patrick Mezard
965c2821fb Merge with crew-stab le 2010-01-15 10:38:11 +01:00
Patrick Mezard
b5602adbcc cmdutil: expand style paths (issue1948)
Fix suggested by Andrea Riciputi <andrea.riciputi@gmail.com>
2010-01-15 09:50:52 +01:00
Patrick Mezard
052695b2e4 cmdutil: hide child window created by win32 spawndetached()
Hiding the child process window is not strictly necessary but it avoids opening
an empty shell window when running hg serve as well as a task in the task bar.
The window is hidden after the process is already started causing a single
flicker.
2010-01-10 18:13:34 +01:00
Patrick Mezard
48eee05938 Find right hg command for detached process
On Windows, Mercurial can be run from the python script of from a frozen
executable. In the first case, we have to call the python interpreter since the
script is not executable. Frozen executable can be called directly.

Fix 3/3 for issue421
2010-01-06 21:11:58 +01:00
Patrick Mezard
9c0f70e3a8 cmdutil: replace unix pipe handshake with file lock
The pipe handshake cannot be implemented with Windows detached process, which
disables handle inheritance.

Fix 2/3 for issue421
2010-01-06 21:11:58 +01:00
Dirkjan Ochtman
0513f13503 cmdutil: copy auth section in remoteui
This allows me to specify an auth section in a .hg/hgrc instead of just
a global or user-level hgrc.
2009-12-10 12:31:21 +01:00
Nicolas Dumazet
bf5cba2457 cmdutil.service: do not _exit(0) in the parent process
The fact that a parent process spawns a daemon does not necessarily means that
it is the only think it has to do. This was forcing since e8efd88001e7 inotify
processes launched implicitely to exit prematurely:
when no inotify server was running, "hg st" for example would only launch a
inotify server, _exit(0) and thus would not return file statuses.

This changeset adds a test for implicitely launched inotify processes.
Change to output of test-inotify-1208 is correct: it reflects the normal
error message of "hg st" when not dying during "hg inserve" daemon creation.
2009-11-17 15:00:00 +09:00
Dirkjan Ochtman
78e70cd53d cmdutil: fix bug in finddate() implementation 2009-10-30 09:54:39 +01:00
Dirkjan Ochtman
c47d609475 merge changes from mpm 2009-10-30 09:53:39 +01:00
Matt Mackall
4d8e4508a9 walkchangerevs: drop ui arg 2009-10-29 19:03:16 -05:00
Matt Mackall
caf5c5ecca walkchangerevs: reset cache between windows 2009-10-29 19:03:13 -05:00
Matt Mackall
de712b58f9 walkchangerevs: move 'add' to callback
Now walkchangerevs is a simple iterator over contexts
2009-10-29 17:07:51 -05:00
Steve Borho
ab6b033d40 cmdutil: update finddate()
walkchangerevs() now returns contexts, does not take a cache func.
2009-10-28 22:47:46 -05:00
Matt Mackall
74ca11743b Merge with crew 2009-10-27 17:14:19 -05:00
Matt Mackall
0366236cf5 walkchangerevs: internalize ctx caching 2009-10-27 17:01:32 -05:00
Matt Mackall
67e7c0b434 walkchangerevs: yield contexts 2009-10-25 18:43:59 -05:00
Matt Mackall
201d81ac28 walkchangerevs: kill window step of iterator 2009-10-25 18:43:58 -05:00
Matt Mackall
69f8478d8c walkchangerevs: pull out matchfn
* * *
imported patch mercurial/commands.py
2009-10-25 18:43:56 -05:00
Adrian Buehlmann
c0985715f7 cmdutil: minor refactoring of changeset_printer._show
- use ctx.branch() instead of directly accessing the extra field "branch"
- move definitions of locals ('extra' and 'branch') down to where they
  are used
2009-10-24 19:01:40 +02:00
Greg Ward
889a9ffb8d cmdutil: changeset_printer: use methods of filectx/changectx.
This allows extensions that modify changeset metadata (e.g.
description) by overriding methods of changectx to get consistent
behavior from all log-like commands, regardless of whether templates
or styles are used. Without this, overriding changectx methods works
if you use styles or templates, but not with default log format.

This meant adding filectx.extra() for consistency with changectx.
2009-10-05 18:17:13 -04:00
Mads Kiilerich
8ff24147fd cmdutil: templating keywords latesttag and latesttagdistance
This can be used for referring to revisions in a reasonable
meaningful, stable and monotonically increasing way, suitable for
releases or builds directly from a repository.

The latest tag is found by searching through untagged ancestors and
finding the latest tagged ancestor based on tag date. The distance is
found from the length of the longest path to the tagged revision.

For example:
  hg log -l1 --template '{latesttag}+{latesttagdistance}\n'
can return
  1.3.1+197

This is mostly work by Gilles Moris <gilles.moris@free.fr>
2009-10-03 18:31:20 +02:00
Nicolas Dumazet
9c19061a7e cmdutil: service: add an optional runargs argument to pass the command to run
This would be necessary for inotify launching its server: the initial command
is a standard 'hg st'/'hg ci'/... but the daemon to run is 'hg inserve'
2009-08-16 11:30:24 +09:00
Dirkjan Ochtman
e00109f7e7 cmdutil: use context objects for walkchangerevs() 2009-08-20 08:34:22 +02:00
Steve Borho
afad34fc2e cmdutil: fall back to filename if glob expand has errors
On Windows, Mercurial tries to glob expand provided filenames as a
convenience to the user. Unfortunately, there are valid filenames
which are not valid glob patterns.  In those cases, we should fallback
to the original provided filename.
2009-07-12 00:46:43 -05:00