Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SoCTools Flow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SoCLabs
SoCTools Flow
Commits
8ac6b154
Commit
8ac6b154
authored
1 year ago
by
dam1n19
Browse files
Options
Downloads
Patches
Plain Diff
Added recursive projbranch files
parent
50598902
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/subrepo_checkout.py
+13
-2
13 additions, 2 deletions
bin/subrepo_checkout.py
projbranch
+13
-0
13 additions, 0 deletions
projbranch
with
26 additions
and
2 deletions
bin/subrepo_checkout.py
+
13
−
2
View file @
8ac6b154
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
import
argparse
import
argparse
import
os
import
os
from
os.path
import
exists
class
git_repo
():
class
git_repo
():
def
__init__
(
self
,
directory
,
branch
):
def
__init__
(
self
,
directory
,
branch
):
self
.
directory
=
directory
self
.
directory
=
directory
...
@@ -28,10 +30,19 @@ def read_branchfile(branchfile):
...
@@ -28,10 +30,19 @@ def read_branchfile(branchfile):
sub_repos
.
append
(
git_repo
(
repo
[
0
],
repo
[
1
]))
sub_repos
.
append
(
git_repo
(
repo
[
0
],
repo
[
1
]))
return
sub_repos
return
sub_repos
def
find_branchfile
(
directory
,
branchfile
):
if
exists
(
f
"
{
directory
}
/
{
branchfile
}
"
):
print
(
f
"
Found Branchfile in
{
directory
}
"
)
sub_repos
=
read_branchfile
(
f
"
{
directory
}
/
{
branchfile
}
"
)
for
repo
in
sub_repos
:
print
(
f
"
Subrepo found:
{
repo
.
directory
}
"
)
repo_checkout
(
f
"
{
directory
}
/
{
repo
.
directory
}
"
,
repo
.
branch
,
branchfile
)
def
repo_checkout
(
directory
,
branch
):
def
repo_checkout
(
directory
,
branch
,
branchfile
):
print
(
f
"
Checking out
{
directory
}
to branch
{
branch
}
"
)
print
(
f
"
Checking out
{
directory
}
to branch
{
branch
}
"
)
os
.
system
(
f
"
cd
{
directory
}
; git checkout
{
branch
}
"
)
os
.
system
(
f
"
cd
{
directory
}
; git checkout
{
branch
}
"
)
find_branchfile
(
directory
,
branchfile
)
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
# Capture Arguments from Command Line
# Capture Arguments from Command Line
...
@@ -41,4 +52,4 @@ if __name__ == "__main__":
...
@@ -41,4 +52,4 @@ if __name__ == "__main__":
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
sub_repos
=
read_branchfile
(
args
.
branchfile
)
sub_repos
=
read_branchfile
(
args
.
branchfile
)
for
repo
in
sub_repos
:
for
repo
in
sub_repos
:
repo_checkout
(
repo
.
directory
,
repo
.
branch
)
repo_checkout
(
repo
.
directory
,
repo
.
branch
,
args
.
branchfile
)
This diff is collapsed.
Click to expand it.
projbranch
0 → 100644
+
13
−
0
View file @
8ac6b154
#-----------------------------------------------------------------------------
# SoC Labs Sub repository branch setup
# A joint work commissioned on behalf of SoC Labs, under Arm Academic Access license.
#
# Contributors
#
# David Mapstone (d.a.mapstone@soton.ac.uk)
#
# Copyright 2023, SoC Labs (www.soclabs.org)
#-----------------------------------------------------------------------------
# Each Repo needs to have its branch set manually in here - they will defaultly be checked out to main
tools/chipkit_flow: main
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment