|
19 | 19 | from .utils import ( |
20 | 20 | generate_checksum, |
21 | 21 | is_versioned_file, |
| 22 | + is_path_too_long, |
22 | 23 | int_version, |
23 | 24 | do_sqlite_checkpoint, |
24 | 25 | unique_path_name, |
@@ -623,8 +624,14 @@ def get_local_delta(self, diff_directory: str) -> List[ProjectDeltaChange]: |
623 | 624 | delta_item.size = checkpoint_size |
624 | 625 | delta_item.checksum = checkpoint_checksum |
625 | 626 |
|
| 627 | + diff_location = self.fpath(diff_file, diff_directory) |
| 628 | + if is_path_too_long(diff_location): |
| 629 | + raise ClientError( |
| 630 | + f"Cannot create changeset for '{path}': diff file path is too long " |
| 631 | + f"({len(diff_location)} characters) for this OS: {diff_location}\n" |
| 632 | + "Move the project to a directory with a shorter path and try again." |
| 633 | + ) |
626 | 634 | try: |
627 | | - diff_location = self.fpath(diff_file, diff_directory) |
628 | 635 | self.geodiff.create_changeset(origin_file, current_file, diff_location) |
629 | 636 | if not self.geodiff.has_changes(diff_location): |
630 | 637 | os.remove(diff_location) |
@@ -677,6 +684,12 @@ def get_push_changes(self): |
677 | 684 | diff_id = str(uuid.uuid4()) |
678 | 685 | diff_name = path + "-diff-" + diff_id |
679 | 686 | diff_file = self.fpath_meta(diff_name) |
| 687 | + if is_path_too_long(diff_file): |
| 688 | + raise ClientError( |
| 689 | + f"Cannot create changeset for '{path}': diff file path is too long " |
| 690 | + f"({len(diff_file)} characters) for this OS: {diff_file}\n" |
| 691 | + "Move the project to a directory with a shorter path and try again." |
| 692 | + ) |
680 | 693 | try: |
681 | 694 | self.geodiff.create_changeset(origin_file, current_file, diff_file) |
682 | 695 | if self.geodiff.has_changes(diff_file): |
|
0 commit comments