@@ -1439,22 +1439,28 @@ def _find_source_tracking_entry(
14391439 target_org = target_repo .split ("/" )[0 ] if "/" in target_repo else None
14401440 entry_project = entry_repo .split ("/" , 1 )[1 ] if "/" in entry_repo else None
14411441 target_project = target_repo .split ("/" , 1 )[1 ] if "/" in target_repo else None
1442-
1442+
14431443 # Only use org-only match when:
14441444 # 1. Org matches
14451445 # 2. source_id exists (for single dict, check source_tracking dict)
14461446 # 3. AND (project is unknown in entry OR project is unknown in target OR both contain GUIDs)
14471447 # This prevents matching org/project-a with org/project-b when both have known project names
14481448 source_url = source_tracking .get ("source_url" , "" ) if isinstance (source_tracking , dict ) else ""
1449- entry_has_guid = source_url and re .search (r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}" , source_url , re .IGNORECASE )
1449+ entry_has_guid = source_url and re .search (
1450+ r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}" , source_url , re .IGNORECASE
1451+ )
14501452 project_unknown = (
14511453 not entry_project # Entry has no project part
14521454 or not target_project # Target has no project part
14531455 or entry_has_guid # Entry URL contains GUID (project name unknown)
1454- or (entry_project and len (entry_project ) == 36 and "-" in entry_project ) # Entry project is a GUID
1455- or (target_project and len (target_project ) == 36 and "-" in target_project ) # Target project is a GUID
1456+ or (
1457+ entry_project and len (entry_project ) == 36 and "-" in entry_project
1458+ ) # Entry project is a GUID
1459+ or (
1460+ target_project and len (target_project ) == 36 and "-" in target_project
1461+ ) # Target project is a GUID
14561462 )
1457-
1463+
14581464 if (
14591465 entry_org
14601466 and target_org
@@ -1511,22 +1517,28 @@ def _find_source_tracking_entry(
15111517 target_org = target_repo .split ("/" )[0 ] if "/" in target_repo else None
15121518 entry_project = entry_repo .split ("/" , 1 )[1 ] if "/" in entry_repo else None
15131519 target_project = target_repo .split ("/" , 1 )[1 ] if "/" in target_repo else None
1514-
1520+
15151521 # Only use org-only match when:
15161522 # 1. Org matches
15171523 # 2. source_id exists
15181524 # 3. AND (project is unknown in entry OR project is unknown in target OR both contain GUIDs)
15191525 # This prevents matching org/project-a with org/project-b when both have known project names
15201526 source_url = entry .get ("source_url" , "" )
1521- entry_has_guid = source_url and re .search (r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}" , source_url , re .IGNORECASE )
1527+ entry_has_guid = source_url and re .search (
1528+ r"dev\.azure\.com/[^/]+/[0-9a-f-]{36}" , source_url , re .IGNORECASE
1529+ )
15221530 project_unknown = (
15231531 not entry_project # Entry has no project part
15241532 or not target_project # Target has no project part
15251533 or entry_has_guid # Entry URL contains GUID (project name unknown)
1526- or (entry_project and len (entry_project ) == 36 and "-" in entry_project ) # Entry project is a GUID
1527- or (target_project and len (target_project ) == 36 and "-" in target_project ) # Target project is a GUID
1534+ or (
1535+ entry_project and len (entry_project ) == 36 and "-" in entry_project
1536+ ) # Entry project is a GUID
1537+ or (
1538+ target_project and len (target_project ) == 36 and "-" in target_project
1539+ ) # Target project is a GUID
15281540 )
1529-
1541+
15301542 if (
15311543 entry_org
15321544 and target_org
0 commit comments