easy-worktree 0.1.4__py3-none-any.whl → 0.1.6__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.
- easy_worktree/__init__.py +30 -6
- {easy_worktree-0.1.4.dist-info → easy_worktree-0.1.6.dist-info}/METADATA +1 -1
- easy_worktree-0.1.6.dist-info/RECORD +6 -0
- easy_worktree-0.1.4.dist-info/RECORD +0 -6
- {easy_worktree-0.1.4.dist-info → easy_worktree-0.1.6.dist-info}/WHEEL +0 -0
- {easy_worktree-0.1.4.dist-info → easy_worktree-0.1.6.dist-info}/entry_points.txt +0 -0
- {easy_worktree-0.1.4.dist-info → easy_worktree-0.1.6.dist-info}/licenses/LICENSE +0 -0
easy_worktree/__init__.py
CHANGED
|
@@ -28,8 +28,8 @@ MESSAGES = {
|
|
|
28
28
|
"ja": "使用方法: wt clone <repository_url>",
|
|
29
29
|
},
|
|
30
30
|
"usage_add": {
|
|
31
|
-
"en": "Usage: wt add (ad) <work_name> [<base_branch>]",
|
|
32
|
-
"ja": "使用方法: wt add (ad) <作業名> [<base_branch>]",
|
|
31
|
+
"en": "Usage: wt add (ad) <work_name> [<base_branch>] [--no-setup] [--select]",
|
|
32
|
+
"ja": "使用方法: wt add (ad) <作業名> [<base_branch>] [--no-setup] [--select]",
|
|
33
33
|
},
|
|
34
34
|
"usage_rm": {"en": "Usage: wt rm <work_name>", "ja": "使用方法: wt rm <作業名>"},
|
|
35
35
|
"base_not_found": {
|
|
@@ -855,7 +855,7 @@ def add_worktree(
|
|
|
855
855
|
|
|
856
856
|
|
|
857
857
|
def cmd_add(args: list[str]):
|
|
858
|
-
"""wt add <work_name> [<base_branch>] [--
|
|
858
|
+
"""wt add <work_name> [<base_branch>] [--no-setup] [--select] - Add a worktree"""
|
|
859
859
|
if len(args) < 1:
|
|
860
860
|
print(msg("usage_add"), file=sys.stderr)
|
|
861
861
|
sys.exit(1)
|
|
@@ -863,10 +863,13 @@ def cmd_add(args: list[str]):
|
|
|
863
863
|
# parse options
|
|
864
864
|
clean_args = []
|
|
865
865
|
skip_setup = False
|
|
866
|
+
select = False
|
|
866
867
|
|
|
867
868
|
for arg in args:
|
|
868
|
-
if arg
|
|
869
|
+
if arg in ["--skip-setup", "--no-setup"]:
|
|
869
870
|
skip_setup = True
|
|
871
|
+
elif arg == "--select":
|
|
872
|
+
select = True
|
|
870
873
|
else:
|
|
871
874
|
clean_args.append(arg)
|
|
872
875
|
|
|
@@ -877,7 +880,28 @@ def cmd_add(args: list[str]):
|
|
|
877
880
|
work_name = clean_args[0]
|
|
878
881
|
branch_to_use = clean_args[1] if len(clean_args) >= 2 else None
|
|
879
882
|
|
|
880
|
-
|
|
883
|
+
base_dir = find_base_dir()
|
|
884
|
+
wt_path = add_worktree(work_name, branch_to_use=branch_to_use, skip_setup=skip_setup, base_dir=base_dir)
|
|
885
|
+
|
|
886
|
+
if select and wt_path:
|
|
887
|
+
wt_dir = base_dir / ".wt"
|
|
888
|
+
# Ensure .wt directory and its management files exists
|
|
889
|
+
create_hook_template(base_dir)
|
|
890
|
+
last_sel_file = wt_dir / "last_selection"
|
|
891
|
+
|
|
892
|
+
# Get current selection name
|
|
893
|
+
current_sel = os.environ.get("WT_SESSION_NAME")
|
|
894
|
+
if not current_sel:
|
|
895
|
+
cwd = Path.cwd().resolve()
|
|
896
|
+
worktrees = get_worktree_info(base_dir)
|
|
897
|
+
resolved_base = base_dir.resolve()
|
|
898
|
+
for wt in worktrees:
|
|
899
|
+
p = Path(wt["path"]).resolve()
|
|
900
|
+
if cwd == p or cwd.is_relative_to(p):
|
|
901
|
+
current_sel = "main" if p == resolved_base else p.name
|
|
902
|
+
break
|
|
903
|
+
|
|
904
|
+
switch_selection(work_name, base_dir, current_sel, last_sel_file)
|
|
881
905
|
|
|
882
906
|
|
|
883
907
|
def cmd_stash(args: list[str]):
|
|
@@ -1920,7 +1944,7 @@ def show_help():
|
|
|
1920
1944
|
|
|
1921
1945
|
def show_version():
|
|
1922
1946
|
"""Show version information"""
|
|
1923
|
-
print("easy-worktree version 0.1.
|
|
1947
|
+
print("easy-worktree version 0.1.6")
|
|
1924
1948
|
|
|
1925
1949
|
|
|
1926
1950
|
def main():
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
easy_worktree/__init__.py,sha256=ubOIvRctUMf_OqG6Y0Vd7PMQ3jKDS_F8PeLM9GIi5ZY,65812
|
|
2
|
+
easy_worktree-0.1.6.dist-info/METADATA,sha256=zicOjRw1QPuLUIL0kyU4FSvR-y0W6mnj3FF_F2jeoxU,6520
|
|
3
|
+
easy_worktree-0.1.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
4
|
+
easy_worktree-0.1.6.dist-info/entry_points.txt,sha256=Mf6MYDS2obZLvIJJFl-BbU8-SL0QGu5UWcC0FWnqtbg,42
|
|
5
|
+
easy_worktree-0.1.6.dist-info/licenses/LICENSE,sha256=7MGvWFDxXPqW2nrr9D7KHT0vWFiGwIUL5SQCj0IiAPc,1061
|
|
6
|
+
easy_worktree-0.1.6.dist-info/RECORD,,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
easy_worktree/__init__.py,sha256=iK93RMds8Tpg_PO9fdO3o7qWb8krXFUOyocevfdvRfQ,64802
|
|
2
|
-
easy_worktree-0.1.4.dist-info/METADATA,sha256=_odaKmNmF_w4c-oULH4xghSSYCFfGy9vb_By_x7G8tU,6520
|
|
3
|
-
easy_worktree-0.1.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
4
|
-
easy_worktree-0.1.4.dist-info/entry_points.txt,sha256=Mf6MYDS2obZLvIJJFl-BbU8-SL0QGu5UWcC0FWnqtbg,42
|
|
5
|
-
easy_worktree-0.1.4.dist-info/licenses/LICENSE,sha256=7MGvWFDxXPqW2nrr9D7KHT0vWFiGwIUL5SQCj0IiAPc,1061
|
|
6
|
-
easy_worktree-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|