unknown-cli 0.9.5__tar.gz → 0.9.6__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.5 → unknown-cli-0.9.6}/PKG-INFO +1 -1
  2. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknown_cli.egg-info/PKG-INFO +1 -1
  3. unknown-cli-0.9.6/unknowncli/VERSION +1 -0
  4. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/commands/project.py +1 -0
  5. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/commands/task.py +33 -14
  6. unknown-cli-0.9.5/unknowncli/VERSION +0 -1
  7. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/README.md +0 -0
  8. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/setup.cfg +0 -0
  9. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/setup.py +0 -0
  10. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknown_cli.egg-info/SOURCES.txt +0 -0
  11. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknown_cli.egg-info/dependency_links.txt +0 -0
  12. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknown_cli.egg-info/entry_points.txt +0 -0
  13. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknown_cli.egg-info/requires.txt +0 -0
  14. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknown_cli.egg-info/top_level.txt +0 -0
  15. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/__init__.py +0 -0
  16. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/__main__.py +0 -0
  17. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/commands/__init__.py +0 -0
  18. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/commands/preflight.py +0 -0
  19. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/commands/unreal.py +0 -0
  20. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/data/.p4ignore.txt +0 -0
  21. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/set_registry_keys.py +0 -0
  22. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/set_url_handler.py +0 -0
  23. {unknown-cli-0.9.5 → unknown-cli-0.9.6}/unknowncli/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unknown-cli
3
- Version: 0.9.5
3
+ Version: 0.9.6
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.5
3
+ Version: 0.9.6
4
4
  Summary: Unknown Commandline Tool
5
5
  Home-page: UNKNOWN
6
6
  Author:
@@ -0,0 +1 @@
1
+ 0.9.6
@@ -19,6 +19,7 @@ app = Typer()
19
19
 
20
20
  hostname = socket.gethostname().lower()
21
21
  SUBST_DRIVE = "S:"
22
+ BASE_STREAM = "//Project/SN2-Main"
22
23
  STREAMS = {
23
24
  "sn2-main": "//project/sn2-main-ue"
24
25
  }
@@ -3,7 +3,7 @@ import logging
3
3
  import socket
4
4
  import sys
5
5
  from ..utils import abort
6
- from .project import SUB_STREAMS
6
+ from .project import BASE_STREAM, SUB_STREAMS
7
7
  from P4 import P4, P4Exception
8
8
  from typing import Optional
9
9
  from subprocess import check_call
@@ -18,7 +18,6 @@ app = Typer()
18
18
  hostname = socket.gethostname().lower()
19
19
  SUBST_DRIVE = "S:"
20
20
  path = f"{SUBST_DRIVE}\\sn2-main\\"
21
- BASE_STREAM = "//Project/SN2-Main"
22
21
  STREAM_LIST_LOWER = [s.lower() for s in list(list(SUB_STREAMS.values())[0].values())]
23
22
  STREAM_LIST_STRING = "\n\t" + "\n\t".join(STREAM_LIST_LOWER)
24
23
 
@@ -63,8 +62,9 @@ def main():
63
62
  )
64
63
 
65
64
 
66
- def get_task_streams(owner):
67
- lst = p4.run_streams("-F", f"Owner={owner} Type=task baseParent={BASE_STREAM}")
65
+ def get_task_streams(owner: str=""):
66
+ streams_filter = f"Type=task baseParent={BASE_STREAM}" + ( f" Owner={owner}" if owner else "" )
67
+ lst = p4.run_streams("-F", streams_filter)
68
68
  return lst
69
69
 
70
70
 
@@ -202,25 +202,29 @@ Paths:
202
202
 
203
203
 
204
204
  @app.command()
205
- def switch():
205
+ def switch(owned: Optional[bool] = Option(True, help="See only owned task streams")):
206
206
  """
207
207
  Lists your current task streams and lets you switch between them
208
208
  """
209
209
  stream = get_current_stream()
210
210
  old_stream_name = stream["Stream"]
211
211
  client = p4.run_client("-o")[0]
212
- client_owner = client["Owner"]
213
- task_streams = get_task_streams(client_owner)
212
+ task_streams = get_task_streams(client["Owner"] if owned else "")
213
+ if owned and not task_streams:
214
+ secho("You have no owned task streams. You can create one with the 'create' command.", bold=True)
215
+ if confirm("\nDo you want to instead see other streams that you don't own?"):
216
+ switch(owned=False)
217
+ abort("")
214
218
  parent = None
215
219
  if stream["Type"] == "task":
216
220
  parent = stream["Parent"]
217
221
  for i, t in enumerate(task_streams):
218
222
  secho(f"{i+1} : {t['Stream']}")
219
223
  if parent:
220
- secho(f"0 : {parent}")
224
+ secho(f"0 : (Parent stream) {parent}")
225
+ if owned:
226
+ secho(f"99 : <See other streams, including task streams that you don't own>")
221
227
 
222
- if not task_streams:
223
- abort("You have no task streams. You can create one with the 'create' command")
224
228
  n = prompt("\nSelect a stream to work in")
225
229
  if n is None:
226
230
  abort("No stream selected")
@@ -228,8 +232,11 @@ def switch():
228
232
  n = int(n)
229
233
  except:
230
234
  abort("Aborted.")
231
- if n == 0:
235
+ if parent and n == 0:
232
236
  new_stream = parent
237
+ elif owned and n == 99:
238
+ switch(owned=False)
239
+ abort("")
233
240
  else:
234
241
  try:
235
242
  new_stream = task_streams[n - 1]["Stream"]
@@ -426,7 +433,7 @@ Files:
426
433
 
427
434
 
428
435
  @app.command()
429
- def copyup():
436
+ def copyup(force: Optional[bool] = Option(False, help="Use p4 copy force arguments: -f -F")):
430
437
  """
431
438
  Finish the task and copy into the parent stream
432
439
  """
@@ -445,9 +452,12 @@ def copyup():
445
452
  p4.run_client("-s", "-S", parent)
446
453
 
447
454
  p4.run_sync("-q")
448
- echo(f"Performing copy from {stream_name} to {ret['baseParent']}/...")
455
+ copy_target = f"{ret['baseParent']}/..."
456
+ echo(f"Performing copy from {stream_name} to {copy_target}")
457
+ copy_args = [ "-Af", "-S", stream_name, copy_target ]
458
+ force_copy_args = [ "-f", "-F" ]
449
459
  try:
450
- copy_ret = p4.run_copy("-Af", "-S", stream_name, ret["baseParent"] + "/...")
460
+ copy_ret = p4.run_copy(*(force_copy_args if force else []), *copy_args)
451
461
  except P4Exception as e:
452
462
  if "up-to-date" in str(e):
453
463
  secho(f"Nothing to do. Parent {parent} is identical to task stream {stream_name}", fg="green")
@@ -455,6 +465,15 @@ def copyup():
455
465
  elif "No such file(s)" in str(e):
456
466
  secho(f"Nothing to do. No changes were made yet in task stream {stream_name}", fg="green")
457
467
  return
468
+ elif not force and "cannot 'copy' over outstanding 'merge' changes" in str(e):
469
+ # Occurs when mergedown is not complete but it can be the case when P4 has issues
470
+ # merging rename/move+edit and the fix is to force merge which causes "outstanding...".
471
+ secho(f"\n{str(e)}", fg="yellow")
472
+ if confirm("Try a force copy? (Do this if you're sure that you're done with mergedowns)"):
473
+ copy_ret = p4.run_copy(*force_copy_args, *copy_args)
474
+ else:
475
+ secho("No action taken.")
476
+ return
458
477
  else:
459
478
  raise
460
479
  else:
@@ -1 +0,0 @@
1
- 0.9.5
File without changes
File without changes
File without changes