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(
445
445
script = ScriptDirectory .from_config (config )
446
446
447
447
if not head :
448
+ scripts = script .get_revisions (script .get_heads ())
448
449
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 :
451
455
head = "head"
452
456
else :
453
457
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
460
459
except StopIteration :
461
460
head = "base"
462
461
You can’t perform that action at this time.
0 commit comments