mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-07-04 20:17:16 +00:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
45d21685b9 | |||
597868b4c4 | |||
75b4c2deac | |||
b75415075c | |||
5f434ed723 | |||
606eab8043 | |||
cd07cfae1c | |||
55693aabe5 | |||
23bd3a1dd3 | |||
bbf71fe363 |
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
# Prevent /bin/sh scripts from being clobbered by autocrlf=true
|
||||
git_ssh text eol=lf
|
||||
main.py text eol=lf
|
||||
repo text eol=lf
|
18
color.py
18
color.py
@ -126,6 +126,13 @@ class Coloring(object):
|
||||
s._out.write(c(fmt, *args))
|
||||
return f
|
||||
|
||||
def nofmt_printer(self, opt=None, fg=None, bg=None, attr=None):
|
||||
s = self
|
||||
c = self.nofmt_colorer(opt, fg, bg, attr)
|
||||
def f(fmt):
|
||||
s._out.write(c(fmt))
|
||||
return f
|
||||
|
||||
def colorer(self, opt=None, fg=None, bg=None, attr=None):
|
||||
if self._on:
|
||||
c = self._parse(opt, fg, bg, attr)
|
||||
@ -138,6 +145,17 @@ class Coloring(object):
|
||||
return fmt % args
|
||||
return f
|
||||
|
||||
def nofmt_colorer(self, opt=None, fg=None, bg=None, attr=None):
|
||||
if self._on:
|
||||
c = self._parse(opt, fg, bg, attr)
|
||||
def f(fmt):
|
||||
return ''.join([c, fmt, RESET])
|
||||
return f
|
||||
else:
|
||||
def f(fmt):
|
||||
return fmt
|
||||
return f
|
||||
|
||||
def _parse(self, opt, fg, bg, attr):
|
||||
if not opt:
|
||||
return _Color(fg, bg, attr)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# From Gerrit Code Review 2.5-rc0
|
||||
# From Gerrit Code Review 2.5.2
|
||||
#
|
||||
# Part of Gerrit Code Review (http://code.google.com/p/gerrit/)
|
||||
#
|
||||
@ -18,6 +18,8 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
unset GREP_OPTIONS
|
||||
|
||||
CHANGE_ID_AFTER="Bug|Issue"
|
||||
MSG="$1"
|
||||
|
||||
|
@ -335,8 +335,8 @@ class XmlManifest(object):
|
||||
|
||||
local = os.path.join(self.repodir, LOCAL_MANIFEST_NAME)
|
||||
if os.path.exists(local):
|
||||
print('warning: %s is deprecated; put local manifests in %s instead'
|
||||
% (LOCAL_MANIFEST_NAME, LOCAL_MANIFESTS_DIR_NAME),
|
||||
print('warning: %s is deprecated; put local manifests in `%s` instead'
|
||||
% (LOCAL_MANIFEST_NAME, os.path.join(self.repodir, LOCAL_MANIFESTS_DIR_NAME)),
|
||||
file=sys.stderr)
|
||||
nodes.append(self._ParseManifestXml(local, self.repodir))
|
||||
|
||||
@ -344,11 +344,8 @@ class XmlManifest(object):
|
||||
try:
|
||||
for local_file in sorted(os.listdir(local_dir)):
|
||||
if local_file.endswith('.xml'):
|
||||
try:
|
||||
local = os.path.join(local_dir, local_file)
|
||||
nodes.append(self._ParseManifestXml(local, self.repodir))
|
||||
except ManifestParseError as e:
|
||||
print('%s' % str(e), file=sys.stderr)
|
||||
local = os.path.join(local_dir, local_file)
|
||||
nodes.append(self._ParseManifestXml(local, self.repodir))
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
19
project.py
19
project.py
@ -946,6 +946,11 @@ class Project(object):
|
||||
dest_branch)
|
||||
if auto_topic:
|
||||
ref_spec = ref_spec + '/' + branch.name
|
||||
if not url.startswith('ssh://'):
|
||||
rp = ['r=%s' % p for p in people[0]] + \
|
||||
['cc=%s' % p for p in people[1]]
|
||||
if rp:
|
||||
ref_spec = ref_spec + '%' + ','.join(rp)
|
||||
cmd.append(ref_spec)
|
||||
|
||||
if GitCommand(self, cmd, bare = True).Wait() != 0:
|
||||
@ -963,7 +968,8 @@ class Project(object):
|
||||
quiet=False,
|
||||
is_new=None,
|
||||
current_branch_only=False,
|
||||
clone_bundle=True):
|
||||
clone_bundle=True,
|
||||
no_tags=False):
|
||||
"""Perform only the network IO portion of the sync process.
|
||||
Local working directory/branch state is not affected.
|
||||
"""
|
||||
@ -1001,7 +1007,8 @@ class Project(object):
|
||||
current_branch_only = True
|
||||
|
||||
if not self._RemoteFetch(initial=is_new, quiet=quiet, alt_dir=alt_dir,
|
||||
current_branch_only=current_branch_only):
|
||||
current_branch_only=current_branch_only,
|
||||
no_tags=no_tags):
|
||||
return False
|
||||
|
||||
if self.worktree:
|
||||
@ -1551,7 +1558,8 @@ class Project(object):
|
||||
current_branch_only=False,
|
||||
initial=False,
|
||||
quiet=False,
|
||||
alt_dir=None):
|
||||
alt_dir=None,
|
||||
no_tags=False):
|
||||
|
||||
is_sha1 = False
|
||||
tag_name = None
|
||||
@ -1644,7 +1652,10 @@ class Project(object):
|
||||
|
||||
if not current_branch_only:
|
||||
# Fetch whole repo
|
||||
cmd.append('--tags')
|
||||
if no_tags:
|
||||
cmd.append('--no-tags')
|
||||
else:
|
||||
cmd.append('--tags')
|
||||
cmd.append((u'+refs/heads/*:') + remote.ToLocal('refs/heads/*'))
|
||||
elif tag_name is not None:
|
||||
cmd.append('tag')
|
||||
|
@ -83,8 +83,8 @@ change id will be added.
|
||||
else:
|
||||
print('NOTE: When committing (please see above) and editing the commit'
|
||||
'message, please remove the old Change-Id-line and add:')
|
||||
print(self._GetReference(sha1), file=stderr)
|
||||
print(file=stderr)
|
||||
print(self._GetReference(sha1), file=sys.stderr)
|
||||
print(file=sys.stderr)
|
||||
|
||||
def _IsChangeId(self, line):
|
||||
return CHANGE_ID_RE.match(line)
|
||||
|
@ -48,7 +48,7 @@ class Info(PagedCommand):
|
||||
self.headtext = self.out.printer('headtext', fg = 'yellow')
|
||||
self.redtext = self.out.printer('redtext', fg = 'red')
|
||||
self.sha = self.out.printer("sha", fg = 'yellow')
|
||||
self.text = self.out.printer('text')
|
||||
self.text = self.out.nofmt_printer('text')
|
||||
self.dimtext = self.out.printer('dimtext', attr = 'dim')
|
||||
|
||||
self.opt = opt
|
||||
|
@ -189,6 +189,9 @@ later is required to fix a server side protocol bug.
|
||||
p.add_option('--fetch-submodules',
|
||||
dest='fetch_submodules', action='store_true',
|
||||
help='fetch submodules from server')
|
||||
p.add_option('--no-tags',
|
||||
dest='no_tags', action='store_true',
|
||||
help="don't fetch tags")
|
||||
if show_smart:
|
||||
p.add_option('-s', '--smart-sync',
|
||||
dest='smart_sync', action='store_true',
|
||||
@ -235,7 +238,8 @@ later is required to fix a server side protocol bug.
|
||||
success = project.Sync_NetworkHalf(
|
||||
quiet=opt.quiet,
|
||||
current_branch_only=opt.current_branch_only,
|
||||
clone_bundle=not opt.no_clone_bundle)
|
||||
clone_bundle=not opt.no_clone_bundle,
|
||||
no_tags=opt.no_tags)
|
||||
self._fetch_times.Set(project, time.time() - start)
|
||||
|
||||
# Lock around all the rest of the code, since printing, updating a set
|
||||
@ -273,7 +277,8 @@ later is required to fix a server side protocol bug.
|
||||
if project.Sync_NetworkHalf(
|
||||
quiet=opt.quiet,
|
||||
current_branch_only=opt.current_branch_only,
|
||||
clone_bundle=not opt.no_clone_bundle):
|
||||
clone_bundle=not opt.no_clone_bundle,
|
||||
no_tags=opt.no_tags):
|
||||
fetched.add(project.gitdir)
|
||||
else:
|
||||
print('error: Cannot fetch %s' % project.name, file=sys.stderr)
|
||||
@ -558,7 +563,8 @@ later is required to fix a server side protocol bug.
|
||||
|
||||
if not opt.local_only:
|
||||
mp.Sync_NetworkHalf(quiet=opt.quiet,
|
||||
current_branch_only=opt.current_branch_only)
|
||||
current_branch_only=opt.current_branch_only,
|
||||
no_tags=opt.no_tags)
|
||||
|
||||
if mp.HasChanges:
|
||||
syncbuf = SyncBuffer(mp.config)
|
||||
|
Reference in New Issue
Block a user