Make syncfoldersto to accept a single folder only

It is just historic relict

Signed-off-by: Vladimir Marek <vlmarek@volny.cz>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Vladimir Marek 2011-08-16 10:55:16 +02:00 committed by Nicolas Sebrecht
parent b6ac1aecb1
commit c2fc81dd3d
2 changed files with 5 additions and 6 deletions

View File

@ -233,7 +233,7 @@ class SyncableAccount(Account):
# replicate the folderstructure from REMOTE to LOCAL
if not localrepos.getconf('readonly', False):
self.ui.syncfolders(remoterepos, localrepos)
remoterepos.syncfoldersto(localrepos, [statusrepos])
remoterepos.syncfoldersto(localrepos, statusrepos)
# iterate through all folders on the remote repo and sync
for remotefolder in remoterepos.getfolders():

View File

@ -114,12 +114,12 @@ class BaseRepository(object, CustomConfig.ConfigHelperMixin):
def getfolder(self, foldername):
raise NotImplementedError
def syncfoldersto(self, dest, copyfolders):
def syncfoldersto(self, dest, status):
"""Syncs the folders in this repository to those in dest.
It does NOT sync the contents of those folders.
For every time dest.makefolder() is called, also call makefolder()
on each folder in copyfolders."""
Whenever makefolder() is called, also call makefolder() on status
folder."""
src = self
srcfolders = src.getfolders()
destfolders = dest.getfolders()
@ -143,8 +143,7 @@ class BaseRepository(object, CustomConfig.ConfigHelperMixin):
if not key in desthash:
try:
dest.makefolder(key)
for copyfolder in copyfolders:
copyfolder.makefolder(key.replace(dest.getsep(), copyfolder.getsep()))
status.makefolder(key.replace(dest.getsep(), status.getsep()))
except (KeyboardInterrupt):
raise
except: