Commit Graph

256 Commits

Author SHA1 Message Date
mason@suse.com
914365e493 Add searching for named branches
named branching is when you identify a head by a tag on an earlier revision.
This patch adds repo.branchlookup for searching through the tree to
find branch tags for heads.

hg update -b tag is added to checkout based on branch tags
hg heads -b is added to print the tag associated with each head
2005-08-14 12:23:45 -08:00
Bryan O'Sullivan
de43775de3 Fix clone when target directory is relative. 2005-08-13 14:41:51 -08:00
Bryan O'Sullivan
dcc0f582eb Fix walk path handling on Windows 2005-08-12 15:06:52 -08:00
Bryan O'Sullivan
52caea4f69 Fix walk code for files that do not exist anywhere, and unhandled types.
Prior to this, a file that did not exist was reported as showing up in
the filesystem, as were files of unsupported types (such as fifos).

Now, an error message is printed and nothing is returned in such cases.

This change also moves the commands.pathto function to the util module,
as the walk code needs it to print non-confusing error messages.
2005-08-12 11:16:58 -08:00
mason@suse.com
5bb002b605 addremove was not correctly finding removed files when given
a list of files to look at.  These end up with a src of 'f' from
walk() but no longer exist on the filesystem.

Index: mine/mercurial/commands.py
===================================================================
2005-08-12 07:12:08 -08:00
mason@suse.com
b44281b503 dirstate walking optimizations
The repo walking code introduces a number of calls to dirstate.map.copy(),
significantly slowing down the walk on large trees.  When a list of
files is passed to the walking code, we should only look at map entries
relevant to the file list passed in.

dirstate.filterfiles() is added to return a subset of the dirstate map.
The subset includes in files passed in, and if one of the files requested
is actually a directory, it includes any files inside that directory tree.

This brings the time for hg diff Makefile down from 1.7s to .3s on
a linux kernel repo.

Also, the diff command was unconditionally calling makewalk, leading
to an extra pass through repo.changes.  This patch avoids the call
to makewalk when commands.diff isn't given a list of patterns, cutting
the time for hg diff (with no args) in half.

Index: mine/mercurial/hg.py
===================================================================
2005-08-12 07:10:21 -08:00
Bryan O'Sullivan
3a382ee2e1 Merge with mpm. 2005-08-09 17:24:38 -08:00
Bryan O'Sullivan
75e6a5bd0e Teach walk code about absolute paths.
The first consequence of this is that absolute and relative paths now
all work in the same way.  The second is that paths that lie outside
the repository now cause an error to be reported, instead of something
arbitrary and expensive being done.

Internally, all of the serious work is in the util package.  The new
canonpath function takes an arbitrary path and either returns a
canonical path or raises an error.  Because it needs to know where the
repository root is, it must be fed a repository or dirstate object, which
has given commands.matchpats and friends a new parameter to pass along.

The util.matcher function uses this to canonicalise globs and relative
path names.

Meanwhile, I've moved the Abort exception from commands to util, and
killed off the redundant util.CommandError exception.
2005-08-07 12:43:11 -08:00
Bryan O'Sullivan
18c9152328 Fix debugwalk when there's nothing to walk. 2005-08-07 11:04:58 -08:00
Samuel Tardieu
3d42c01fa5 Allow HG patch to appear late in the input stream 2005-08-06 21:23:38 +01:00
Thomas Arendsen Hein
57c1a9a890 Further help improvements:
Show command aliases in 'hg help something', unless in quiet mode.
Show short command description with 'hg help -q something'.
Show global options in verbose mode of command help.
State that Mercurial is a Distributed SCM.
2005-08-06 15:43:12 +01:00
Thomas Arendsen Hein
d9912ec66d Always show short help when an unknown command is given. 2005-08-06 14:04:59 +01:00
kreijack@inwind.REMOVEME.it
a9e149a318 When hg is invoked without parameters, the short list help is displayed.
When hg is executed without parameters ( or hg is executed with the
'help shortlist' command ) the short help list is displayed.
If the 'help' command is passed on the commandline the full help list
is displayed.
In both the cases if the switch '-v' is passed, the help contains also
the aliases of the short/full commands list and the global switches.
2005-08-06 13:27:31 +01:00
kreijack@inwind.REMOVEME.it
d95f67a4b0 More verbose information on the global options 2005-08-06 13:27:31 +01:00
kreijack@inwind.REMOVEME.it
dbb0ab4160 'hg help -v' mentions the alias of the commands 2005-08-06 13:27:31 +01:00
kreijack@inwind.REMOVEME.it
770fb8a63d 'hg help -v' shows global options 2005-08-06 13:27:31 +01:00
Thomas Arendsen Hein
08a1b66c1d Rewritten change type selection for hg status. 2005-08-06 12:05:09 +01:00
Thomas Arendsen Hein
9137b0ce4a Realigned command table again. 2005-08-06 07:16:37 +01:00
tksoh@users.sourceforge.net
434ce67bf6 hg status: added options to select files by status.
Added options -m, -a, -r and u to select files corresponding
to status M, A, R and ? respectively. If none of these
options are specified, files of all status will be shown.
2005-08-06 07:09:10 +01:00
mpm@selenic.com
be7d339756 Merge with BOS 2005-08-04 13:31:25 -08:00
mpm@selenic.com
c2d5a7769c Merge with TAH 2005-08-04 13:27:41 -08:00
Kyle Moffett
4a58ee908b Allow import from files with spaces
Index: hg/mercurial/commands.py
===================================================================
2005-08-04 13:22:36 -08:00
Samuel Tardieu
5422ec903a Add an option to hg serve to serve file using IPv6 2005-08-04 13:21:27 -08:00
Thomas Arendsen Hein
081258c314 Handle broken pipe on pressing Ctrl-C with e.g. 'hg log|grep something'. 2005-08-04 18:06:49 +01:00
Bryan O'Sullivan
f83e56bf58 Merge with Matt. 2005-08-04 05:14:59 -08:00
Bryan O'Sullivan
443fbd739c Fix performance of hg diff.
commands.walk has been refactored.  commands.walk's behaviour remains as
it was, but there is a new function, commands.makewalk.  This returns
results that can be passed along to other internal code, in our case
dodiff.
2005-08-03 09:10:48 -08:00
mpm@selenic.com
9161f5c8e4 Merge with BOS 2005-08-02 08:57:32 -08:00
mpm@selenic.com
e29716deb4 Actually implement the -f switch for push 2005-08-01 23:34:23 -08:00
Thomas Arendsen Hein
2616a4e21f Use list comprehension in hg status. 2005-08-01 17:58:13 +01:00
Bryan O'Sullivan
2f2a31ce76 Clean up walk and changes code to use normalised names properly.
New function: commands.pathto returns the relative path from one path
to another.  For example, given foo/bar and baz/quux, it will return
../../baz/quux.  This new function is used by the walk and status code
to print relative paths correctly.

New command: debugwalk exercises the walk code without doing anything
more.

hg.dirstate.walk now yields normalised names.  For example, if you're
in the baz directory and you ask it to walk ../foo/bar/.., it will yield
names starting with foo/.

As a result of this change, all of the other walk and changes methods
in this module also return normalised names.

The util.matcher function now normalises globs and path names, so that
it will match normalised names properly.

Finally, util.matcher uses the non-glob prefix of a glob to tell walk
which directories to scan.  Perviously, a glob like foo/* would scan
everything, but only return matches for foo/*.  Now, foo/* only scans
under foo (using the globprefix function), which is much faster.
2005-07-31 17:42:46 -08:00
mpm@selenic.com
768ed5f6f9 Psyco was failing to call dirstate.__del__ for import
Remove it.
2005-07-30 09:01:59 -08:00
mpm@selenic.com
b90578da57 Merge with BOS 2005-07-30 09:00:14 -08:00
Bryan O'Sullivan
e6c1da7c61 Adapt commit to use file matching code.
The code is slightly complicated by the need to commit all outstanding
changes in the repository if no file names are given (other commands
operate on the current directory and its subdirectories in this case).

localrepository.changes has acquired an optional match parameter, to let
it filter out include/exclude options.
2005-07-29 15:02:27 -08:00
Bryan O'Sullivan
4d6bf4b62a Reduce the amount of stat traffic generated by a walk.
When we switched to the new walk code for commands, we no longer passed a
list of specific files to the repo or dirstate walk or changes methods.
This meant that we always walked and attempted to match everything,
which was not efficient.

Now, if we are given any patterns to match, or nothing at all, we still
walk everything.  But if we are given only file names that contain no
glob characters, we only walk those.
2005-07-29 12:30:12 -08:00
Bryan O'Sullivan
56cb6cecf2 Move commands.forget over to using new walk code.
With no names, it now recursively forgets everything, as is the default
behaviour of other commands.  And prints the names of all files it
hasn't specifically been told to forget.
2005-07-29 08:49:01 -08:00
Bryan O'Sullivan
cc5f100120 Fix performance regression in addremove command.
When I rewrote addremove, I lazily put a call to repo.changes in,
which was unnecessary and slow.  This is a new rewrite, preserving the
file name behaviour, but replacing the call to repo.changes with a walk,
which is much cheaper, and avoids calls to os.stat on all but files that
have probably been deleted.
2005-07-29 08:42:28 -08:00
Thomas Arendsen Hein
d3b77c0789 Merge with upstream 2005-07-29 06:43:21 +01:00
Stephen Darnell
b957313b12 Add a --time command line option to time hg commands 2005-07-27 10:18:44 -08:00
TK Soh
cc943b9a88 Add paths command
The following patch adds the 'paths' commands to show a named path, or list of
available paths. In case anyone find it useful.
2005-07-27 08:19:59 -08:00
mpm@selenic.com
44898730bf Shorten hashes displayed in log 2005-07-27 08:14:52 -08:00
mpm@selenic.com
50f9864860 Hide errno in abort messages 2005-07-26 21:52:40 -05:00
mpm@selenic.com
036be5ad14 Fixes for annotate
Handle files that aren't in the repo
Handle empty files
2005-07-23 14:11:49 -05:00
Thomas Arendsen Hein
cc635ee7b9 Show all dirstate info for 'hg debugstate'. 2005-07-23 17:11:29 +01:00
mpm@selenic.com
ace1cac10d Fix bug in exception handling for hardlink clone 2005-07-23 10:14:42 -05:00
Bryan O'Sullivan
afb14169de Get addremove to use new walk code.
It is now more verbose than it used to be.  If given file names, it
prints nothing, as before.  But if given patterns or nothing, it prints
the names of the files it is operating on, to remove that air of mystery.

It also now operates at or below the current directory.
2005-07-22 19:45:48 -08:00
Thomas Arendsen Hein
ba5a4e2eff Added deprecation warnings if -t or --text is used for commits. 2005-07-22 16:27:30 +01:00
Thomas Arendsen Hein
aafc5792d1 Changed more occurances of 'text' to 'message'. 2005-07-22 16:26:46 +01:00
Andrew Thompson
1ecb4f2e16 Change all references to -t --text commit message to -m and --message. 2005-07-22 15:59:13 +01:00
Thomas Arendsen Hein
c476ddb6d6 There was an extra space after 'hg id' when there are no tags. 2005-07-22 08:58:16 +01:00
Thomas Arendsen Hein
8ba70bc4df Updated help strings and test-help:
- options -I/-X: always at the end, don't include them in the synopsis.
- NAME is optional for hg revert
- other small changes.
2005-07-22 08:47:35 +01:00