refector (baby steps)
This commit is contained in:
@@ -518,10 +518,7 @@ class bam_commands:
|
|||||||
return b'//' + os.path.relpath(f[3:], proj_base_b)
|
return b'//' + os.path.relpath(f[3:], proj_base_b)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
for f_rel, f_abs in list(paths_modified.items()):
|
def remap_file(f_rel, f_abs):
|
||||||
# we may want to be more clever here
|
|
||||||
|
|
||||||
if 1:
|
|
||||||
f_abs_remap = os.path.join(basedir_temp, f_rel)
|
f_abs_remap = os.path.join(basedir_temp, f_rel)
|
||||||
dir_remap = os.path.dirname(f_abs_remap)
|
dir_remap = os.path.dirname(f_abs_remap)
|
||||||
os.makedirs(dir_remap, exist_ok=True)
|
os.makedirs(dir_remap, exist_ok=True)
|
||||||
@@ -542,12 +539,15 @@ class bam_commands:
|
|||||||
deps_remap_cb=remap_cb,
|
deps_remap_cb=remap_cb,
|
||||||
deps_remap_cb_userdata=proj_base_b,
|
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):
|
if os.path.exists(f_abs_remap):
|
||||||
f_abs = f_abs_remap
|
paths_modified[f_rel] = f_abs_remap
|
||||||
paths_modified[f_rel] = f_abs
|
|
||||||
|
|
||||||
else:
|
|
||||||
|
"""
|
||||||
deps = deps_remap.get(f_rel)
|
deps = deps_remap.get(f_rel)
|
||||||
if deps:
|
if deps:
|
||||||
# ----
|
# ----
|
||||||
@@ -565,6 +565,7 @@ class bam_commands:
|
|||||||
if os.path.exists(f_abs_remap):
|
if os.path.exists(f_abs_remap):
|
||||||
f_abs = f_abs_remap
|
f_abs = f_abs_remap
|
||||||
paths_modified[f_rel] = f_abs
|
paths_modified[f_rel] = f_abs
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
@@ -1162,7 +1162,7 @@ class BamRelativeAbsoluteTest(BamSessionTestCase):
|
|||||||
stdout, stderr = bam_run(["checkout", blendfile, "--output", session_path], proj_path)
|
stdout, stderr = bam_run(["checkout", blendfile, "--output", session_path], proj_path)
|
||||||
self.assertEqual("", stderr)
|
self.assertEqual("", stderr)
|
||||||
_check()
|
_check()
|
||||||
_dbg_dump_path(session_path)
|
# _dbg_dump_path(session_path)
|
||||||
|
|
||||||
def test_absolute_relative_from_blendfiles(self):
|
def test_absolute_relative_from_blendfiles(self):
|
||||||
"""
|
"""
|
||||||
@@ -1257,7 +1257,7 @@ class BamRelativeAbsoluteTest(BamSessionTestCase):
|
|||||||
# XXX (end hack!)
|
# 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)
|
stdout, stderr = bam_run(["commit", "-m", "new house to remap"], session_path)
|
||||||
self.assertEqual("", stderr)
|
self.assertEqual("", stderr)
|
||||||
|
Reference in New Issue
Block a user