Commit Graph

38 Commits

Author SHA1 Message Date
Benoit Boissinot
6358cf0eea sshrepo: fix the parsing of the ssh url 2006-10-31 23:56:52 +01:00
Eric Hopper
68a9f0d42a sshrepo: add passing of lookup exceptions 2006-09-09 18:25:06 -07:00
Eric Hopper
cab8740b9b Adding changegroupsubset and lookup to ssh protocol so pull -r and
clone -r can be supported.
2006-09-09 18:25:06 -07:00
Alexis S. L. Carvalho
189bc7b5b8 portability fix for test-ssh
The __del__ method of sshrepo reads the stderr of the remote process
until EOF and prints it.

If an exception is raised, this method ends up being called:
- on Linux: after the "abort: ..." message is printed
- on OS X: before the "abort: ..." message is printed

This patch explicitly flushes the stderr of the remote process before
raising a RepoError.
2006-10-12 20:45:25 -03:00
Benoit Boissinot
3a1d29d975 ssh: make the error message more clear, add a testcase 2006-10-06 16:24:14 +02:00
Benoit Boissinot
2baab981fb sshrepo: don't try to validate when creating the repo
- This removes the "repo not found" error when cloning or init-ing a remote
  repo.
- Since the remote hg will abort if the repo already exists we don't need to
  validate it.
2006-09-13 19:57:40 +02:00
Benoit Boissinot
955f1cbc96 sshrepo: when creating a repo, raise an error if it already exists 2006-09-02 23:14:35 +02:00
Benoit Boissinot
45f114cbf2 sshrepo: flush stderr before connecting to the hg server 2006-09-02 21:08:54 +02:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07: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
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
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
Vadim Gelfer
df5378a901 remove duplicate code. 2006-06-21 22:45:29 -07:00
Vadim Gelfer
fb46b0c6ed change some repo messages in small ways.
move "pushing" and "pulling" after repo create so error message and exit
happens before messages printed.

fix sshrepo parse error message.
2006-06-21 09:15:42 -07:00
Benoit Boissinot
c52f027dd4 fix unused variable warning from pychecker 2006-06-17 18:15:48 +02:00
Vadim Gelfer
db0725df5c remove use of undefined variable. 2006-06-15 16:41:49 -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
Matt Mackall
6452b6e88f ssh: add capability detection at startup
Because older servers don't return any output for unknown commands,
it's tricky to add new commands. The approach is this: we add a
"hello" command that reports any interesting capabilities (and other
things that might be of interest in the future). To detect whether
this new command is supported, we issue both it and our startup
detection command ("between") at the beginning of a connection.
2006-06-09 18:03:35 -05:00
Matt Mackall
e9d5610b1d ssh: gather initial output so we can do capability detection 2006-06-09 17:48:14 -05:00
Vadim Gelfer
990eecd90f localrepository.addchangegroup: add more source infos to hooks 2006-05-08 16:50:27 -07:00
Vadim Gelfer
75ddc9a984 merge with crew. 2006-05-02 14:37:55 -07:00
Vadim Gelfer
fad839fb0b fix file handling bugs on windows.
add util.posixfile class that has posix semantics on windows.
fix util.rename so it works with stupid windows delete semantics.
2006-05-02 14:30:00 -07:00
Thomas Arendsen Hein
4dbe15ce56 Show remote ssh noise only with --debug and increase the limit to 500 lines.
Messages can already be sent to the user over stderr, if one really wants this.
2006-04-04 15:21:20 +02:00
Thomas Arendsen Hein
ec1964014b Don't enter an endless loop if remote hg doesn't answer, show remote noise.
The endless loop is not only triggered if the remote shell is too noisy, but
even if the local ssh command dies due to an error.
2006-04-02 22:12:56 +02:00
Matt Mackall
8afffd9943 ssh: skip noise generated by remote shell
we send a dummy command with known output to get in sync
2006-03-31 03:25:35 -06:00
Vadim Gelfer
dfe0de6855 add merge command. means same thing as "update -m".
repo.addchangegroup method now returns number of heads modified and added,
so command line can tell whether update or merge needed.  this makes
tiny change to ssh wire protocol, but change is backwards compatible.

pull command now returns 0 if no changes to pull.
2006-03-29 10:27:16 -08:00
Vadim Gelfer
d1f78f49f0 add preoutgoing and outgoing hooks.
preoutgoing lets prevent pull over http or ssh.
outgoing lets notify after pull.
2006-02-17 08:26:21 -08:00
Benoit Boissinot
06e39e559b i18n part2: use '_' for all strings who are part of the user interface 2005-10-18 18:38:39 -07:00
Benoit Boissinot
e38e94088a i18n first part: make '_' available for files who need it 2005-10-18 18:37:48 -07:00
Matt Mackall
4cdf6634b7 Partially revert ssh change so we read all of remote ssh stream 2005-09-27 15:23:34 -07:00
zbynek@alex.kolej.mff.cuni.cz
2a6dbbb3ad Replacing select.select() with os.fstat() which works also on windows. 2005-09-27 15:01:49 -07:00
Bryan O'Sullivan
d4053cffa7 Help debugability: print ssh command being used when --verbose. 2005-09-23 10:32:19 -07:00
Bryan O'Sullivan
7efdcdb874 Give ssh a better chance of working on Windows.
Switch the type of quotes used for the remote command.
Open the pipe in binary mode.
2005-09-23 10:30:41 -07:00
Bryan O'Sullivan
d5a9cb0366 Fix lots of exception-related problems.
These have been around since the Big Code Split.
2005-09-14 15:41:22 -07:00
mpm@selenic.com
81de2b609e Fix sshrepo imports 2005-08-27 16:40:24 -07:00
mpm@selenic.com
5679905bd5 sshrepo: adjust file comment 2005-08-27 15:05:59 -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