p4cmd 2.9.0__tar.gz → 2.9.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {p4cmd-2.9.0 → p4cmd-2.9.2}/PKG-INFO +1 -1
  2. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/__init__.py +1 -1
  3. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/p4cmd.py +9 -1
  4. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd.egg-info/PKG-INFO +1 -1
  5. {p4cmd-2.9.0 → p4cmd-2.9.2}/tests/test_p4client.py +17 -0
  6. {p4cmd-2.9.0 → p4cmd-2.9.2}/LICENSE +0 -0
  7. {p4cmd-2.9.0 → p4cmd-2.9.2}/README.md +0 -0
  8. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/p4errors.py +0 -0
  9. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/p4file.py +0 -0
  10. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/__init__.py +0 -0
  11. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/perforce_DEPOT_ONLY.png +0 -0
  12. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/perforce_MOVED.png +0 -0
  13. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/perforce_NEED_SYNC.png +0 -0
  14. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/perforce_OPEN_FOR_ADD.png +0 -0
  15. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/perforce_OPEN_FOR_DELETE.png +0 -0
  16. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/perforce_OPEN_FOR_EDIT.png +0 -0
  17. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/perforce_UNKNOWN.png +0 -0
  18. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/perforce_UNTRACKED.png +0 -0
  19. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/resources/perforce_UP_TO_DATE.png +0 -0
  20. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd/utils.py +0 -0
  21. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd.egg-info/SOURCES.txt +0 -0
  22. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd.egg-info/dependency_links.txt +0 -0
  23. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd.egg-info/requires.txt +0 -0
  24. {p4cmd-2.9.0 → p4cmd-2.9.2}/p4cmd.egg-info/top_level.txt +0 -0
  25. {p4cmd-2.9.0 → p4cmd-2.9.2}/setup.cfg +0 -0
  26. {p4cmd-2.9.0 → p4cmd-2.9.2}/setup.py +0 -0
  27. {p4cmd-2.9.0 → p4cmd-2.9.2}/tests/__init__.py +0 -0
  28. {p4cmd-2.9.0 → p4cmd-2.9.2}/tests/conftest.py +0 -0
  29. {p4cmd-2.9.0 → p4cmd-2.9.2}/tests/test_integration.py +0 -0
  30. {p4cmd-2.9.0 → p4cmd-2.9.2}/tests/test_p4file.py +0 -0
  31. {p4cmd-2.9.0 → p4cmd-2.9.2}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p4cmd
3
- Version: 2.9.0
3
+ Version: 2.9.2
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
@@ -1,4 +1,4 @@
1
- VERSION = "2.9.0"
1
+ VERSION = "2.9.2"
2
2
 
3
3
  from .p4cmd import P4Client
4
4
  from .p4file import P4File
@@ -605,6 +605,8 @@ class P4Client(object):
605
605
  if verify:
606
606
  local_file_paths = self.get_local_paths(file_list)
607
607
  for local_file_path in local_file_paths:
608
+ if local_file_path is None:
609
+ continue
608
610
  if not os.path.isfile(local_file_path):
609
611
  logging.warning(f"File didn't exist after syncing, try force syncing it instead: {local_file_path}")
610
612
 
@@ -1160,7 +1162,11 @@ class P4Client(object):
1160
1162
  no_rev_paths.append("{}{}".format(path_without_ext, path_ext))
1161
1163
 
1162
1164
  info_dicts = self.run_cmd("where", file_list=no_rev_paths)
1163
- local_paths = [self.__get_dict_value(info, "path") for info in info_dicts]
1165
+ local_paths = [
1166
+ self.__get_dict_value(info, "path")
1167
+ for info in info_dicts
1168
+ if self.__get_dict_value(info, "path") is not None
1169
+ ]
1164
1170
  return local_paths
1165
1171
 
1166
1172
  @validate_not_empty
@@ -1225,6 +1231,8 @@ class P4Client(object):
1225
1231
  :param changelist: *string* with cl description or *int* cl number
1226
1232
  :return:
1227
1233
  """
1234
+ if changelist is None:
1235
+ return "default"
1228
1236
  if isinstance(changelist, str):
1229
1237
  try:
1230
1238
  return int(changelist)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: p4cmd
3
- Version: 2.9.0
3
+ Version: 2.9.2
4
4
  Summary: Simple P4 python module
5
5
  Home-page: https://github.com/nielsvaes/p4cmd
6
6
  Author: Niels Vaes
@@ -109,6 +109,10 @@ def test_ensure_changelist_float(p4client):
109
109
  assert p4client._P4Client__ensure_changelist(1.5) == 1
110
110
 
111
111
 
112
+ def test_ensure_changelist_none(p4client):
113
+ assert p4client._P4Client__ensure_changelist(None) == "default"
114
+
115
+
112
116
  def test_ensure_changelist_default_str(p4client):
113
117
  # "default" triggers get_or_make_changelist which returns "default"
114
118
  with patch.object(p4client, "get_or_make_changelist", return_value="default") as mock_gomc:
@@ -571,3 +575,16 @@ def test_get_depot_paths_missing_depot_file(p4client):
571
575
  with patch.object(p4client, "run_cmd", return_value=info_dicts):
572
576
  result = p4client.get_depot_paths(["C:/workspace/file.txt", "C:/workspace/other.txt"])
573
577
  assert result == ["//depot/project/file.txt"]
578
+
579
+
580
+ def test_get_local_paths_missing_path(p4client):
581
+ """get_local_paths skips entries where path is missing (e.g. unmapped paths from p4 where)."""
582
+ info_dicts = [
583
+ {b"depotFile": b"//depot/project/file.txt", b"path": b"C:/workspace/file.txt"},
584
+ {b"depotFile": b"//depot/project/unmapped.txt"}, # no path key — unmapped
585
+ ]
586
+ with patch.object(p4client, "run_cmd", return_value=info_dicts):
587
+ result = p4client.get_local_paths(
588
+ ["//depot/project/file.txt", "//depot/project/unmapped.txt"]
589
+ )
590
+ assert result == ["C:/workspace/file.txt"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes