summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index d431c02e..ecb89a10 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -154,6 +154,14 @@ uncommitted changes are present' % project.relpath
154 else: 154 else:
155 print >>sys.stderr, 'Deleting obsolete path %s' % project.worktree 155 print >>sys.stderr, 'Deleting obsolete path %s' % project.worktree
156 shutil.rmtree(project.worktree) 156 shutil.rmtree(project.worktree)
157 # Try deleting parent subdirs if they are empty
158 dir = os.path.dirname(project.worktree)
159 while dir != self.manifest.topdir:
160 try:
161 os.rmdir(dir)
162 except OSError:
163 break
164 dir = os.path.dirname(dir)
157 165
158 fd = open(file_path, 'w') 166 fd = open(file_path, 'w')
159 try: 167 try: