skilleter-thingy 0.0.58__py3-none-any.whl → 0.0.60__py3-none-any.whl

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.

Potentially problematic release.


This version of skilleter-thingy might be problematic. Click here for more details.

@@ -26,8 +26,6 @@ def main():
26
26
  parser = argparse.ArgumentParser(description='Report top-level directory of the current git working tree.')
27
27
  parser.add_argument('--parent', '-p', action='store_true',
28
28
  help='If we are already at the top of the working tree, check if the parent directory is in a working tree and output the top-level directory of that tree.')
29
- parser.add_argument('--repo', '-r', action='store_true',
30
- help='If we are already at the top of the working tree, look for a parent directory with a repo control file (.repo directory or .mrconfig file) and output that directory.')
31
29
  parser.add_argument('--dir', '-d', action='store', default=os.getcwd(),
32
30
  help='Find the location of the top-level directory in the working tree starting at the specified directory')
33
31
  parser.add_argument('level', nargs='?', type=int, default=0, help='Number of levels below the top-level directory to report')
@@ -40,39 +38,27 @@ def main():
40
38
  # Try to get the current working tree
41
39
 
42
40
  try:
43
- git_dir = pygit2.Repository(args.dir).workdir
41
+ working_tree = pygit2.Repository(args.dir).workdir
44
42
  except pygit2.GitError:
45
43
  print(f'Directory {args.dir} is not in a Git working tree')
46
44
  sys.exit(2)
47
45
 
48
- working_tree = os.path.abspath(os.path.join(git_dir, os.pardir))
49
-
50
46
  # If we are in a working tree and also looking for the parent working
51
47
  # tree, check if we are at the top of the current tree, and, if so,
52
48
  # hop up a level and try again.
53
49
 
54
- if args.parent and working_tree:
50
+ if args.parent:
55
51
  current_directory = os.getcwd()
56
52
 
57
53
  if os.path.samefile(working_tree, current_directory):
58
54
  os.chdir('..')
55
+ current_directory = os.getcwd()
59
56
 
60
- working_tree = pygit2.Repository(current_directory).workdir
61
-
62
- # If we are also looking for a multi-repo control file or directory, and haven't
63
- # found the git working tree root scan up the tree until we find one.
64
-
65
- if args.repo and not working_tree:
66
- while True:
67
- working_tree = os.getcwd()
68
-
69
- if os.path.isdir('.repo') or os.path.isfile('../.mrconfig'):
70
- break
71
-
72
- if working_tree == '/':
73
- sys.exit(2)
74
-
75
- os.chdir('..')
57
+ try:
58
+ working_tree = pygit2.Repository(current_directory).workdir
59
+ except pygit2.GitError:
60
+ print(f'Parent directory {current_directory} is not in a Git working tree')
61
+ sys.exit(3)
76
62
 
77
63
  # Output the result, if we have one
78
64
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: skilleter_thingy
3
- Version: 0.0.58
3
+ Version: 0.0.60
4
4
  Summary: A collection of useful utilities, mainly aimed at making Git more friendly
5
5
  Author-email: John Skilleter <john@skilleter.org.uk>
6
6
  Project-URL: Home, https://skilleter.org.uk
@@ -18,7 +18,7 @@ skilleter_thingy/git_mr.py,sha256=2vLzpd5waddNBRlOvQUxwqHVQaK9Rg6FYHb4VMEpS8c,30
18
18
  skilleter_thingy/git_parent.py,sha256=znw0ehKau-YocFJu2jLBsYSnLJfUvSNFKSDBdQ9_OTo,2774
19
19
  skilleter_thingy/git_review.py,sha256=WCBw49OP3WHiaxku8jUUk6I_NqtjScLGaQHvPxX6LnU,52053
20
20
  skilleter_thingy/git_update.py,sha256=6mXHSF7fxhKzFxsG3-78JOHYKdmAEE68iq39-Ho5WQU,14181
21
- skilleter_thingy/git_wt.py,sha256=dnJSkZGGMaSGeHARQ1ZYwf9yeFLbag-c4w4HwpA2od0,3522
21
+ skilleter_thingy/git_wt.py,sha256=Xm4VBBXMI4GxNtH3QvF-QL9rtvo4RrlWSbNQDFpGZu8,2954
22
22
  skilleter_thingy/gitcmp_helper.py,sha256=wutDHpBPOX8ZsXbsC5ApHxMY5tOKgD3P0eyFVs_mSAI,11214
23
23
  skilleter_thingy/gitprompt.py,sha256=SzSMd0EGI7ftPko80Q2PipwbVA-qjU1jsmdpmTCM5GI,8912
24
24
  skilleter_thingy/gl.py,sha256=9zbGpKxw6lX9RghLkdy-Q5sZlqtbB3uGFO04qTu1dH8,5954
@@ -60,9 +60,9 @@ skilleter_thingy/thingy/run.py,sha256=6SNKWF01fSxzB10GMU9ajraXYZqAL1w0PXkqjJdr1U
60
60
  skilleter_thingy/thingy/tfm_pane.py,sha256=oqy5zBzKwfbjbGqetbbhpKi4x5He7sl4qkmhUeqtdZc,19789
61
61
  skilleter_thingy/thingy/tidy.py,sha256=0EVUP2XyUTtoIpqaDwvrHL58YxM4Elvu5MO1nzhwLG4,5854
62
62
  skilleter_thingy/thingy/venv_template.py,sha256=SsVNvSwojd8NnFeQaZPCRQYTNdwJRplpZpygbUEXRnY,1015
63
- skilleter_thingy-0.0.58.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
64
- skilleter_thingy-0.0.58.dist-info/METADATA,sha256=Y9f7hCRoPwb3kLNuHfyqF3eyvDTLe_fe5BmLu3S1_NQ,5313
65
- skilleter_thingy-0.0.58.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
66
- skilleter_thingy-0.0.58.dist-info/entry_points.txt,sha256=IT6cZSbGHrd2UzIQbiMRotKiTJnYJBkESC4fAe8gjsE,2026
67
- skilleter_thingy-0.0.58.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
68
- skilleter_thingy-0.0.58.dist-info/RECORD,,
63
+ skilleter_thingy-0.0.60.dist-info/LICENSE,sha256=ljOS4DjXvqEo5VzGfdaRwgRZPbNScGBmfwyC8PChvmQ,32422
64
+ skilleter_thingy-0.0.60.dist-info/METADATA,sha256=pASt2zwtyewwnTA3907wGQDxK0q0OHCMxw-CBhWlUoE,5313
65
+ skilleter_thingy-0.0.60.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
66
+ skilleter_thingy-0.0.60.dist-info/entry_points.txt,sha256=IT6cZSbGHrd2UzIQbiMRotKiTJnYJBkESC4fAe8gjsE,2026
67
+ skilleter_thingy-0.0.60.dist-info/top_level.txt,sha256=8-JhgToBBiWURunmvfpSxEvNkDHQQ7r25-aBXtZv61g,17
68
+ skilleter_thingy-0.0.60.dist-info/RECORD,,