Skip to content

Commit 1c3c729

Browse files
committed
[ci][cling] Remove TextInput from cling sync workflow
1 parent f76b2de commit 1c3c729

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

.github/workflows/sync_cling.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ on:
66
- 'master'
77
paths:
88
- 'interpreter/cling/**'
9-
- 'core/textinput/src/textinput/**'
109
workflow_dispatch:
1110

1211
jobs:

.github/workflows/utilities/sync_cling.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
ROOT_REPO_DIR_NAME = 'root'
1717
INTERP_DIR_NAME = 'interpreter/cling'
1818
DEST_INTERP_DIR_NAME = ''
19-
TEXTINPUT_DIR_NAME = 'core/textinput/src/textinput'
20-
DEST_TEXTINPUT_DIR_NAME='lib/UserInterface/textinput'
2119

2220
def printError(msg):
2321
print(f'*** Error: {msg}')
@@ -87,26 +85,21 @@ def getHashes(repoDirName, startingHash, dirInRepoName=''):
8785
hashes = [line.split(' ', 1)[0] for line in out.split('\n')]
8886
return hashes
8987

90-
def createPatches(rootHashes, interpHashes, textinputHashes):
88+
def createPatches(rootHashes, interpHashes):
9189
patches = []
9290

9391
# We'll need a few sets to quickly check what to do with ROOT hashes
9492
interpHashesSet = set(interpHashes)
95-
textInputHashesSet = set(textinputHashes)
96-
allHashesSet = interpHashesSet | textInputHashesSet
9793

9894
# We filter the ROOT hashes that we do not want to sync
99-
rootHashesToSync = list(filter(lambda hash: hash in allHashesSet, rootHashes))
95+
rootHashesToSync = list(filter(lambda hash: hash in interpHashesSet, rootHashes))
10096

10197
# We loop on ROOT hashes to sync, from oldest to newest
102-
# to return a list of triples [label, hash, patchAsSting], where label allows us
103-
# to disinguish between textinput and interpreter patches and hash is there
104-
# for debugging purposes.
105-
# One commit can be visible in both directories, ergo 2 patches per hash are possible.
98+
# to return a list of triples [dirInRepo, hash, patchAsSting], where dirInRepo is the
99+
# directory and hash is there for debugging purposes.
106100
for rootHashtoSync in reversed(rootHashesToSync):
107101
keys = []
108102
if rootHashtoSync in interpHashesSet: keys.append(INTERP_DIR_NAME)
109-
if rootHashtoSync in textInputHashesSet: keys.append(TEXTINPUT_DIR_NAME)
110103
for key in keys:
111104
patchAsStr = execCommand(f"git format-patch -1 {rootHashtoSync} {key} --stdout", ROOT_REPO_DIR_NAME)
112105
patches.append([key, rootHashtoSync, patchAsStr])
@@ -115,7 +108,7 @@ def createPatches(rootHashes, interpHashes, textinputHashes):
115108
def applyPatches(patches):
116109
for dirInRepo, hash, patchAsStr in patches:
117110
ignorePathLevel = dirInRepo.count('/') + 2
118-
destDirName = DEST_INTERP_DIR_NAME if dirInRepo == INTERP_DIR_NAME else DEST_TEXTINPUT_DIR_NAME
111+
destDirName = DEST_INTERP_DIR_NAME
119112
directoryOption = f'--directory {destDirName}' if destDirName else ''
120113
printInfo(f'Applying {hash} restricted to {dirInRepo} to repository {CLING_REPO_DIR_NAME}')
121114
execCommand(f'git am -p {ignorePathLevel} {directoryOption}', CLING_REPO_DIR_NAME, patchAsStr)
@@ -158,18 +151,17 @@ def principal():
158151
# to commits in the directories we are interested in for the sync
159152
rootHashes = getHashes(ROOT_REPO_DIR_NAME, startingRootHash)
160153
interpHashes = getHashes(ROOT_REPO_DIR_NAME, startingRootHash, INTERP_DIR_NAME)
161-
textinputHashes = getHashes(ROOT_REPO_DIR_NAME, startingRootHash, TEXTINPUT_DIR_NAME)
162154

163155
# If we have no commits to sync, we quit.
164-
if not interpHashes and not textinputHashes:
156+
if not interpHashes:
165157
# nothing to do, we have no commits to sync
166158
printInfo('No commit to sync. Exiting now.')
167159
return 0
168160

169-
printInfo(f'We found:\n - {len(interpHashes)} patches from the directory {INTERP_DIR_NAME}\n - {len(textinputHashes)} patches from the directory {TEXTINPUT_DIR_NAME}')
161+
printInfo(f'We found:\n - {len(interpHashes)} patches from the directory {INTERP_DIR_NAME}')
170162

171163
# We now create the patches we want to apply to the cling repo
172-
patches = createPatches(rootHashes, interpHashes, textinputHashes)
164+
patches = createPatches(rootHashes, interpHashes)
173165

174166
# We now apply the patches
175167
if not patches:

0 commit comments

Comments
 (0)