Commit Graph

740 Commits

Author SHA1 Message Date
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