Commit Graph

83 Commits

Author SHA1 Message Date
Thomas Arendsen Hein
e10fcd1450 Disallow short earlygetop option combined with other short options
While "hg commit -qRfoo" can be read as "--quiet --repository foo",
"hg commit -mRfoo" should be "--message Rfoo".
2007-06-27 20:37:33 +02:00
Thomas Arendsen Hein
1dcdb0a53a Fix earlygetop for short options with unnecessary spaces removed
Examples:
 hg log -qR foo
 hg log -Rfoo
 hg log -qRfoo
2007-06-26 18:35:31 +02:00
Thomas Arendsen Hein
61d51838df New config option: ui.report_untrusted (defaults to True) 2007-06-25 22:41:15 +02:00
Thomas Arendsen Hein
05fbf9e284 Make earlygetopt return a list of all option values, use the last value.
This fixes:
"hg -R" showing a useful error instead of traceback
"hg -R foo --repository bar" using bar instead of foo

And provides a way for other users of earlygetopt to accept more than
one value.
2007-06-25 22:08:10 +02:00
Benoit Boissinot
4fdb840ede Make changeset_printer respect ui diffopts 2007-06-25 11:29:17 -07:00
Thomas Arendsen Hein
2e76adae49 Remember path to 'hg' executable and pass to external tools and hooks as $HG. 2007-06-23 20:21:10 +02:00
Matt Mackall
613a7dfcea identify: take a path to a remote repo
Rather than using -R, we take a path as an argument. This lets us use
url#branch syntaxes that may be in hgrc.
2007-06-21 13:09:01 -05:00
Matt Mackall
f0400ad7b9 dispatch: parse local hgrc for paths 2007-06-21 13:09:00 -05:00
Matt Mackall
b5a98f60fd identify: work with remote repos 2007-06-21 11:54:16 -05:00
Brendan Cully
f7e826dad3 Fix dispatch error message when not in a repo 2007-06-20 20:13:31 -07:00
Thomas Arendsen Hein
4d29c6dc8e Updated copyright notices and add "and others" to "hg version" 2007-06-19 08:51:34 +02:00
Thomas Arendsen Hein
483231d996 Cleanup of whitespace, indentation and line continuation. 2007-06-19 08:06:37 +02:00
Matt Mackall
30a1419154 dispatch: report failed imports nicely 2007-06-18 21:30:27 -05:00
Matt Mackall
c61bc27ccc dispatch: add generic pre- and post-command hooks 2007-06-18 17:49:56 -05:00
Matt Mackall
5ecb0cb232 dispatch: fix handling of incorrect number of arguments 2007-06-18 13:24:34 -05:00
Matt Mackall
579d9e3b44 encoding: pull fallbackencoding out of localrepo into early parsing 2007-06-18 13:24:34 -05:00
Matt Mackall
cdeb6ec2da extensions: kill ui readhooks
Move .hgrc extension loading into localrepo
2007-06-18 13:24:34 -05:00
Patrick Mezard
d37b2026d5 cmdutil: add missing "time" import. 2007-06-17 20:35:32 +02:00
Alexis S. L. Carvalho
8b373440d8 addremove: use util.lexists 2007-06-13 19:15:58 -03:00
Brendan Cully
37671e0260 dispatch: restore a dropped shlex import
Add test-dispatch as a place for command parsing and dispatch tests.
2007-06-12 13:21:42 -07:00
Matt Mackall
7092619ffc dispatch: accept an abbreviation of --repository 2007-06-11 21:09:24 -05:00
Matt Mackall
ca982cdfb5 dispatch: move findrepo to cmdutil 2007-06-11 21:09:24 -05:00
Matt Mackall
dc4befe753 localrepo: don't search from path
All current callers already pass in the repo root.

This normalizes things a bit. Now all repo types take a direct path to
repo root and only the command line interface (or the dispatcher)
searches from the current directory.
2007-06-11 21:09:24 -05:00
Matt Mackall
1621c30af5 dispatch: use the repo path found by early parsing
This lets us simplify things a bit.
2007-06-11 21:09:24 -05:00
Matt Mackall
b37003d1a6 dispatch: parse and apply -R early
This allows us to use extensions specified in .hg/hgrc. Unfortunately,
this requires us to parse that file twice, but performance impact on
the version command appears to be less than 1%.
2007-06-11 21:09:24 -05:00
Matt Mackall
a0218b2be7 dispatch: parse and apply cwd opt early 2007-06-11 21:09:24 -05:00
Matt Mackall
eec35bbc8f dispatch: rename variables after code motion 2007-06-11 21:09:24 -05:00
Matt Mackall
671f8a455f dispatch: hoist debugging hook to runcatch 2007-06-11 21:09:24 -05:00
Matt Mackall
7daba33088 dispatch: move dispatching code to cmdutil 2007-06-11 21:09:24 -05:00
Matt Mackall
fc13f3eb60 dispatch: move runcommand to cmdutil 2007-06-11 21:09:24 -05:00
Alexis S. L. Carvalho
e1bf8e80c5 Add dirstate.pathto and localrepo.pathto.
Every time util.pathto is called, we have to pass the repo root and the
repo cwd.

dirstate.pathto is a simple convenience function that knows about the
root and the cwd arguments.  It's still possible to pass the cwd as an
optimization.

localrepo.pathto is a convenience function that just calls
dirstate.pathto, just like localrepo.getcwd.

dirstate.pathto becomes a single point that converts most (all?) paths
from the internal representation to some OS-specific relative path for
display purposes.
2007-06-08 23:49:12 -03:00
Alexis S. L. Carvalho
4949bc9033 Use absolute paths in addremove.
This is more consistent with other places in the code, which only use
the "relpath" returned by cmdutil.walk for display purposes.
2007-06-08 23:49:12 -03:00
Matt Mackall
41d9aaebb8 Add support for url#id syntax
This allows you to do:

 hg clone http://server/repo#stable

which is equivalent to:

 hg clone -r stable http://server/repo

Future incoming, outgoing, and push commands will default to using
this id because it's recorded in the default path.

Other commands that accept URLs (push, pull, bundle, incoming, and
outgoing) also accept this syntax.
2007-06-01 18:40:14 -05:00
Thomas Arendsen Hein
128193f3e9 addremove: comparing two empty files caused ZeroDivisionError
(found by Giorgos Keramidas)
2007-06-01 16:00:40 +02:00
Bryan O'Sullivan
7b6d636f19 Refactor commands.serve to allow other commands to run as services.
This introduces a new function, cmdutil.service.
2007-04-27 21:30:55 -07:00
Matt Mackall
e2dfe968ea Merge with stable 2007-04-16 12:37:30 -05:00
Alexis S. L. Carvalho
62e2a7bfb7 command line templates: add formatnode filter
This will print a full hash node with --debug and a short one otherwise.

Use it with some default templates and in map-cmdline.default to print
the parents.  This should fix issue538.
2007-04-16 13:00:23 -03:00
Alexis S. L. Carvalho
4b47aae3d4 fix 'hg <not-log> -v --template foo' with revisions without copies 2007-04-16 13:00:23 -03:00
Alexis S. L. Carvalho
47cb22b5a2 Merge with crew-stable 2007-03-16 00:45:18 -03:00
Alexis S. L. Carvalho
fcb39243b1 pass repo.root to util.pathto() in preparation for the next patch 2007-03-16 00:22:57 -03:00
Matt Mackall
e896adead6 Merge with -stable, fix small test failure 2007-03-14 01:26:09 -05:00
Alexis S. L. Carvalho
fd69fe8d91 "default" is the default branch name 2007-03-13 15:02:33 -03:00
Alexis S. L. Carvalho
641d95a966 Merge a bunch of matcher and locate fixes. 2007-03-10 23:21:33 -03:00
Alexis S. L. Carvalho
c3d6308137 remove unused "head" hack from util._matcher 2007-03-10 23:00:59 -03:00
Alexis S. L. Carvalho
b53e6f3897 change locate to use relglobs by default
This makes its default behaviour useful again (issue108), and
changes it search the entire repository by default (instead
of just the cwd), just like all other commands.

It also hides issue204 by default, but you'll still see the
same behaviour if you give it a relpath: pattern.
2007-03-10 23:00:57 -03:00
Alexis S. L. Carvalho
c576480d83 Leave normalization of patterns to util._matcher
Passing [] to util.cmdmatcher accidentally fixes walking of files
with "\n" in the name.
2007-03-10 23:00:46 -03:00
Alexis S. L. Carvalho
5b836109d8 docopy: deal with globs on windows in a better way 2007-01-30 18:32:20 -02:00
Giorgos Keramidas
671dc70240 Fix addremove for symlinks to non-existent files 2007-01-05 21:28:49 +02:00
Erling Ellingsen
77c63b0f24 Avoid some false positives for addremove -s
The original code uses the similary score

  1 - len(diff(after, before)) / len(after)

The diff can at most be the size of the 'before' file, so any small
'before' file would be considered very similar. Removing an empty file
would cause all files added in the same revision to be considered
copies of the removed file.

This changes the metric to

  bytes_overlap(before, after) / len(before + after)

i.e. the actual percentage of bytes shared between the two files.
2007-02-18 20:39:25 +01:00
Alexis S. L. Carvalho
fff454d591 Merge with crew-stable 2007-01-30 19:36:56 -02:00