Commit Graph

201 Commits

Author SHA1 Message Date
Vadim Gelfer
b365694c04 fetch: hold lock and wlock across all operations 2006-08-08 17:08:59 -07:00
Matt Mackall
3dcc28a29a Merge with crew 2006-08-07 16:47:06 -05:00
Vadim Gelfer
dc56cac613 localrepo.update: allow to suppress commit reminder. 2006-08-07 17:22:17 -07:00
Matt Mackall
d5009b5b05 Move repo.verify 2006-08-07 16:27:09 -05:00
Brendan Cully
b5f7a6230c Add '.' as a shortcut revision name for the working directory parent. 2006-08-04 14:36:03 -07:00
Matt Mackall
65b6faa1aa Move merge code to its own module
Pull update and merge3 out of localrepo into merge.py
s/self/repo/
Add temporary API function in hg.py
Convert all users
2006-08-03 15:24:41 -05:00
Vadim Gelfer
b7a96d1742 clean up hg.py: move repo constructor code into each repo module 2006-07-31 07:11:12 -07:00
Vadim Gelfer
0778999161 hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
all repository classes now have url() method that returns url of repo.
2006-07-25 13:50:32 -07:00
Vadim Gelfer
9738466350 status: add -c (clean) and -A (all files) options
also add new localrepo.status what is more uniform than localrepo.changes.
localrepo.changes is deprecated and will go away soon.
2006-07-20 16:21:07 -07:00
Vadim Gelfer
f7b6882acb clone: disable stream support on server side by default.
enable in hgrc like this:
[server]
stream=True
2006-07-15 16:06:35 -07:00
Vadim Gelfer
4bc0558c57 clone: do not make streaming default. add --stream option instead. 2006-07-14 14:51:36 -07:00
Vadim Gelfer
9ea4436262 add support for streaming clone.
existing clone code uses pull to get changes from remote repo.  is very
slow, uses lots of memory and cpu.

new clone code has server write file data straight to client, client
writes file data straight to disk.  memory and cpu used are very low,
clone is much faster over lan.

new client can still clone with pull, can still clone from older servers.
new server can still serve older clients.
2006-07-14 11:17:22 -07:00
Vadim Gelfer
a7c3b963b0 move most of tag code to localrepository class. 2006-07-12 08:59:20 -07:00
Benoit Boissinot
be9e8c572e allow use of extensions in python hooks
extensions are loaded with hgext_ prefix, try to use them if
the module is not found in the normal path
2006-07-09 11:10:11 +02:00
Benoit Boissinot
79ae0c65b1 coding style: use spaces instead of tabs 2006-07-08 16:55:49 +02:00
Matt Mackall
ae5d801274 Merge context patches 2006-07-05 13:28:25 -05:00
Vadim Gelfer
95fcf73027 merge with crew. 2006-07-03 10:19:09 -07:00
Thomas Arendsen Hein
96ef4def0a Clarified message when nothing to merge is seen.
Sometimes there's a non-tip head waiting to be merged, especially after
pulling in remote changes while there were local modifications in the working
directory which had to be committed before 'hg merge' can work.
2006-07-03 19:14:29 +02:00
Sean Meiners
34ff4a6539 Added ability to clone from a local repository to a (new) remote one.
Rearranged the clone command a good bit to make sure it validates that
the source does exist and that the destination doesn't before doing anything.
Before I moved the source repo check it would create the destination
repository before it verified the source existed.

Moved the responsibility for creating the destination repo root directory
entirly into the localrepo class so that local to local cloning doesn't break.
This also simplifies the code a bit since it's no longer being done in both
clone and init.

Changed the names of the 'repo' and 'other' variables to 'dest_repo' and
'src_repo' to maintain my sanity.

Passes 82/83 tests. The only failure is the version number test, which I
suspect is supposed to fail since it comes from a generated file.
2006-06-30 19:24:02 -07:00
Matt Mackall
828e814bf2 Add context helper functions to localrepo 2006-06-28 17:08:10 -05:00
Chris Mason
2124a015d1 Fix localrepo.changes() Correctly decide if we are diffing the working dir 2006-06-23 16:42:48 -07:00
Vadim Gelfer
c6946676ed fix bug in localrepo.changes.
caused by a7bed91ac70412cad91b76f93863bba06d289ff4.
2006-06-21 16:20:21 -07:00
Vadim Gelfer
f6098bdc1f merge with crew. 2006-06-21 09:32:31 -07:00
Chris Mason
4bb4096145 Fix cold cache diff performance
cold cache diff performance has regressed in two ways.  localrepo.changes
has optimizations for diffing against the working dir parent that expect
node1 to be None.  commands.revpair() usage means that commands.dodiff()
never sends node1 == None.  This is fixed in localrepo.changes by checking
against the dirstate parents.

In the non-dirstate parents case, localrepo.changes does a loop comparing
files without first sorting the file names, leading to random access
across the disk.
2006-06-21 09:28:48 -07:00
Vadim Gelfer
cbbcaa74fe merge with crew. 2006-06-20 23:58:45 -07:00
Vadim Gelfer
9a0c813fdc use demandload more. 2006-06-20 23:58:21 -07:00
Vadim Gelfer
f40e35da3c localrepository.push: propagate return value 2006-06-20 15:14:12 -07:00
Vadim Gelfer
6144b74dd7 replace os.stat with os.lstat in some where. 2006-06-16 12:58:24 -07:00
Vadim Gelfer
9117f9f380 extend network protocol to stop clients from locking servers
now all repositories have capabilities slot, tuple with list of names.

if 'unbundle' capability present, repo supports push where client does
not need to lock server.  repository classes that have unbundle capability
also have unbundle method.

implemented for ssh now, will be base for push over http.

unbundle protocol acts this way.  server tells client what heads it
has during normal negotiate step.  client starts unbundle by repeat
server's heads back to it.  if server has new heads, abort immediately.
otherwise, transfer changes to server.  once data transferred, server
locks and checks heads again.  if heads same, changes can be added.
else someone else added heads, and server aborts.

if client wants to force server to add heads, sends special heads list of
'force'.
2006-06-15 16:37:23 -07:00
Thomas Arendsen Hein
56a3c0876e Report on push/pull if heads are merged, too, like for new heads.
Use case: If a remote repo has two heads and I _want_ to merge them, I merge
and push. Meanwhile someone else pushed on top of one of the heads. He won't
get a warning, because he doesn't create a new head, I won't notice that I
don't close a head, because I don't get a message telling me.
2006-06-10 17:39:29 +02:00
Benoit Boissinot
55cbea1661 remove appendfile for the manifest when adding a changegroup
Since the changelog is using appendfile, the manifest entries cannot
be referenced, so we don't need to use append file for the manifest.
2006-06-04 17:46:33 +02:00
Thomas Arendsen Hein
4b040d1963 Renamed localrepo.undo() to rollback() and talk about "rollback information". 2006-06-01 19:08:29 +02:00
Thomas Arendsen Hein
5800bfc290 Manifest groups may be empty, so don't abort in this case (fixes issue210).
Only abort on empty changelog and file revlogs.
2006-05-31 22:25:20 +02:00
Benoit Boissinot
7f2c70ddf8 use a more reliable way to find what are the new changesets on pull/unbundle
The number of csets and the hooks where wrong (negative number of csets) when
we unbundled a bundle which contains csets we already had.
Remove unused variables.
2006-05-24 10:59:30 +02:00
Benoit Boissinot
d91b489a27 merge with crew 2006-05-24 09:27:16 +02:00
Benoit Boissinot
c070465611 n is always 'True', we can only stop the loop with the break statement 2006-05-24 01:01:39 +02:00
Benoit Boissinot
ba6fa6a223 document and fix findincoming
- add documentation about what the function does, notably
  the fact that it updates 'base'
- transform the workflow to a more simple 'if elif elif else'
- do not call remote.branches if not necessary
- some nodes where missing in 'base' (from what I understand,
  if the root of a branch is missing but one parent is present,
  the parent should be in 'base')
- add a testcase for an incorrect outgoing that is fixed by
  this cset
- add a testcase for an empty group bug, it needs fixing
2006-05-23 10:44:40 +02:00
Vadim Gelfer
b8bc35963b add ui.print_exc(), make all traceback printing central. 2006-05-22 08:47:53 -07:00
Vadim Gelfer
5eb540c338 fix parsing of tags. make parse errors useful. add new tag tests.
old code read every head of .hgtags. delete and recreate of .hgtags gave
new head, but if error in deleted rev, .hgtags had error messages every
time it was parsed. this was very hard to fix, because deleted revs hard
to get back and update, needed merges too.

new code reads .hgtags on every head. advantage is if parse error
happens with new code, is possible to fix them by editing .hgtags on a
head and committing.

NOTE: new code uses binary search of manifest of each head to be fast,
but still much slower than old code. best thing would be to have delete
record stored in filelog so we never touch manifest. could find live
heads directly from filelog. this is more work than i want now.

new tests check for parse of tags on different heads, and inaccessible
heads created by delete and recreate of .hgtags.
2006-05-18 23:31:12 -07:00
Thomas Arendsen Hein
be0ce7238f Strip empty lines and trailing spaces around commit messages.
Fixes issue213 and part of issue249 (trying to keep node id on import)
2006-05-17 19:38:41 +02:00
Vadim Gelfer
aa621a0ae1 remove non-prefixed environment variables from hooks. 2006-05-15 09:13:00 -07:00
Vadim Gelfer
c278e6a6c4 merge with crew. 2006-05-11 14:46:24 -07:00
john.levon@sun.com
28c6c53f5e Force editor to appear for an 'hg backout' if a message or logfile aren't
supplied. Pre-fill the commit message with the changeset being backed out.
Fixes bug 238.
2006-05-11 14:32:09 -07:00
Vadim Gelfer
1f1118a083 hooks: add preupdate and update hooks.
preupdate run before working dir updated. can prevent update.
update run after working dir updated.
2006-05-11 10:14:48 -07:00
Vadim Gelfer
0a3e1cd1e7 localrepo.update: abort if outstanding merges, instead of warn/return 1 2006-05-11 09:43:50 -07:00
Benoit Boissinot
7994bf99a6 fix a traceback when unbundling does not add any changesets
only run the hooks when some changesets has been added
2006-05-11 15:01:30 +02:00
Thomas Arendsen Hein
571a43feca Always remove appendopener tmp files (fixes issue235).
test-hup triggered this bug by killing "hg serve --stdio".
2006-05-09 17:03:00 +02:00
Vadim Gelfer
990eecd90f localrepository.addchangegroup: add more source infos to hooks 2006-05-08 16:50:27 -07:00
Vadim Gelfer
724c8bd48c changegroup hooks: add source to hook parameters 2006-05-08 16:07:56 -07:00
mason@suse.com
58d4ef2538 Use revlogng and inlined data files by default
This changes revlog specify revlogng by default.  Inlined
data files are also used unless a flags option is found in the .hgrc.
Some example hgrc files:

[revlog]
# use the original revlog format
format=0

[revlog]
# use revlogng.  Because no flags are included, inlined data files
# also be selected
format=1

[revlog]
# use revlogng but do not inline the data files with the index
flags=

[revlog]
# the new default
format=1
flags=inline
2006-05-08 14:26:18 -05:00