Commit Graph

57 Commits

Author SHA1 Message Date
Matt Mackall
2f4925d536 remoterepo: no longer needed
All users already use repo.local() to test for local, which is false
in the repository base class. statichttprepository never derived from
this class anyway.
2008-03-20 11:12:35 -05:00
Joel Rosdahl
4f8012378a Remove unused imports 2008-03-06 22:23:41 +01:00
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Alexis S. L. Carvalho
961a45df72 merge with crew-stable 2008-02-03 21:47:07 -02:00
Alexis S. L. Carvalho
65d93076b9 sshrepo: be more careful while reading data
This should avoid some tracebacks when the server sends some garbage.
2008-02-03 21:03:46 -02:00
Bryan O'Sullivan
3cd6b499f4 Fix typo. 2008-01-18 17:01:28 -08:00
Steve Borho
caa5fee772 win32: fix ssh://host:port when using Plink
Moves ssh argument building to platform specific utils code.
The win32 version looks for plink in ssh command string and
uses '-P' in lieu of '-p' for specifying a port
2007-12-12 16:44:26 -06:00
Patrick Mezard
7c1d0710ee Merge with crew-stable 2007-09-10 23:53:23 +02:00
Alexis S. L. Carvalho
29dea75576 sshrepo: fix Windows command quoting 2007-09-10 23:34:33 +02:00
Bryan O'Sullivan
6fbb9f2f2f Push capability checking into protocol-level code. 2007-08-27 14:48:08 -07:00
Bryan O'Sullivan
eba82ab39c Turn capabilities into a mutable set, instead of a fixed tuple. 2007-08-27 14:16:04 -07:00
Alexis S. L. Carvalho
1ee06d75a7 Merge with crew-stable 2007-08-17 23:20:13 -03:00
Alexis S. L. Carvalho
11336d4a94 Fix sshrepo.unbundle
We weren't reading all the data sent by the server.  Depending on
the system, the remote hg (actually, the remote python) could send a
"close failed: [Errno 32] Broken pipe", making some tests fail.
2007-08-17 22:43:38 -03:00
Matt Mackall
2bf7253b8a fix-up references to repo.RepoError 2007-08-15 16:10:24 -05:00
Matt Mackall
296d6a7cb8 Simplify i18n imports 2006-12-14 20:25:19 -06:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Thomas Arendsen Hein
5a535feaec Use UnexpectedOutput exception instead of RepoError in sshrepo, too. 2006-12-02 22:16:00 +01:00
Thomas Arendsen Hein
50e4cfc1b5 Change sshrepo.repoerror() into a more flexible sshrepo.raise_().
Now every exception can be raised with a cleanup, not only hg.RepoError.
2006-12-02 22:15:18 +01:00
Thomas Arendsen Hein
b5dd2b79f8 Don't show traceback on 'hg clone -r unknown ssh://hg.example.com/'. 2006-12-02 21:57:20 +01:00
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