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 # replicate the folderstructure from REMOTE to LOCAL
if not localrepos.getconf('readonly', False): if not localrepos.getconf('readonly', False):
self.ui.syncfolders(remoterepos, localrepos) self.ui.syncfolders(remoterepos, localrepos)
remoterepos.syncfoldersto(localrepos, [statusrepos]) remoterepos.syncfoldersto(localrepos, statusrepos)
# iterate through all folders on the remote repo and sync # iterate through all folders on the remote repo and sync
for remotefolder in remoterepos.getfolders(): for remotefolder in remoterepos.getfolders():

View File

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