Commit Graph

858 Commits

Author SHA1 Message Date
Thomas Arendsen Hein
9d33a5e819 Moved special handling of --version and no hg command from parse to dispatch.
This allows e.g. 'hg status --version' to work.
2005-08-26 08:26:21 +02:00
bos@serpentine.internal.keyresearch.com
9f78835764 grep: speed up matching, and only return one match per line. 2005-08-25 17:13:48 -07:00
Bryan O'Sullivan
7cbf1e0fee Use ui.write instead of print in debugwalk. 2005-08-25 10:11:54 -07:00
Thomas Arendsen Hein
bc14f61be2 Sort global options by topic: directories, ui, timing, other
(and changed indentation to match command table)
2005-08-25 18:35:35 +02:00
Thomas Arendsen Hein
d5c16ece15 Removed forgotten debug print statement from commands.py and tests. 2005-08-25 16:00:08 +02:00
Bryan O'Sullivan
38e580170d Add grep command.
It currently searches all revs of every matching file.  I'll change
this soon so that it can still do this, but it will not be the default
behaviour.
Many options are unimplemented.  There's only one output mode.  Binary
files are not handled yet.
2005-08-25 02:00:03 -07:00
Bryan O'Sullivan
d845eb1c18 Map long option names containing dashes to ones containing underscores. 2005-08-24 22:25:55 -07:00
mpm@selenic.com
f42e0684d8 Fix a couple fencepost errors in hg log 2005-08-24 19:16:45 -07:00
mpm@selenic.com
d16fb02700 Fix hg log -p 2005-08-24 18:45:49 -07:00
mpm@selenic.com
985163dd22 Show number of new heads when doing a pull 2005-08-24 18:42:42 -07:00
mpm@selenic.com
64a0be3cd1 Add debugdata for dumping revlog revision data 2005-08-24 18:40:17 -07:00
bos@serpentine.internal.keyresearch.com
ee1e8ec6e8 Fix a small corner of log behaviour.
If invoked with no arguments in a subdirectory of the repo root, it
should print the history of the repository as a whole.
2005-08-24 14:45:35 -07:00
mpm@selenic.com
e3e20ae4fd Merge with BOS 2005-08-24 13:31:46 -07:00
Bryan O'Sullivan
ad065b010b Fix help output, and a few broken tests. 2005-08-24 13:26:45 -07:00
Bryan O'Sullivan
22c1455510 Merge with MPM. 2005-08-24 12:50:11 -07:00
Bryan O'Sullivan
8b3b079822 Rewrite log command. New version is faster and more featureful.
The original implementation of log walked backwards through history,
which had terrible behaviour.  It took several minutes to view
complete kernel change history on a fast machine, for example.
The rewrite uses a windowed approach to walk hunks of history
forwards, while still giving results in reverse order.  This reduces
run time from five minutes to five seconds on my system.
In addition, the rewrite uses our normal name handling mechanisms, so
you can run a command like "hg log net/ipv4/**.c" and get a useful
answer.  It optimises for three different cases (no arguments, only
files, and anything goes), so it performs well in all circumstances
I've tested.
2005-08-24 12:39:10 -07:00
mpm@selenic.com
bf94ed815e Minor tweak to the revgen algorithm 2005-08-24 03:33:54 -07:00
mpm@selenic.com
7c92a626a7 Minor hgwebdir tweaks
- ignore / for PATH_INFO
- fix // in URLs
2005-08-24 03:32:08 -07:00
mpm@selenic.com
95f1940887 Create helper functions for I/O to files in the working directory
This simplifies some code and gives us a single place to add I/O
filters.
2005-08-24 00:32:10 -07:00
Bryan O'Sullivan
7fa8c45c98 Merge with MPM. 2005-08-23 21:57:22 -07:00
Bryan O'Sullivan
c575ae97dc Add commands.debugconfig.
This lets us both view the actual config data that hg is using, and
drive editors that need to see this information.
2005-08-23 21:30:12 -07:00
mpm@selenic.com
599d52df20 Teach annotate about binary files 2005-08-23 20:21:52 -07:00
mpm@selenic.com
af3be1f6a1 Add automatic binary file detection to diff and export
Based on a patch by Fuming Wang

- add util.binary which decides whether a file is binary if it has any NUL
  characters in the first 1K.
- teach mdiff.unidiff to print "binary file <x> has changed" for binary files
- add text flag to cause unidiff and dodiff to treat all files as text
- add -a and --text flags (like diff(1)) to hg diff and export
- update docs
2005-08-23 19:58:46 -07:00
mpm@selenic.com
93fd21d2e9 Clean up argument passing for dodiff 2005-08-23 18:58:26 -07:00
mpm@selenic.com
def38223d0 Deal with repos with missing timezones 2005-08-23 16:19:14 -07:00
mpm@selenic.com
bfbf3abdb0 Fix callers to file.revision to use file.read
This was causing unchanged files to show up as modified.
2005-08-23 12:46:43 -07:00
mpm@selenic.com
b12dc2fafb Clean up some merge logic
- rename mode to branch_merge
- use explicit update mode
- use negative mtime for updates that set mtime
- expand some cryptic variable names
- elaborate merge dirstate comments
- remove redundant manifest lookup for non-merge case
- remove impossible merge case
- fix up test cases
2005-08-23 02:19:38 -07:00
mpm@selenic.com
094f0105d6 Fix up some bugs introduced by recent merge changes
- use new changed list to track what files actually got new revlog entries
  at commit/rawcommit time
- when updating a file during a merge, don't mark it as completely unchanged
- handle file not being in parent 1 in status
2005-08-22 01:22:29 -07:00
mpm@selenic.com
5ce035aafc merge: remove remaining mark bits 2005-08-21 22:03:36 -07:00
mpm@selenic.com
cf3b118558 Fix long-standing excessive file merges
Since switching to the multihead approach, we've been creating
excessive file-level merges where files are marked as merged with
their ancestors.

This explicitly checks at commit time whether the two parent versions
are linearly related, and if so, reduces the file check-in to a
non-merge. Then the file is compared against the remaining parent,
and, if equal, skips check-in of that file (as it's not changed).

Since we're not checking in all files that were different between
versions, we no longer need to mark so many files for merge. This
removes most of the 'm' state marking as well.

Finally, it is possible to do a tree-level merge with no file-level
changes. This will happen if one user changes file A and another
changes file B. Thus, if we have have two parents, we allow commit to
proceed even if there are no file-level changes.
2005-08-21 21:59:55 -07:00
mpm@selenic.com
1602510827 Reformat debugindex output 2005-08-21 16:51:50 -07:00
mpm@selenic.com
184b369f94 Remove unused relfilter function 2005-08-21 16:00:07 -07:00
mpm@selenic.com
8bb9bacafa hgweb: change startup argument processing
- allow passing a repo object instead of a path
  (if we get a string, we construct a repo object)
- hg serve: pass options via repo.ui.setconfig
- add --style option
- get default name from repo.root rather than getcwd()
- remove template argument to hgweb()
- reduce create_server from 8 args to 1
2005-08-21 15:56:14 -07:00
mpm@selenic.com
731055ffd1 Add web:style option 2005-08-21 15:00:02 -07:00
mpm@selenic.com
ad6bff85ff Remove debug print 2005-08-21 11:52:52 -07:00
mpm@selenic.com
ac6c96ea43 Fix RSS feeds 2005-08-21 11:46:39 -07:00
mpm@selenic.com
386d6f39d6 hgweb: convert index entries to list expansion style 2005-08-20 13:11:36 -07:00
mpm@selenic.com
ba08a3d105 Merge with jeffpc 2005-08-20 13:08:07 -07:00
mpm@selenic.com
fe845586fa Deal with non-integer date offsets generated by some tools 2005-08-20 11:59:10 -07:00
mpm@selenic.com
a4548bef7f Remove call to non-existent date_parser 2005-08-20 01:35:45 -07:00
mpm@selenic.com
56f9aeaf2d Fix possible unitialized variable warnings 2005-08-20 01:29:04 -07:00
Samuel Tardieu
e3495dfc0a [PATCH] Take DST into account
Right now, mercurial doesn't take daylight saving time into account
because it uses time.timezone inconditionally, instead of resorting to
time.altzone if daylight saving time is on.
2005-08-19 23:26:32 -08:00
Samuel Tardieu
c5def6fc1c [PATCH] Print timezone offset when outputting dates
Example:

% hg log | head -12
changeset:   791:41440890e57d2dbacde03a2a114e5114a031ea4a
tag:         tip
user:        Samuel Tardieu <sam@rfc1149.net>
date:        Mon Jul 25 13:24:15 2005 +0200
summary:     Parse various date formats when accepting user specified dates
[...]
changeset:   787:ba5c2021364ee876dae170e8f153e43bd0b2bd73
parent:      785:31a80e3723cee0a5991340facb2707e71983eb41
user:        Bryan O'Sullivan <bos@serpentine.com>
date:        Sun Jul 24 00:39:24 2005 -0800
summary:     Get "forget" command to use new walk code.
[...]
2005-08-19 23:23:42 -08:00
mpm@selenic.com
e10b86b086 hg import: abort with uncommitted changes, override with --force 2005-08-19 23:07:31 -08:00
mpm@selenic.com
90c7a47a36 Use post-expanded clone pathname as default 2005-08-19 22:48:43 -08:00
mpm@selenic.com
21802a4ed9 hgweb: Make maxfiles, maxchanges, and allowpull proper config options 2005-08-19 22:12:40 -08:00
mpm@selenic.com
911bc32c5f Add -e and --remotecmd for clone and pull too 2005-08-19 22:11:48 -08:00
mpm@selenic.com
93c3566358 Add --ssh and --remotecmd to push
This uses the new setconfig options passing mechanism
2005-08-19 21:36:57 -08:00
mpm@selenic.com
8fe07a9a3f Add ui.setconfig overlay
This can simplify option passing
2005-08-19 21:25:25 -08:00
mpm@selenic.com
2a89b7bd1d Fix option parsing bug for empty short options 2005-08-19 18:56:20 -08:00
mpm@selenic.com
bc11f47499 hgweb: sort repository list 2005-08-19 17:22:04 -08:00
mpm@selenic.com
f0ae86293f Fix hgwebdir virtual start-up 2005-08-19 17:01:11 -08:00
mpm@selenic.com
ac03d564fb Remove -C alias for --cwd 2005-08-19 16:51:44 -08:00
mpm@selenic.com
8414ebc4a3 Merge with TAH 2005-08-19 16:45:25 -08:00
mpm@selenic.com
cd806d7dec Merge with BOS 2005-08-19 16:43:30 -08:00
mpm@selenic.com
e827a5700c Add a multi-repository server
This merges a bunch of the ideas for a multi-repository CGI script and
simplifies things a bit.

It uses PATH_INFO so it generally wants paths of the form:

http://host/hg.cgi/virtualpath

This gets mapped via a simple config file to the real path. All info
about the repo is read from the repo's hgrc.
2005-08-19 16:38:25 -08:00
Bryan O'Sullivan
c797ab8658 Add --cwd global option, to change directory before doing anything.
Useful for interacting with a program presenting a UI, such as Emacs.
2005-08-18 14:58:14 -08:00
Bryan O'Sullivan
642b56abc3 Modify commands.walk to yield a 4-tuple.
The new element of the tuple indicates whether a name is an exact match
for one passed in on the command line.
2005-08-18 13:58:32 -08:00
Thomas Arendsen Hein
40a409ddd8 Read global config file /etc/mercurial/hgrc and fix reading hgrc on Windows. 2005-08-18 21:35:36 +01:00
Josef "Jeff" Sipek
29f76a06ac Merge with MPM 2005-08-17 22:59:47 -05:00
Josef "Jeff" Sipek
8d47ab93e3 hgweb: Changed manifest page to list format syntax 2005-08-17 22:32:47 -05:00
Josef "Jeff" Sipek
e93ee68c7d hgweb: Changed file revision page to list format syntax 2005-08-17 22:08:15 -05:00
Josef "Jeff" Sipek
648fbc401f hgweb: Changed annotate page to list format syntax 2005-08-17 22:03:28 -05:00
Josef "Jeff" Sipek
1fb176c855 hgweb: Changed file page to list format syntax 2005-08-17 21:59:02 -05:00
mpm@selenic.com
25858fcafc Add in and out aliases 2005-08-17 18:52:27 -08:00
Josef "Jeff" Sipek
2e63eb1703 hgweb: Changed changelog page to list format syntax 2005-08-17 21:45:44 -05:00
mpm@selenic.com
15214e2950 Fix stray debug statement 2005-08-17 18:41:04 -08:00
Josef "Jeff" Sipek
0977c5f04b Added support for #foo%bar# syntax
This required moving template() into the templater class
2005-08-17 21:14:20 -05:00
mpm@selenic.com
211f1e3677 hgweb: add [web] section to hgrc
This makes almost all of the hgweb settings available in hgrc.
2005-08-17 17:57:37 -08:00
mpm@selenic.com
26b61451d6 Whitespace 2005-08-17 16:37:04 -08:00
mpm@selenic.com
8fd52eb092 Fix path handling for deleting files on merge 2005-08-17 00:36:36 -08:00
tksoh@users.sf.net
564f653a74 Fixed --repository option when handling relative path
When specifying relative path to --repository option, 'log' and
'diff' were unable to find the files specified. Here's the fix.
2005-08-17 00:33:53 -08:00
mpm@selenic.com
aa0aad3e1a Fix incoming for empty set 2005-08-16 22:47:49 -08:00
mpm@selenic.com
6a1eb4d99f hg incoming/outgoing: fix tests and update man page 2005-08-16 19:27:46 -08:00
mpm@selenic.com
6cfb06746f Add hg incoming command for local repositories 2005-08-16 19:17:16 -08:00
mpm@selenic.com
4eed373ac4 Add a local() method to repository classes 2005-08-16 19:17:01 -08:00
TK Soh
1e0fd1d4ba updated help text and added manpage section for hg paths
Index: hg/doc/hg.1.txt
===================================================================
2005-08-16 17:30:41 -08:00
mpm@selenic.com
5bcea47997 Add basic https support for pull 2005-08-16 17:12:25 -08:00
mpm@selenic.com
ef0df55b06 show_changeset: -q shows short hash 2005-08-16 15:50:42 -08:00
mpm@selenic.com
39f134ded6 Add hg outgoing command 2005-08-16 15:49:26 -08:00
mpm@selenic.com
8ff3edc761 whitespace cleanup 2005-08-16 15:30:26 -08:00
mpm@selenic.com
bc91e62ffa hg cat: accept changeset hashes 2005-08-16 15:22:44 -08:00
mpm@selenic.com
e7d0341a7b Fix hg clone race with writer
Most read operations in hg don't need locks because we order reads and
writes for consistency. Clone is an exception to this as we're copying
entire file histories and could end up with more file history copied
than we have commits.

For now, make clone take a lock on the source repo. Non-hardlinked
clone should eventually be changed to use lockless pull.
2005-08-16 14:53:47 -08:00
mpm@selenic.com
2616af791c Let hg paths work outside of repositories 2005-08-16 13:52:28 -08:00
TK Soh
c394d69d93 typo fix in command help text
This patch fixes a few typo errors on the command help output
(I am not sure if the change on 'diff' is the best though).
2005-08-16 10:42:30 -08:00
mark.williamson@cl.cam.ac.uk
37633695b1 Minor tweak: os.STOPSIG -> os.WSTOPSIG. Pychecker spotted this one. 2005-08-15 11:46:41 -08:00
Thomas Arendsen Hein
6abcd01c6a Fix .hgignore parsing if last line has no EOL, ignore trailing white space.
(and don't use tabs in python code)
2005-08-15 08:08:11 +01:00
Bryan O'Sullivan
956772aca8 Modify init command to take an optional directory to set up.
If the directory does not exist, it is created.
If no directory is given, the current directory is used.
2005-08-14 21:33:09 -08:00
Thomas Arendsen Hein
21673adbf3 Update synopsis for 'hg update', too. 2005-08-15 06:18:49 +01:00
Thomas Arendsen Hein
122e907690 Update online help of hg heads for new --branches option. 2005-08-15 05:22:40 +01:00
mason@suse.com
038c62eda0 Add optional parameter for changed/added/del/unknown files to commands.dodiff
This makes it possible to avoid a call into repo.changes if the details
of what has changed is already known
2005-08-14 20:09:32 -08:00
mason@suse.com
5784da7ba8 Allow the changegroup generator to completely load the buffer.
This makes is possible to delete or truncate away revisions and still
use the changegroup later.
2005-08-14 20:09:21 -08:00
mason@suse.com
66f2574257 Add optional stop revision to revlog.heads 2005-08-14 20:09:09 -08:00
mason@suse.com
7c05a98feb Change repo.comit to return None on error or the new revision number on
success

This allows the caller to correctly record the new revision number
2005-08-14 20:09:01 -08:00
mason@suse.com
9e36a1edf3 Add force option to repo.commit, allowing commits where no files change 2005-08-14 20:08:35 -08:00
mark.williamson@cl.cam.ac.uk
5f670f62e0 Add '-' support to the commit logfile option to read message from stdin. 2005-08-14 12:30:01 -08:00
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
mpm@selenic.com
979a3bb825 Fix bug with empty inc and exc
This fixes an exception that showed up when importing patches
2005-08-14 12:23:36 -08:00
mpm@selenic.com
aeee958e99 Merge with BOS 2005-08-13 19:43:42 -08:00
Bryan O'Sullivan
1486c1162f Merge with TAH. 2005-08-13 15:23:06 -08:00
Bryan O'Sullivan
0b40afa588 Fix bug involving "hg debugwalk -Ipattern" from repository root. 2005-08-13 15:09:37 -08:00
Bryan O'Sullivan
de43775de3 Fix clone when target directory is relative. 2005-08-13 14:41:51 -08:00
tksoh@users.sourceforge.net
57e34bb4fd Allow Mercurial to build on HP-UX 11
Temporary fix to allow Mercurial to build on HP-UX 11, as the C
compiler on HP-UX 11 doesn't support 'inline' qualifier. The
'__inline' qualifier seemed to be supported, but not without
first resolving other associated issues.
2005-08-13 12:41:00 -08:00
mpm@selenic.com
505146283c Merge with TAH 2005-08-12 23:54:09 -08:00
Bryan O'Sullivan
3891eab8ea Fix up handling of regexp paths. 2005-08-12 16:09:17 -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
Bryan O'Sullivan
8a94cac17b Update to tip. 2005-08-12 07:42:32 -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
918ab8086f Merge IPv6 fix. 2005-08-10 12:36:34 -08:00
Bryan O'Sullivan
6d86d89086 Fix problem with "hg serve" on systems not providing IPv6. 2005-08-10 12:35:25 -08:00
Thomas Arendsen Hein
0fcb836019 Cleanup after previous changes:
- there are only two states for the exec bit, so no need to override it.
- file_ variable is only once now, so it self.file(f) can be used directly.
2005-08-10 08:41:23 +01:00
Thomas Arendsen Hein
6ab968eb5c Use length of file instead of length of change for the dirstate entry. 2005-08-10 07:51:37 +01:00
Thomas Arendsen Hein
20e6210ce8 Fix 3-way-merge of original parent, workdir and new parent.
The dirstate has to match what is in the repository (what would be
checked out with 'hg update -C'), because the resulting file may be
identical to the new parent, or it may be completely different.
Previously the dirstate wasn't updated, so if you changed the file to
look like the original parent, it might be considered unmodified
relative to the new parent.
2005-08-10 06:47:46 +01:00
Bryan O'Sullivan
3a382ee2e1 Merge with mpm. 2005-08-09 17:24:38 -08:00
Edouard Gomez
d27cf121e6 Trap OSError when deleting env vars
On the other OS, it seems that case insensitivity for
environment vars can bite users when using some unknown
combination of python 2.4.1 and win2kSP4+minsys (and
probably other vversions of these softwares).

The best way to avoid problems in those weird cases is to
ignore OSError exception during env var deletion.
2005-08-09 09:36:34 -08:00
Thomas Arendsen Hein
afee016a1d dirstate.changes() now distinguishes 'hg remove'd or just deleted files.
Interface is not yet changed.
Non-regular files are considered to be removed or deleted.
Removed the unneeded match(fn) call for adding to the unknown list.
2005-08-09 11:32:30 +01:00
Jeff Sipek
aebe0b9925 [PATCH] Move default page name into map file
Move default page name from code into the map file. This way, different
hgweb styles/themes are free to select their default (no cmd in args)
page.
2005-08-08 19:49:48 -08:00
Jeff Sipek
37c3c833cd [PATCH] Propagate the template map though recursively
This patch allows propagates the template map though recursively
though all the templates.

This allows for some hgweb template cleanup patches as well as it makes
writing new skins/themes for hgweb much much easier. (I'm planing to
write several basic ones.)
2005-08-08 19:49:34 -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
315d7bf18a Kill dead function. 2005-08-07 11:09:21 -08:00
Bryan O'Sullivan
18c9152328 Fix debugwalk when there's nothing to walk. 2005-08-07 11:04:58 -08:00
Thomas Arendsen Hein
9d8a9110b0 Fixed encoding of directories ending in .d or .i:
One .d and .i was mixed up, and string replace method doesn't work in-place.
2005-08-07 17:41:13 +01:00
Tristan Wibberley
34dcd4a098 Fixed revlog.children.
It was comparing a node to a rev, then appending a rev onto the list
of children being constructed instead of a node.
2005-08-06 21:58:28 +01: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
Wallace, Eric S
ac33b6df10 Fix array overflow bug in bdiff
I ran into a bug while importing a large repository into mercurial.
The diff algorithm does not allocate a big enough array of hunks
for some test cases. This results in memory corruption, and possibly,
as in my case, a seg fault.

You should be able to reproduce this problem with any case of more
than a few lines that follows this pattern:

a  b
=  =
1  1
   2
2  3
   4
3  5
   .
4  .
   .
5
.
.
.

I.e., "a" has blank lines on every other line that have been removed in
"b". In this case, the number of matching hunks is equal to the number
of lines in "b". This is more than ((an + bn)/4 + 2). I'm not sure what
motivates this formula, but when I changed it to the smaller of an or
bn (+ 1), it works.

[comment added by mpm]
2005-08-04 13:25:59 -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
mpm@selenic.com
c0f58ac983 Make ssh URL parsing more robust 2005-08-01 23:23:51 -08:00
mpm@selenic.com
7c0d9a3cf7 Warn on pushing unsynced repo or adding new heads
By popular demand
2005-08-01 23:17:22 -08:00
Thomas Arendsen Hein
2616a4e21f Use list comprehension in hg status. 2005-08-01 17:58:13 +01:00
Bryan O'Sullivan
a159000a3d Attempt to yield names in sorted order when walking.
This is an improvement in behaviour, but the walk and changes code still
has some flaws that make sorted name presentation difficult:

- changes returns tuples of names, instead of a sorted list of (name,
  status) pairs.

- walk yields deleted names after all others.
2005-07-31 18:03:46 -08:00
Bryan O'Sullivan
25438a68e9 Ensure that dirstate.walk only yields names once.
Its predecessor code used to do this, and now it does, too.
2005-07-31 17:54:00 -08: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
mpm@selenic.com
666129a0b4 Merge with TAH 2005-07-30 08:35:29 -08:00
mpm@selenic.com
c29a4a3c68 add note about -C to update message 2005-07-30 08:30:12 -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
mpm@selenic.com
04d7166797 Fix the directory and revlog collision problem
This adds escaping for directory names so that directory foo.i doesn't
collide with the revision data for file foo.
2005-07-27 18:50:32 -08:00
mpm@selenic.com
e4d910ab82 Fix undo after aborted commit bug
Commit would overwrite undo.dirstate unconditionally, so an undo after
an aborted commit would restore the dirstate from the aborted commit
and not the prior transaction.

This copies dirstate to journal.dirstate and moves it after a
successful transaction.
2005-07-27 18:16:20 -08:00
Stephen Darnell
b957313b12 Add a --time command line option to time hg commands 2005-07-27 10:18:44 -08:00
thananck@yahoo.com
b2ea3f96f3 Provided platform dependent implementations for explain_exit
os.system return code is system dependent.
2005-07-27 10:18:22 -08:00
mpm@selenic.com
6b8940724b Fix copy in subdirectories
Spotted by Chad Netzer
2005-07-27 10:05:12 -08:00
mpm@selenic.com
185e6a4945 Add changegroup hook for push/pull 2005-07-27 09:07:28 -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
3823d6eace Make pull count jargon less confusing
revisions are now synonymous with changesets, and not file changes
2005-07-25 12:02:29 -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
mpm@selenic.com
9520e62074 Fix local file changes being ignored after non-branch merge
Bug introduced in 45dd84ebbed8
Spotted by TAH
2005-07-23 10:00:56 -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
mpm@selenic.com
f8e53b93db Hack to fix missing '/' problem in URLs 2005-07-22 20:07:14 -05:00
mpm@selenic.com
8e0881ad8a Don't mark files with 'm'erge unless we're actually merging branches
For 3-way merges, we were marking files as 'm', which should only be
used for branch merges. This was causing files to show up in 'hg
status' that aren't actually modified.
2005-07-22 19:23:00 -05: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
Thomas Arendsen Hein
4ac08580ae Show filenames for hg export in verbose mode on a separate lines.
This makes parsing by external tools much easier.
2005-07-22 07:42:47 +01:00
mpm@selenic.com
1f521ec7c5 Check protocol versions
This also allows the old unidentified protocol
2005-07-21 18:20:13 -05:00
mpm@selenic.com
e16b6ba2ce Simplify content type checking 2005-07-21 18:19:20 -05:00
Muli Ben-Yehuda
0bf14d0d7e When pulling from a non hg repository URL (e.g. http://www.kernel.org/hg)
you geta pretty obscure error (zlib: uknown compression type). The
attached patch modifies hgweb.py and hg.py to supply and check a
'Content-type: application/hg-0.1' HTTP header for the branches,
between and changegroup commands, so that we know it's a proper hg
repo before snarfing the input. Comments appreciated!
2005-07-21 18:18:43 -05:00
mpm@selenic.com
d1b02c9855 Add tag -t, deprecate tag -m
manifest hash: 893aa9732b500edfa6ffc099f76b00a88a5b1943
2005-07-21 15:29:35 -05:00
mpm@selenic.com
b558c4fe0c Add -m for rawcommit
manifest hash: cf066b609ab4854a731c103f1d456d89cf5e1312
2005-07-21 12:29:19 -05:00
mpm@selenic.com
1698a5cd7e Change C to M in status 2005-07-21 12:24:42 -05:00
mpm@selenic.com
0da7c8cf44 Add -m for commit and deprecate -t
Index: hg/doc/hg.1.txt
===================================================================
2005-07-21 12:23:55 -05:00
mpm@selenic.com
f37cae8945 Handle empty file list for annotate 2005-07-21 12:22:54 -05:00
mpm@selenic.com
de5db2bbb6 Remove ls command 2005-07-21 12:22:29 -05:00
mpm@selenic.com
88969029c3 Refactor matchpats and walk
Move core match function code to util
Add some comments and whitespace
Simplify options
Use lambdas instead of always and never
2005-07-21 12:21:33 -05:00
mpm@selenic.com
f70080b8c0 Fix some line wrapping
manifest hash: 43af5dafa55e01f89727096f4d6784317f3eb0d6
2005-07-20 20:11:23 -05:00
Bryan O'Sullivan
98efeab033 Split make_file back out into make_filename and make_file.
It turns out that make_filename is useful by itself.
2005-07-20 04:08:11 -08:00
Bryan O'Sullivan
197de447fb If the argument to make_file can act like a file, return it.
This is useful for code that calls command functions, but doesn't
want to send I/O through the filesystem.
2005-07-20 03:55:16 -08:00
Bryan O'Sullivan
6e8461ae49 Merge with Matt's tip. 2005-07-20 03:52:06 -08:00
Bryan O'Sullivan
bd62653aff Update tests to reflect walk changes. 2005-07-20 03:43:05 -08:00
Bryan O'Sullivan
89e035ebd1 An empty .hgignore file must cause us to ignore nothing, not everything! 2005-07-20 03:37:01 -08:00
Bryan O'Sullivan
790baed0b9 Convert annotate over to walk interface.
Add emptyok parameter to walk and matchpats, for commands that require
at least one name.
2005-07-20 03:23:12 -08:00