Commit Graph

318 Commits

Author SHA1 Message Date
Matt Mackall
bc13e3d384 commit: handle missing newline on last commit comment 2010-10-30 12:13:52 -05:00
Patrick Mezard
a3c9b27eda patch: fix copies when patching over uncommitted changed (issue2459) 2010-10-28 21:25:53 +02:00
Wagner Bruna
7ca1d483b2 cmdutil: mark string for i18n 2010-10-20 12:29:41 -02:00
Augie Fackler
42c8b2cf07 termwidth: move to ui.ui from util 2010-10-10 10:06:36 -05:00
Brodie Rao
ff59218cc1 cat: fix cat without -r, broken by 5089d555cee9
The default revision for revsingle() is now '.' instead of None. This
preserves the behavior of cat prior to it using revsingle().
2010-10-08 14:02:23 -05:00
Matt Mackall
9ccbd76ee4 revsets: introduce revsingle helper
revsingle returns a context for the last revision of the supplied revspec
2010-10-07 18:24:29 -05:00
Matt Mackall
223b7c03b1 revsets: make revpair revsets-aware
revpair returns the first and last members of the computed revset(s)
2010-10-07 18:05:04 -05:00
Patrick Mezard
9679c03c21 Restore lexists() changes lost in d8a989380f8b merge 2010-09-20 22:41:10 +02:00
Patrick Mezard
614db673f4 Merge with stable 2010-09-20 22:29:13 +02:00
Patrick Mezard
e043450e1d rename: do not overwrite existing broken symlinks 2010-09-20 21:46:39 +02:00
Martin Geisler
cb93a10b9b add: recurse into subrepositories with --subrepos/-S flag 2010-09-13 13:09:20 +02:00
Martin Geisler
186cdcc54b add: move main part to cmdutil to make it easier to reuse 2010-09-13 13:09:11 +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
30bd1afde3 subrepos: handle diff nodeids in subrepos, not before
Subversion nodeids are integer revisions.
2010-09-10 22:52:00 +02:00
Martin Geisler
c85f2356e3 subrepos: add function for iterating over ctx subrepos 2010-09-07 16:34:07 +02:00
Martin Geisler
5cb4b1f5eb subrepos: handle modified but uncommitted .hgsub 2010-09-07 16:23:55 +02:00
Martin Geisler
e9c2a20771 diff: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Martin Geisler
839c3422d1 cmdutil: use repo.auditor when constructing match object
This gives the repository control over which nested repository paths
that should be allowed via the custom path auditor.

Since paths into subrepositories are now allowed, dirstate.walk must
now filter away more paths than before.
2010-09-03 12:58:51 +02:00
Martin Geisler
80db87965d Consistently import foo as foomod when foo to avoid shadowing
This is in the style of 1aaceccaf1dc.
2010-08-30 14:38:24 +02:00
Martin Geisler
bfea979db3 util: remove lexists, Python 2.4 introduced os.path.lexists 2010-08-25 16:23:32 +02:00
Matt Mackall
76a1c7b90d merge with stable 2010-08-17 17:44:19 -05:00
Alecs King
057134ed97 log: fix the bug 'hg log --stat -p == hg log --stat'
Before:
    hg log --stat -p -r tip # only show stat

After:
    hg log --stat -p -r tip # show stat _and_ diff
2010-08-13 14:29:30 +08:00
Nicolas Dumazet
32ca03310d cmdutil: code simplification 2010-08-15 23:38:00 +09:00
Nicolas Dumazet
252ff032c2 log: do not --follow file that is deleted and recreated later (issue732)
== What ==

issue732 is only one example of a buggy behaviour, but there are in fact many
intricated cases. For example:

( "o" contains an alive version of the tracked file, "x" does not)

tip - o - o - x - o - o - x ...
   \
    o - o - o - o - x ...
     \     /
      o - o

This repository contains at least two instances of the tracked file, but
when calling "hg log -f file" only the latest one (the one alive in tip)
matters to us.

== How ==

We must extract from the filelog the history of the file instance we're
interested in and discard changes related to other instances of that file.

We see that we're only interested in ancestors(node), and that all
other nodes in the filelog should not be considered.
2010-08-15 23:17:53 +09:00
Martin Geisler
4c4fee151a cmdutil: remove unnecessary parenthesis 2010-08-12 18:00:41 +02:00
Nicolas Dumazet
347d6d7320 log: do not redefine cachefunc in walkchangerevs
The same variable is defined a few blocks earlier. The first phases in
walkchangerevs should in fact fill that cache, and allow faster lookups
in the last phase. Redefining and overriding this cached function, (knowing
that it will be called with the same arguments) defeats the caching purpose.
2010-07-20 14:42:05 +09:00
Martin Geisler
608c008186 cmdutils: fix code style 2010-07-21 09:43:45 +02:00
Nicolas Dumazet
48c3dffac9 log: document the different phases in walkchangerevs 2010-07-20 14:32:33 +09:00
Nicolas Dumazet
13f83afe55 log: slowpath: only walk specified revision range during preparation
Even with --removed, it does not make sense to examine changesets outside
of the revision range that was specified by the user: the last phase only
yields a subset of (revs), preparation phase hence only has to examine
(revs) to fill correctly fncache.
2010-07-20 14:13:33 +09:00
Martin Geisler
f3e224e1d7 cmdutil: fix accidental name clash with revrange function
The revrange function was used further up, and when a local variable
is defined with the same name, the earlier call to revrange becomes a
'local variable used before assignment' error.

The clash was introduced in 3544b3baebb0.
2010-07-19 00:41:41 +02:00
Nicolas Dumazet
8b45506535 log: slowpath: do not read the full changelog
When in the slowpath, we are examining _all_ changesets in revs.
We need to order reads so they happen increasingly for I/O performance.

Increasing windows were used to read changelog backwards in a windowed manner,
reading the changelog forward inside each window. But since no revision range
was specified, it was equivalent to reading the full changelog, even if a
single revision was passed to the commandline.

When --removed is used, we _need_ to scan all changesets, but if we're only
looking for file patterns, this is not necessary and we can stick to
the revspec that was given to us.
2010-07-04 18:07:30 +09:00
Nicolas Dumazet
93f72c67e1 log: remove increasing windows usage in fastpath
The purpose of increasing windows is to allow backwards iteration on the
filelog  at a reasonable cost.
But is it needed?
 - if follow is False, we have no reason to iterate backwards.
   We basically just want to walk the complete filelog and yield all revisions
   within the revision range. We can do this forward or
   backwards, as it only reads the index.
 - when follow is True, we need to examine the contents of the filelog, and to
   do this efficiently we need to read the filelog forward.
   And on the other hand, to track ancestors and copies, we need to process
   revisions backwards. But is it necessary to use increasing windows
   for this?
   We can iterate over the complete filelog forward, stack the revisions, and
   read the reversed(pile), it does the same thing with a more readable code.
2010-07-03 18:11:15 +09:00
Nicolas Dumazet
3ac31c1176 log: refactor: test for ranges inside filerevgen 2010-07-03 18:01:54 +09:00
Nicolas Dumazet
c470caa65c log: refactor: compute the value of last outside of filerevgen 2010-07-03 17:58:48 +09:00
Mads Kiilerich
812bb21f4d log: follow filenames through renames (issue647)
In commands.log a displayer was initialized from
cmdutil.show_changeset() with the initial matchfn (which designates
the specified files which only is correct in the highest revision in
the range). prep() is handed the correct list of files, but
displayer.show() didn't use that list but keept using the original
matchfn.

The matchfn argument to cmdutil.show_changeset() wasn't specified in
other places and is only used in .show(), so now we give the matchfn
as an optional parameter to .show().

We do however still have to detect --patch and --stat from opts in
show_changeset() and let it imply a matchall, but that can now be
overruled with the new .show() matchfn parameter.
2010-06-29 12:12:34 +02:00
Simon Howkins
b6970b73cd heads: fix templating of headers again (issue2130)
(tweaks and test by mpm)
2010-06-24 15:18:47 +01:00
Simon Howkins
f313e6ccd4 cmdutil: only output style header once in non-buffered mode (issue2130) 2010-06-24 15:18:47 +01:00
Matt Mackall
5efb5b5080 revrange: fix up empty query again 2010-06-20 14:21:47 -05:00
Matt Mackall
2d126f9f2e revrange: attempt to parse old-style queries as a first pass 2010-06-19 13:00:01 -05:00
Dirkjan Ochtman
af6b696f0f move working dir/dirstate methods from localrepo to workingctx 2010-06-07 20:03:32 +02:00
Matt Mackall
97e2d2bcdb revset: fix test failure with qfinish 2010-06-04 22:54:43 -05:00
Matt Mackall
5de34fa30a walkchangerevs: allow empty query sets 2010-06-03 18:00:15 -05:00
Matt Mackall
959774dfd8 revset: hook into revrange 2010-06-01 11:18:57 -05:00
Matt Mackall
86ebd43d71 remoteui: move from cmdutil to hg 2010-06-01 11:18:57 -05:00
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