Commit 18070738 authored by Matthias Putz's avatar Matthias Putz

added dry-run + sync report (by felix)

parent 2f6e71cc
...@@ -26,6 +26,7 @@ import sys ...@@ -26,6 +26,7 @@ import sys
import time import time
import urllib.request, urllib.parse, urllib.error import urllib.request, urllib.parse, urllib.error
import xmlrpc import xmlrpc
from git_command import GitCommand
#try: #try:
import threading as _threading import threading as _threading
...@@ -169,6 +170,9 @@ later is required to fix a server side protocol bug. ...@@ -169,6 +170,9 @@ later is required to fix a server side protocol bug.
p.add_option('-d', '--detach', p.add_option('-d', '--detach',
dest='detach_head', action='store_true', dest='detach_head', action='store_true',
help='detach projects back to manifest revision') 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', p.add_option('-c', '--current-branch',
dest='current_branch_only', action='store_true', dest='current_branch_only', action='store_true',
help='fetch only current branch from server') help='fetch only current branch from server')
...@@ -190,6 +194,9 @@ later is required to fix a server side protocol bug. ...@@ -190,6 +194,9 @@ later is required to fix a server side protocol bug.
p.add_option('-p', '--manifest-server-password', action='store', p.add_option('-p', '--manifest-server-password', action='store',
dest='manifest_server_password', dest='manifest_server_password',
help='password to authenticate with the manifest server') 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', p.add_option('--fetch-submodules',
dest='fetch_submodules', action='store_true', dest='fetch_submodules', action='store_true',
help='fetch submodules from server') help='fetch submodules from server')
...@@ -633,7 +640,20 @@ later is required to fix a server side protocol bug. ...@@ -633,7 +640,20 @@ later is required to fix a server side protocol bug.
for project in all_projects: for project in all_projects:
pm.update() pm.update()
if project.worktree: if project.worktree:
project.Sync_LocalHalf(syncbuf) 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() pm.end()
print(file=sys.stderr) print(file=sys.stderr)
if not syncbuf.Finish(): if not syncbuf.Finish():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment