unknown-cli 0.9.21__tar.gz → 0.9.22__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 (23) hide show
  1. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/PKG-INFO +1 -1
  2. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknown_cli.egg-info/PKG-INFO +1 -1
  3. unknown-cli-0.9.22/unknowncli/VERSION +1 -0
  4. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/commands/preflight.py +36 -9
  5. unknown-cli-0.9.21/unknowncli/VERSION +0 -1
  6. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/README.md +0 -0
  7. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/setup.cfg +0 -0
  8. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/setup.py +0 -0
  9. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknown_cli.egg-info/SOURCES.txt +0 -0
  10. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknown_cli.egg-info/dependency_links.txt +0 -0
  11. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknown_cli.egg-info/entry_points.txt +0 -0
  12. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknown_cli.egg-info/requires.txt +0 -0
  13. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknown_cli.egg-info/top_level.txt +0 -0
  14. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/__init__.py +0 -0
  15. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/__main__.py +0 -0
  16. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/commands/__init__.py +0 -0
  17. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/commands/project.py +0 -0
  18. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/commands/task.py +0 -0
  19. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/commands/unreal.py +0 -0
  20. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/data/.p4ignore.txt +0 -0
  21. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/set_registry_keys.py +0 -0
  22. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/set_url_handler.py +0 -0
  23. {unknown-cli-0.9.21 → unknown-cli-0.9.22}/unknowncli/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unknown-cli
3
- Version: 0.9.21
3
+ Version: 0.9.22
4
4
  Summary: Unknown Commandline Tool
5
5
  Home-page: UNKNOWN
6
6
  Author:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unknown-cli
3
- Version: 0.9.21
3
+ Version: 0.9.22
4
4
  Summary: Unknown Commandline Tool
5
5
  Home-page: UNKNOWN
6
6
  Author:
@@ -0,0 +1 @@
1
+ 0.9.22
@@ -52,6 +52,8 @@ class CustomToolFolder:
52
52
  self.name = name
53
53
  self.custom_tool_def_list = custom_tool_def_list
54
54
  self.add_to_context = add_to_context
55
+ def tool_count(self) -> int:
56
+ return len(self.custom_tool_def_list)
55
57
 
56
58
 
57
59
  class P4VConfigType(str, Enum):
@@ -102,6 +104,10 @@ custom_tool_list.append(
102
104
  CustomToolDef(
103
105
  name="Preflight and Commit - Full", command = pwsh_tool_exe,
104
106
  arguments = f"{pwsh_cmd_base} {base_cmd_full}"
107
+ ),
108
+ CustomToolDef(
109
+ name="Preflight and Commit on Server - Quick", command = pwsh_tool_exe, add_separator_before = True,
110
+ arguments = f"{pwsh_cmd_base} {base_cmd_quick} --use-server-submit"
105
111
  )
106
112
  ]
107
113
  )
@@ -267,9 +273,15 @@ def install_p4v_tools(type_override: P4VConfigType=None):
267
273
  if sub_element.tag != "CustomToolFolder":
268
274
  continue
269
275
  if sub_element.findtext("Name") == tool_folder_to_add.name:
270
- secho("P4V Preflight context menu already added.", bold=True)
271
- if not type_override:
272
- return
276
+ # Compare number of defined tools in the XML vs. tool count in the tool list to see if
277
+ # we need to update. This should be replaced with a deeper comparison, in case we modify
278
+ # any of the tools to support changes to parameters and such.
279
+ tool_def_list = list(sub_element.find("CustomToolDefList"))
280
+ tool_def_count = sum([t.tag == "CustomToolDef" for t in tool_def_list])
281
+ if tool_def_count == tool_folder_to_add.tool_count():
282
+ secho("P4V Preflight context menu already added.", bold=True)
283
+ if not type_override:
284
+ return
273
285
  root.remove(sub_element)
274
286
  break
275
287
  add_custom_tool_folder(root, tool_folder_to_add)
@@ -649,7 +661,7 @@ def get_build_running_info(build_json):
649
661
  return build_json.get("running-info", "")
650
662
 
651
663
 
652
- def wait_on_teamcity_build(build_id, changelist):
664
+ def wait_on_teamcity_build(build_id, changelist, submit_on_server):
653
665
  def get_build_web_url(build_json): return build_json["webUrl"]
654
666
  def parse_total(build_json):
655
667
  total = 1
@@ -722,6 +734,9 @@ def wait_on_teamcity_build(build_id, changelist):
722
734
  build_json = get_teamcity_build_json(build_id)
723
735
  live.update(generate_state_table(build_json))
724
736
  curr_state = get_build_state(build_json)
737
+ # Skip updating if we did a submit on server as that process already updated the tag.
738
+ if submit_on_server and curr_state == BuildState.FINISHED:
739
+ break
725
740
  if prev_state != curr_state:
726
741
  prev_state = curr_state
727
742
  update_description_tag(changelist, build_id, curr_state)
@@ -746,6 +761,16 @@ def get_teamcity_build_json(build_id):
746
761
  abort(f"Failed to find TeamCity build: {build_id}")
747
762
  return json.loads(build_json)
748
763
 
764
+ def move_open_files_to_default(shelve_changelist: str):
765
+ opened_file_list = get_opened_file_list(shelve_changelist)
766
+ if opened_file_list:
767
+ if any('+l' in x['type'] for x in opened_file_list):
768
+ secho("\nYour CL contains exclusive edit files:")
769
+ for x in opened_file_list:
770
+ secho(f"\n {x['depotFile']}")
771
+ secho(f"\nMake sure not to revert these files until your preflight completes! (Press any key to continue)", fg="green", bold=True)
772
+ input('')
773
+ reopen_changelist_to_default(shelve_changelist)
749
774
 
750
775
  def commit(shelve_changelist: str):
751
776
  """
@@ -755,10 +780,7 @@ def commit(shelve_changelist: str):
755
780
  secho(f"\nLooking to commit shelve: {shelve_changelist}")
756
781
 
757
782
  # Move opened files to default so that the shelve can be submitted.
758
- opened_file_list = get_opened_file_list(shelve_changelist)
759
- if opened_file_list:
760
- reopen_changelist_to_default(shelve_changelist)
761
-
783
+ move_open_files_to_default(shelve_changelist)
762
784
  describe_shelve = get_describe_shelve(shelve_changelist)[0]
763
785
  submitted_changelist = submit_shelve(shelve_changelist)
764
786
 
@@ -866,16 +888,21 @@ def main(
866
888
  verify_changelist(change_obj, sorted_change_obj_list)
867
889
  if get_opened_file_list(change_obj.change):
868
890
  shelve_changelist = attempt_shelve_changelist(change_obj.change)
891
+ if use_server_submit:
892
+ if not confirm(f"\nFiles are opened in CL {change_obj.change} and must be re-opened in default to submit on server. Re-open files?"):
893
+ abort("Aborting preflight due to open files in CL..")
894
+ move_open_files_to_default(change_obj.change)
869
895
  else:
870
896
  if change_obj.is_shelved:
871
897
  shelve_changelist = change_obj.change
872
898
  else:
873
899
  abort(f"No opened files or shelve to work with in changelist '{change_obj.change}'...")
900
+
874
901
  build_id = get_shelve_preflight_build_id(
875
902
  shelve_changelist, type=type, stream=get_client_stream(change_obj.client), submit_on_server=use_server_submit
876
903
  )
877
904
 
878
- wait_on_teamcity_build(build_id, shelve_changelist)
905
+ wait_on_teamcity_build(build_id, shelve_changelist, use_server_submit)
879
906
 
880
907
  build_json = get_teamcity_build_json(build_id)
881
908
  if not is_build_success(build_json):
@@ -1 +0,0 @@
1
- 0.9.21
File without changes
File without changes
File without changes