[svn r38378] snapshot commit for: each rsync root is now copied to

remote-topdir.join(root.basename)

--HG--
branch : trunk
This commit is contained in:
hpk 2007-02-10 14:21:26 +01:00
parent 663447a7d1
commit e11e7472bc
2 changed files with 8 additions and 5 deletions

View File

@ -139,7 +139,10 @@ class HostManager(object):
for root in self.roots:
rsync = HostRSync(root, ignores=ignores,
verbose=self.config.option.verbose)
destrelpath = root.relto(self.config.topdir)
if root == self.config.topdir:
destrelpath =""
else:
destrelpath = root.basename
for host in self.hosts:
rsync.add_target_host(host, destrelpath, reporter)
rsync.send(raises=False)

View File

@ -170,6 +170,7 @@ class TestHostManager(DirSetup):
dir2 = self.source.ensure("dir1", "dir2", dir=1)
dir2.ensure("hello")
config = py.test.config._reparse([self.source])
assert config.topdir == self.source
hm = HostManager(config,
hosts=[HostInfo("localhost:" + str(self.dest))])
events = []
@ -191,11 +192,9 @@ class TestHostManager(DirSetup):
hosts=[HostInfo("localhost:" + str(self.dest))])
events = []
hm.init_rsync(reporter=events.append)
assert self.dest.join("dir1").check()
assert self.dest.join("dir1", "dir2").check()
assert self.dest.join("dir1", "dir2", 'hello').check()
assert self.dest.join("dir2").check()
assert not self.dest.join("dir1").check()
assert not self.dest.join("bogus").check()
assert not self.dest.join("dir1", "somefile").check()
def test_hostmanager_rsync_ignore(self):
dir2 = self.source.ensure("dir1", "dir2", dir=1)
@ -209,6 +208,7 @@ class TestHostManager(DirSetup):
hm = HostManager(config,
hosts=[HostInfo("localhost:" + str(self.dest))])
events = []
print events
hm.init_rsync(reporter=events.append)
assert self.dest.join("dir1").check()
assert not self.dest.join("dir1", "dir2").check()