refector (baby steps)

This commit is contained in:
2014-12-03 17:54:45 +01:00
parent 4880615660
commit 7d7045060c
2 changed files with 30 additions and 29 deletions

View File

@@ -518,10 +518,7 @@ class bam_commands:
return b'//' + os.path.relpath(f[3:], proj_base_b)
return None
for f_rel, f_abs in list(paths_modified.items()):
# we may want to be more clever here
if 1:
def remap_file(f_rel, f_abs):
f_abs_remap = os.path.join(basedir_temp, f_rel)
dir_remap = os.path.dirname(f_abs_remap)
os.makedirs(dir_remap, exist_ok=True)
@@ -542,12 +539,15 @@ class bam_commands:
deps_remap_cb=remap_cb,
deps_remap_cb_userdata=proj_base_b,
)
return f_abs_remap
for f_rel, f_abs in list(paths_modified.items()):
f_abs_remap = remap_file(f_rel, f_abs)
if os.path.exists(f_abs_remap):
f_abs = f_abs_remap
paths_modified[f_rel] = f_abs
paths_modified[f_rel] = f_abs_remap
else:
"""
deps = deps_remap.get(f_rel)
if deps:
# ----
@@ -565,6 +565,7 @@ class bam_commands:
if os.path.exists(f_abs_remap):
f_abs = f_abs_remap
paths_modified[f_rel] = f_abs
"""
# -------------------------

View File

@@ -1162,7 +1162,7 @@ class BamRelativeAbsoluteTest(BamSessionTestCase):
stdout, stderr = bam_run(["checkout", blendfile, "--output", session_path], proj_path)
self.assertEqual("", stderr)
_check()
_dbg_dump_path(session_path)
# _dbg_dump_path(session_path)
def test_absolute_relative_from_blendfiles(self):
"""
@@ -1257,7 +1257,7 @@ class BamRelativeAbsoluteTest(BamSessionTestCase):
# XXX (end hack!)
_dbg_dump_path(session_path)
# _dbg_dump_path(session_path)
stdout, stderr = bam_run(["commit", "-m", "new house to remap"], session_path)
self.assertEqual("", stderr)