Merge branch 'deleted-folders'
This commit is contained in:
commit
637021897e
@ -145,7 +145,7 @@ class AccountSynchronizationMixin:
|
|||||||
localrepos = self.localrepos
|
localrepos = self.localrepos
|
||||||
statusrepos = self.statusrepos
|
statusrepos = self.statusrepos
|
||||||
self.ui.syncfolders(remoterepos, localrepos)
|
self.ui.syncfolders(remoterepos, localrepos)
|
||||||
remoterepos.syncfoldersto(localrepos)
|
remoterepos.syncfoldersto(localrepos, [statusrepos])
|
||||||
|
|
||||||
folderthreads = []
|
folderthreads = []
|
||||||
for remotefolder in remoterepos.getfolders():
|
for remotefolder in remoterepos.getfolders():
|
||||||
|
@ -125,9 +125,12 @@ class BaseRepository(CustomConfig.ConfigHelperMixin):
|
|||||||
def getfolder(self, foldername):
|
def getfolder(self, foldername):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def syncfoldersto(self, dest):
|
def syncfoldersto(self, dest, copyfolders):
|
||||||
"""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()
|
||||||
|
on each folder in copyfolders."""
|
||||||
src = self
|
src = self
|
||||||
srcfolders = src.getfolders()
|
srcfolders = src.getfolders()
|
||||||
destfolders = dest.getfolders()
|
destfolders = dest.getfolders()
|
||||||
@ -150,6 +153,8 @@ class BaseRepository(CustomConfig.ConfigHelperMixin):
|
|||||||
for key in srchash.keys():
|
for key in srchash.keys():
|
||||||
if not key in desthash:
|
if not key in desthash:
|
||||||
dest.makefolder(key)
|
dest.makefolder(key)
|
||||||
|
for copyfolder in copyfolders:
|
||||||
|
copyfolder.makefolder(key)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Find deleted folders.
|
# Find deleted folders.
|
||||||
|
@ -37,8 +37,8 @@ class LocalStatusRepository(BaseRepository):
|
|||||||
return os.path.join(self.directory, foldername)
|
return os.path.join(self.directory, foldername)
|
||||||
|
|
||||||
def makefolder(self, foldername):
|
def makefolder(self, foldername):
|
||||||
# "touch" the file.
|
# "touch" the file, truncating it.
|
||||||
file = open(self.getfolderfilename(foldername), "ab")
|
file = open(self.getfolderfilename(foldername), "wb")
|
||||||
file.close()
|
file.close()
|
||||||
# Invalidate the cache.
|
# Invalidate the cache.
|
||||||
self.folders = None
|
self.folders = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user