Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
git-repo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux-tools
git-repo
Commits
18070738
Commit
18070738
authored
Jul 10, 2014
by
Matthias Putz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added dry-run + sync report (by felix)
parent
2f6e71cc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
sync.py
subcmds/sync.py
+21
-1
No files found.
subcmds/sync.py
View file @
18070738
...
...
@@ -26,6 +26,7 @@ import sys
import
time
import
urllib.request
,
urllib
.
parse
,
urllib
.
error
import
xmlrpc
from
git_command
import
GitCommand
#try:
import
threading
as
_threading
...
...
@@ -169,6 +170,9 @@ later is required to fix a server side protocol bug.
p
.
add_option
(
'-d'
,
'--detach'
,
dest
=
'detach_head'
,
action
=
'store_true'
,
help
=
'detach projects back to manifest revision'
)
p
.
add_option
(
'--dry-run'
,
action
=
'store_true'
,
dest
=
'dry_run'
,
help
=
'dry run; do not rebase after fetch'
)
p
.
add_option
(
'-c'
,
'--current-branch'
,
dest
=
'current_branch_only'
,
action
=
'store_true'
,
help
=
'fetch only current branch from server'
)
...
...
@@ -190,6 +194,9 @@ later is required to fix a server side protocol bug.
p
.
add_option
(
'-p'
,
'--manifest-server-password'
,
action
=
'store'
,
dest
=
'manifest_server_password'
,
help
=
'password to authenticate with the manifest server'
)
p
.
add_option
(
'-r'
,
'--report'
,
action
=
'store_true'
,
dest
=
'report'
,
help
=
'print report after sync'
)
p
.
add_option
(
'--fetch-submodules'
,
dest
=
'fetch_submodules'
,
action
=
'store_true'
,
help
=
'fetch submodules from server'
)
...
...
@@ -633,6 +640,19 @@ later is required to fix a server side protocol bug.
for
project
in
all_projects
:
pm
.
update
()
if
project
.
worktree
:
if
opt
.
report
:
p
=
GitCommand
(
project
,
[
'log'
,
'--pretty=
%
h
%
s (
%
cn,
%
ar)'
,
'HEAD..m/master'
],
capture_stdout
=
True
)
if
p
.
Wait
()
!=
0
:
print
(
"Failed to create report"
)
else
:
if
len
(
p
.
stdout
):
print
(
'
\n
'
+
project
.
name
+
':
\n
'
)
print
(
portable
.
stream2str
(
p
.
stdout
)[:
-
1
])
print
(
'
\n
'
)
if
not
opt
.
dry_run
:
project
.
Sync_LocalHalf
(
syncbuf
)
pm
.
end
()
print
(
file
=
sys
.
stderr
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment