Commit Graph

278 Commits

Author SHA1 Message Date
mpm@selenic.com
e6e4ecb803 localrepo: minor opener usage restructuring 2005-08-27 16:34:54 -07:00
mpm@selenic.com
f1273ca2af Separate out old-http support
- create new statichttprepo class
- pull remote bits out of localrepo
- pull remote bits out of util.opener
- switch hg.repository to use statichttprepo
2005-08-27 16:28:53 -07:00
mpm@selenic.com
016db4f3e8 Adjust some imports 2005-08-27 14:59:25 -07:00
mpm@selenic.com
13cd5a12bb commands: use revlog directly for debug commands
This eliminates the import in hg.py
2005-08-27 14:56:58 -07:00
mpm@selenic.com
06162e7dd0 Move opener to utils
- move the opener code down to util
- add docstring
- change commands.py users to simply use file instead
2005-08-27 14:31:41 -07:00
mpm@selenic.com
e175fdde9b Break apart hg.py
- move the various parts of hg.py into their own files
- create node.py to store node manipulation functions
2005-08-27 14:21:25 -07:00
mpm@selenic.com
14f5c433e1 Fixes for push corner case
TAH found a bug where push would push things the remote already had,
raising an assertion. This turned out to be because the changeset
protocol was not recording a common subset node in one case.

Also discovered was that the protocol was queueing multiple copies of
a node for pull. Fixed by changing fetch to a hash.

Add some more debugging output.
2005-08-26 16:49:23 -07:00
Thomas Arendsen Hein
3c84fc273d Allow using a ssh repository without a path.
This uses the home directory on the remote side or the directory
specified in the command in .ssh/authorized_keys
2005-08-26 22:40:56 +02:00
benoit.boissinot@ens-lyon.fr
95b97f01ed pep-0008 cleanup
- Don't use spaces around the '=' sign when used to indicate a
      keyword argument or a default parameter value.
2005-08-26 13:06:58 +02: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
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
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
a4548bef7f Remove call to non-existent date_parser 2005-08-20 01:35:45 -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
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
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
4eed373ac4 Add a local() method to repository classes 2005-08-16 19:17:01 -08:00
mpm@selenic.com
5bcea47997 Add basic https support for pull 2005-08-16 17:12:25 -08:00
mpm@selenic.com
8ff3edc761 whitespace cleanup 2005-08-16 15:30:26 -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
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
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
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
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
mpm@selenic.com
505146283c Merge with TAH 2005-08-12 23:54:09 -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
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
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
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
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
mpm@selenic.com
9161f5c8e4 Merge with BOS 2005-08-02 08:57:32 -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
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