Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
external_updater
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test-restored
platform
tools
external_updater
Commits
3df50369
Commit
3df50369
authored
Feb 3, 2019
by
Haibo Huang
Committed by
android-build-merger
Feb 3, 2019
Browse files
Options
Downloads
Plain Diff
[Updater] Merge by SHA instead of branch am:
66479dd6
am:
40f1bbfb
Change-Id: I2dd22a8c5c81556c4b93fac25b569af78fd73642
parents
60fd594e
40f1bbfb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
git_updater.py
+2
-27
2 additions, 27 deletions
git_updater.py
with
2 additions
and
27 deletions
git_updater.py
+
2
−
27
View file @
3df50369
...
...
@@ -34,7 +34,6 @@ class GitUpdater():
self
.
upstream_remote_name
=
None
self
.
android_remote_name
=
None
self
.
new_version
=
None
self
.
merge_from
=
None
def
_setup_remote
(
self
):
remotes
=
git_utils
.
list_remotes
(
self
.
proj_path
)
...
...
@@ -79,7 +78,6 @@ class GitUpdater():
current_ver
=
self
.
get_current_version
()
self
.
new_version
=
updater_utils
.
get_latest_version
(
current_ver
,
tags
)
self
.
merge_from
=
self
.
new_version
print
(
'
Current version: {}. Latest version: {}
'
.
format
(
current_ver
,
self
.
new_version
),
end
=
''
)
...
...
@@ -94,17 +92,6 @@ class GitUpdater():
self
.
new_version
=
commits
[
0
]
# See whether we have a local upstream.
branches
=
git_utils
.
list_remote_branches
(
self
.
proj_path
,
self
.
android_remote_name
)
upstreams
=
[
branch
for
branch
in
branches
if
branch
.
startswith
(
'
upstream-
'
)]
if
upstreams
:
self
.
merge_from
=
'
{}/{}
'
.
format
(
self
.
android_remote_name
,
upstreams
[
0
])
else
:
self
.
merge_from
=
'
update_origin/master
'
commit_time
=
git_utils
.
get_commit_time
(
self
.
proj_path
,
commits
[
-
1
])
time_behind
=
datetime
.
datetime
.
now
()
-
commit_time
print
(
'
{} commits ({} days) behind.
'
.
format
(
...
...
@@ -123,20 +110,8 @@ class GitUpdater():
"""
upstream_branch
=
self
.
upstream_remote_name
+
'
/master
'
commits
=
git_utils
.
get_commits_ahead
(
self
.
proj_path
,
self
.
merge_from
,
upstream_branch
)
if
commits
:
print
(
'
{} is {} commits ahead of {}. {}
'
.
format
(
self
.
merge_from
,
len
(
commits
),
upstream_branch
,
commits
))
commits
=
git_utils
.
get_commits_ahead
(
self
.
proj_path
,
upstream_branch
,
self
.
merge_from
)
if
commits
:
print
(
'
{} is {} commits behind of {}.
'
.
format
(
self
.
merge_from
,
len
(
commits
),
upstream_branch
))
print
(
"
Running `git merge {merge_branch}`...
"
.
format
(
merge_branch
=
self
.
merge_from
))
git_utils
.
merge
(
self
.
proj_path
,
self
.
merge_from
)
.
format
(
merge_branch
=
self
.
new_version
))
git_utils
.
merge
(
self
.
proj_path
,
self
.
new_version
)
self
.
_write_metadata
(
self
.
proj_path
)
git_utils
.
add_file
(
self
.
proj_path
,
'
METADATA
'
)
This diff is collapsed.
Click to expand it.
CodeLinaro
@codelinaro
mentioned in commit
59eb6a39
·
Jul 19, 2024
mentioned in commit
59eb6a39
mentioned in commit 59eb6a394a3afa0b13eaa878dbbd1b479b3fc93a
Toggle commit list
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