Jump to content

Thomas Winged

Members
  • Posts

    1
  • Joined

  • Last visited

Thomas Winged's Achievements

Newbie

Newbie (1/14)

  • One Month Later Rare
  • Week One Done Rare
  • First Post Rare

Recent Badges

0

Reputation

  1. I could not find a proper way to solve the evil twin directory conflict merge automatically by PlasticSCM while keeping files from both directories, so I wrote a simple Python script that helps me do it. import os import shutil src_dir = "C:\scm\ProjectName\Content\_ExternalActors__\Maps\MyMap" # Iterate over all subdirectories in given src_path for root, dirs, files in os.walk(src_dir): for dirname in dirs: # Search for folders with a "_dst" suffix, such as "C:\scm\ProjectName\Content\_ExternalActors__\Maps\MyMap\0\RQ_dst" if dirname.endswith("_dst"): dst_dir = os.path.join(root, dirname[:-4]) src_dst_dir = os.path.join(root, dirname) # If a folder with the "_dst" suffix is found, moves all files within it to the parent directory without the suffix, such as "C:\scm\ProjectName\Content\_ExternalActors__\Maps\MyMap\0\RQ" for file in os.listdir(src_dst_dir): src_file = os.path.join(src_dst_dir, file) dst_file = os.path.join(dst_dir, file) print(f"Moving: [{src_file}] >> [{dst_file}]") shutil.move(src_file, dst_file) # Finally, delete the now-empty directory with the "_dst" suffix print(f"Removing [{src_dst_dir}]") os.rmdir(src_dst_dir) So to make the merge, first I need to select to keep both changes - it will introduce new directory with `_dst` suffix: Running the script merges all directories with `_dst` back to the directory without the suffix: I wish PlasticSCM solves this problem by itself, maybe one day...
×
×
  • Create New...