File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -445,18 +445,17 @@ def revision(
445445 script = ScriptDirectory .from_config (config )
446446
447447 if not head :
448+ scripts = script .get_revisions (script .get_heads ())
448449 if branch_label :
449- head = f"{ branch_label } @head"
450- elif len (heads := script .get_heads ()) <= 1 :
450+ if any (branch_label in sc .branch_labels for sc in scripts ):
451+ head = f"{ branch_label } @head"
452+ else :
453+ head = "base"
454+ elif len (scripts ) <= 1 :
451455 head = "head"
452456 else :
453457 try :
454- head = next (
455- filterfalse (
456- attrgetter ("branch_labels" ),
457- script .get_revisions (heads ),
458- )
459- ).revision
458+ head = next (filterfalse (attrgetter ("branch_labels" ), scripts )).revision
460459 except StopIteration :
461460 head = "base"
462461
You can’t perform that action at this time.
0 commit comments