42
42
from node_package import InstalledNodePackage
43
43
44
44
45
- version_code = [3 , 23 ]
45
+ version_code = [3 , 24 ]
46
46
version_str = f"V{ version_code [0 ]} .{ version_code [1 ]} " + (f'.{ version_code [2 ]} ' if len (version_code ) > 2 else '' )
47
47
48
48
@@ -505,6 +505,8 @@ def resolve_node_spec(self, node_name, guess_mode=None):
505
505
def resolve_from_path (self , fullpath ):
506
506
url = git_utils .git_url (fullpath )
507
507
if url :
508
+ url = git_utils .normalize_url (url )
509
+
508
510
cnr = self .get_cnr_by_repo (url )
509
511
commit_hash = git_utils .get_commit_hash (fullpath )
510
512
if cnr :
@@ -1239,15 +1241,16 @@ def repo_install(self, url, repo_path, instant_execution=False, no_deps=False, r
1239
1241
if url .endswith ("/" ):
1240
1242
url = url [:- 1 ]
1241
1243
try :
1242
- print (f"Download: git clone '{ url } '" )
1243
-
1244
1244
# Clone the repository from the remote URL
1245
+ clone_url = git_utils .get_url_for_clone (url )
1246
+ print (f"Download: git clone '{ clone_url } '" )
1247
+
1245
1248
if not instant_execution and platform .system () == 'Windows' :
1246
- res = manager_funcs .run_script ([sys .executable , git_script_path , "--clone" , get_default_custom_nodes_path (), url , repo_path ], cwd = get_default_custom_nodes_path ())
1249
+ res = manager_funcs .run_script ([sys .executable , git_script_path , "--clone" , get_default_custom_nodes_path (), clone_url , repo_path ], cwd = get_default_custom_nodes_path ())
1247
1250
if res != 0 :
1248
- return result .fail (f"Failed to clone repo: { url } " )
1251
+ return result .fail (f"Failed to clone repo: { clone_url } " )
1249
1252
else :
1250
- repo = git .Repo .clone_from (url , repo_path , recursive = True , progress = GitProgress ())
1253
+ repo = git .Repo .clone_from (clone_url , repo_path , recursive = True , progress = GitProgress ())
1251
1254
repo .git .clear_cache ()
1252
1255
repo .close ()
1253
1256
@@ -2043,12 +2046,14 @@ async def gitclone_install(url, instant_execution=False, msg_prefix='', no_deps=
2043
2046
print (f"CLONE into '{ repo_path } '" )
2044
2047
2045
2048
# Clone the repository from the remote URL
2049
+ clone_url = git_utils .get_url_for_clone (url )
2050
+
2046
2051
if not instant_execution and platform .system () == 'Windows' :
2047
- res = manager_funcs .run_script ([sys .executable , git_script_path , "--clone" , get_default_custom_nodes_path (), url , repo_path ], cwd = get_default_custom_nodes_path ())
2052
+ res = manager_funcs .run_script ([sys .executable , git_script_path , "--clone" , get_default_custom_nodes_path (), clone_url , repo_path ], cwd = get_default_custom_nodes_path ())
2048
2053
if res != 0 :
2049
- return result .fail (f"Failed to clone '{ url } ' into '{ repo_path } '" )
2054
+ return result .fail (f"Failed to clone '{ clone_url } ' into '{ repo_path } '" )
2050
2055
else :
2051
- repo = git .Repo .clone_from (url , repo_path , recursive = True , progress = GitProgress ())
2056
+ repo = git .Repo .clone_from (clone_url , repo_path , recursive = True , progress = GitProgress ())
2052
2057
repo .git .clear_cache ()
2053
2058
repo .close ()
2054
2059
@@ -2973,7 +2978,14 @@ async def restore_snapshot(snapshot_path, git_helper_extras=None):
2973
2978
print ("cm-cli: unexpected [0001]" )
2974
2979
2975
2980
# for nightly restore
2976
- git_info = info .get ('git_custom_nodes' )
2981
+ _git_info = info .get ('git_custom_nodes' )
2982
+ git_info = {}
2983
+
2984
+ # normalize github repo
2985
+ for k , v in _git_info .items ():
2986
+ norm_k = git_utils .normalize_url (k )
2987
+ git_info [norm_k ] = v
2988
+
2977
2989
if git_info is not None :
2978
2990
todo_disable = []
2979
2991
todo_enable = []
@@ -2986,39 +2998,26 @@ async def restore_snapshot(snapshot_path, git_helper_extras=None):
2986
2998
2987
2999
if v [0 ] == 'nightly' and cnr_repo_map .get (k ):
2988
3000
repo_url = cnr_repo_map .get (k )
3001
+ normalized_url = git_utils .normalize_url (repo_url )
2989
3002
2990
- normalized_url1 = git_utils .normalize_url (repo_url )
2991
- normalized_url2 = git_utils .normalize_url_http (repo_url )
2992
-
2993
- if normalized_url1 not in git_info and normalized_url2 not in git_info :
3003
+ if normalized_url not in git_info :
2994
3004
todo_disable .append (k )
2995
3005
else :
2996
- if normalized_url1 in git_info :
2997
- commit_hash = git_info [normalized_url1 ]['hash' ]
2998
- todo_checkout .append ((v [1 ], commit_hash ))
2999
-
3000
- if normalized_url2 in git_info :
3001
- commit_hash = git_info [normalized_url2 ]['hash' ]
3002
- todo_checkout .append ((v [1 ], commit_hash ))
3006
+ commit_hash = git_info [normalized_url ]['hash' ]
3007
+ todo_checkout .append ((v [1 ], commit_hash ))
3003
3008
3004
3009
for k , v in unified_manager .nightly_inactive_nodes .items ():
3005
3010
if 'comfyui-manager' in k :
3006
3011
continue
3007
3012
3008
3013
if cnr_repo_map .get (k ):
3009
3014
repo_url = cnr_repo_map .get (k )
3010
- normalized_url1 = git_utils .normalize_url (repo_url )
3011
- normalized_url2 = git_utils .normalize_url_http (repo_url )
3012
-
3013
- if normalized_url1 in git_info :
3014
- commit_hash = git_info [normalized_url1 ]['hash' ]
3015
- todo_enable .append ((k , commit_hash ))
3016
- processed_urls .append (normalized_url1 )
3015
+ normalized_url = git_utils .normalize_url (repo_url )
3017
3016
3018
- if normalized_url2 in git_info :
3019
- commit_hash = git_info [normalized_url2 ]['hash' ]
3017
+ if normalized_url in git_info :
3018
+ commit_hash = git_info [normalized_url ]['hash' ]
3020
3019
todo_enable .append ((k , commit_hash ))
3021
- processed_urls .append (normalized_url2 )
3020
+ processed_urls .append (normalized_url )
3022
3021
3023
3022
for x in todo_disable :
3024
3023
unified_manager .unified_disable (x , False )
@@ -3071,40 +3070,27 @@ async def restore_snapshot(snapshot_path, git_helper_extras=None):
3071
3070
if repo_url is None :
3072
3071
continue
3073
3072
3074
- normalized_url1 = git_utils .normalize_url (repo_url )
3075
- normalized_url2 = git_utils .normalize_url_http (repo_url )
3073
+ normalized_url = git_utils .normalize_url (repo_url )
3076
3074
3077
- if normalized_url1 not in git_info and normalized_url2 not in git_info :
3075
+ if normalized_url not in git_info :
3078
3076
todo_disable .append (k2 )
3079
3077
else :
3080
- if normalized_url1 in git_info :
3081
- commit_hash = git_info [normalized_url1 ]['hash' ]
3082
- todo_checkout .append ((k2 , commit_hash ))
3083
- processed_urls .append (normalized_url1 )
3084
-
3085
- if normalized_url2 in git_info :
3086
- commit_hash = git_info [normalized_url2 ]['hash' ]
3087
- todo_checkout .append ((k2 , commit_hash ))
3088
- processed_urls .append (normalized_url2 )
3078
+ commit_hash = git_info [normalized_url ]['hash' ]
3079
+ todo_checkout .append ((k2 , commit_hash ))
3080
+ processed_urls .append (normalized_url )
3089
3081
3090
3082
for k2 , v2 in unified_manager .unknown_inactive_nodes .items ():
3091
3083
repo_url = resolve_giturl_from_path (v2 [1 ])
3092
3084
3093
3085
if repo_url is None :
3094
3086
continue
3095
3087
3096
- normalized_url1 = git_utils .normalize_url (repo_url )
3097
- normalized_url2 = git_utils .normalize_url_http (repo_url )
3098
-
3099
- if normalized_url1 in git_info :
3100
- commit_hash = git_info [normalized_url1 ]['hash' ]
3101
- todo_enable .append ((k2 , commit_hash ))
3102
- processed_urls .append (normalized_url1 )
3088
+ normalized_url = git_utils .normalize_url (repo_url )
3103
3089
3104
- if normalized_url2 in git_info :
3105
- commit_hash = git_info [normalized_url2 ]['hash' ]
3090
+ if normalized_url in git_info :
3091
+ commit_hash = git_info [normalized_url ]['hash' ]
3106
3092
todo_enable .append ((k2 , commit_hash ))
3107
- processed_urls .append (normalized_url2 )
3093
+ processed_urls .append (normalized_url )
3108
3094
3109
3095
for x in todo_disable :
3110
3096
unified_manager .unified_disable (x , True )
0 commit comments