Commit 3b9a5bb8 authored by agable's avatar agable Committed by Commit bot

Delete git-auto-svn and its docs

We no longer support git-svn as a workflow.

R=iannucci@chromium.org
BUG=475320

Review-Url: https://codereview.chromium.org/2360143002
parent b61b9b75
......@@ -182,9 +182,6 @@ class GclientGitSvnCheckout(GclientGitCheckout, SvnCheckout):
wd = os.path.join(self.base, real_path)
if self.options.dry_run:
print 'cd %s' % wd
if svn_spec.get('auto'):
self.run_git('auto-svn', cwd=wd)
continue
self.run_git('svn', 'init', svn_spec['svn_url'], cwd=wd)
self.run_git('config', '--unset-all', 'svn-remote.svn.fetch', cwd=wd)
for svn_branch, git_ref in svn_spec.get('git_svn_fetch', {}).items():
......
......@@ -23,11 +23,8 @@ class DepotTools(config_util.Config):
}
spec = {
'solutions': [solution],
'auto': True,
}
checkout_type = 'gclient_git_svn'
if props.get('nosvn'):
checkout_type = 'gclient_git'
checkout_type = 'gclient_git'
spec_type = '%s_spec' % checkout_type
return {
'type': checkout_type,
......
#!/usr/bin/env bash
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
. $(type -P python_runner.sh)
#!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Performs all git-svn setup steps necessary for 'git svn dcommit' to work.
Assumes that trunk of the svn remote maps to master of the git remote.
Example:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools
cd depot_tools
git auto-svn
"""
import argparse
import os
import sys
import urlparse
import subprocess2
from git_common import run as run_git
from git_common import run_stream_with_retcode as run_git_stream_with_retcode
from git_common import set_config, root, ROOT, current_branch
from git_common import upstream as get_upstream
from git_footers import get_footer_svn_id
SVN_EXE = ROOT+'\\svn.bat' if sys.platform.startswith('win') else 'svn'
def run_svn(*cmd, **kwargs):
"""Runs an svn command.
Returns (stdout, stderr) as a pair of strings.
Raises subprocess2.CalledProcessError on nonzero return code.
"""
kwargs.setdefault('stdin', subprocess2.PIPE)
kwargs.setdefault('stdout', subprocess2.PIPE)
kwargs.setdefault('stderr', subprocess2.PIPE)
cmd = (SVN_EXE,) + cmd
proc = subprocess2.Popen(cmd, **kwargs)
ret, err = proc.communicate()
retcode = proc.wait()
if retcode != 0:
raise subprocess2.CalledProcessError(retcode, cmd, os.getcwd(), ret, err)
return ret, err
def main(argv):
# No command line flags. Just use the parser to prevent people from trying
# to pass flags that don't do anything, and to provide 'usage'.
parser = argparse.ArgumentParser(
description='Automatically set up git-svn for a repo mirrored from svn.')
parser.parse_args(argv)
upstreams = []
# Always configure the upstream trunk.
upstreams.append(root())
# Optionally configure whatever upstream branch might be currently checked
# out. This is needed for work on svn-based branches, otherwise git-svn gets
# very confused and tries to relate branch commits back to trunk, making a big
# mess of the codereview patches, and generating all kinds of spurious errors
# about the repo being in some sort of bad state.
curr_upstream = get_upstream(current_branch())
# There will be no upstream if the checkout is in detached HEAD.
if curr_upstream:
upstreams.append(curr_upstream)
for upstream in upstreams:
config_svn(upstream)
return 0
def config_svn(upstream):
svn_id = get_footer_svn_id(upstream)
assert svn_id, 'No valid git-svn-id footer found on %s.' % upstream
print 'Found git-svn-id footer %s on %s' % (svn_id, upstream)
parsed_svn = urlparse.urlparse(svn_id)
path_components = parsed_svn.path.split('/')
svn_repo = None
svn_path = None
for i in xrange(len(path_components)):
try:
maybe_repo = '%s://%s%s' % (
parsed_svn.scheme, parsed_svn.netloc, '/'.join(path_components[:i+1]))
print 'Checking ', maybe_repo
run_svn('info', maybe_repo)
svn_repo = maybe_repo
svn_path = '/'.join(path_components[i+1:])
break
except subprocess2.CalledProcessError, e:
if 'E170001' in str(e):
print 'Authentication failed:'
print e
print ('Try running "svn ls %s" with the password'
' from https://chromium-access.appspot.com' % maybe_repo)
print
continue
assert svn_repo is not None, 'Unable to find svn repo for %s' % svn_id
print 'Found upstream svn repo %s and path %s' % (svn_repo, svn_path)
run_git('config', '--local', '--replace-all', 'svn-remote.svn.url', svn_repo)
run_git('config', '--local', '--replace-all', 'svn-remote.svn.fetch',
'%s:refs/remotes/%s' % (svn_path, upstream),
'refs/remotes/%s$' % upstream)
print 'Configured metadata, running "git svn fetch". This may take some time.'
with run_git_stream_with_retcode('svn', 'fetch') as stdout:
for line in stdout.xreadlines():
print line.strip()
if __name__ == '__main__':
try:
sys.exit(main(sys.argv[1:]))
except KeyboardInterrupt:
sys.stderr.write('interrupted\n')
sys.exit(1)
......@@ -4400,8 +4400,8 @@ def CMDdcommit(parser, args):
if not settings.GetIsGitSvn():
if git_footers.get_footer_svn_id():
# If it looks like previous commits were mirrored with git-svn.
message = """This repository appears to be a git-svn mirror, but no
upstream SVN master is set. You probably need to run 'git auto-svn' once."""
message = """This repository appears to be a git-svn mirror, but we
don't support git-svn mirrors anymore."""
else:
message = """This doesn't appear to be an SVN repository.
If your project has a true, writeable git repository, you probably want to run
......
......@@ -771,14 +771,6 @@ ease the develpment workflow.</p></div>
<div class="paragraph"><p>A tutorial for these tools can be found at <a href="depot_tools_tutorial.html">depot_tools_tutorial(7)</a>.</p></div>
<div class="dlist"><dl>
<dt class="hdlist1">
<a href="git-auto-svn.html">git-auto-svn(1)</a>
</dt>
<dd>
<p>
Automatically set up git-svn metadata for a repo mirrored from SVN.
</p>
</dd>
<dt class="hdlist1">
<a href="git-cherry-pick-upload.html">git-cherry-pick-upload(1)</a>
</dt>
<dd>
......
This diff is collapsed.
'\" t
.\" Title: git-auto-svn
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 07/21/2016
.\" Manual: Chromium depot_tools Manual
.\" Source: depot_tools bf2a341
.\" Language: English
.\"
.TH "GIT\-AUTO\-SVN" "1" "07/21/2016" "depot_tools bf2a341" "Chromium depot_tools Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-auto-svn \- Automatically set up git\-svn metadata for a repo mirrored from SVN\&.
.SH "SYNOPSIS"
.sp
.nf
\fIgit auto\-svn\fR
.fi
.sp
.SH "DESCRIPTION"
.sp
git auto\-svn automatically sets up git\-svn metadata and runs git\-svn fetch for repos that are homed in SVN but mirrored to Git (such as depot_tools itself)\&.
.sp
It determines the metadata to use by inspecting the git\-svn\-id footer of the HEAD of the remote upstream ref (by default, origin/master)\&. git\-svn\-id footers look like this:
.sp
.if n \{\
.RS 4
.\}
.nf
git\-svn\-id: svn://some\&.host\&.org/repo/path/to/a/sub/folder@123456 0039d316\-1c4b\-4281\-b951\-d872f2087c98
.fi
.if n \{\
.RE
.\}
.sp
git auto\-svn extracts the repository url (svn://some\&.host\&.org/repo/path/to/a/sub/folder) from the git\-svn\-id, and splits it into the root repository (svn://some\&.host\&.org/repo) and the path within that repository (/path/to/a/sub/folder)\&.
.sp
It then sets up the following stanza in \&.git/config:
.sp
.if n \{\
.RS 4
.\}
.nf
[svn\-remote "svn"]
url = svn://some\&.host\&.org/repo
fetch = path/to/a/sub/folder:refs/remotes/origin/master
.fi
.if n \{\
.RE
.\}
.sp
Finally, it runs git svn fetch to pull in the data from the svn remote\&.
.SH "CONFIGURATION VARIABLES"
.SS "svn\-remote\&.svn\&.url"
.sp
This is the url of the root of the remote svn repository\&.
.SS "svn\-remote\&.svn\&.fetch"
.sp
This looks like a git refspec, but maps a subdirectory of the svn repository to a single ref in the git remote\&.
.SH "EXAMPLE"
.sp
.if n \{\
.RS 4
.\}
.nf
git clone https://chromium\&.googlesource\&.com/chromium/tools/depot_tools
cd depot_tools
git auto\-svn
.fi
.if n \{\
.RE
.\}
.sp
This results in the following stanza in depot_tools/\&.git/config:
.sp
.if n \{\
.RS 4
.\}
.nf
[svn\-remote "svn"]
url = svn://svn\&.chromium\&.org/chrome
fetch = trunk/tools/depot_tools:refs/remotes/origin/master
.fi
.if n \{\
.RE
.\}
.SH "CHROMIUM DEPOT_TOOLS"
.sp
Part of the chromium \fBdepot_tools\fR(7) suite\&. These tools are meant to assist with the development of chromium and related projects\&. Download the tools from \m[blue]\fBhere\fR\m[]\&\s-2\u[1]\d\s+2\&.
.SH "NOTES"
.IP " 1." 4
here
.RS 4
\%https://chromium.googlesource.com/chromium/tools/depot_tools
.RE
......@@ -42,11 +42,6 @@ A listing of both categories of tools follows\&.
.sp
A tutorial for these tools can be found at \fBdepot_tools_tutorial\fR(7)\&.
.PP
\fBgit-auto-svn\fR(1)
.RS 4
Automatically set up git\-svn metadata for a repo mirrored from SVN\&.
.RE
.PP
\fBgit-cherry-pick-upload\fR(1)
.RS 4
Upload the diff between a revision and its parent to rietveld\&.
......
git-auto-svn(1)
===============
NAME
----
git-auto-svn -
include::_git-auto-svn_desc.helper.txt[]
SYNOPSIS
--------
[verse]
'git auto-svn'
DESCRIPTION
-----------
`git auto-svn` automatically sets up git-svn metadata and runs git-svn fetch for
repos that are homed in SVN but mirrored to Git (such as depot_tools itself).
It determines the metadata to use by inspecting the `git-svn-id` footer of the
HEAD of the remote upstream ref (by default, `origin/master`). `git-svn-id`
footers look like this:
git-svn-id: svn://some.host.org/repo/path/to/a/sub/folder@123456 0039d316-1c4b-4281-b951-d872f2087c98
`git auto-svn` extracts the repository url
(svn://some.host.org/repo/path/to/a/sub/folder) from the `git-svn-id`, and
splits it into the root repository (svn://some.host.org/repo) and the path
within that repository (/path/to/a/sub/folder).
It then sets up the following stanza in .git/config:
[svn-remote "svn"]
url = svn://some.host.org/repo
fetch = path/to/a/sub/folder:refs/remotes/origin/master
Finally, it runs `git svn fetch` to pull in the data from the svn remote.
CONFIGURATION VARIABLES
-----------------------
svn-remote.svn.url
~~~~~~~~~~~~~~~~~~
This is the url of the root of the remote svn repository.
svn-remote.svn.fetch
~~~~~~~~~~~~~~~~~~~~
This looks like a git refspec, but maps a subdirectory of the svn repository
to a single ref in the git remote.
EXAMPLE
-------
git clone https://chromium.googlesource.com/chromium/tools/depot_tools
cd depot_tools
git auto-svn
This results in the following stanza in `depot_tools/.git/config`:
[svn-remote "svn"]
url = svn://svn.chromium.org/chrome
fetch = trunk/tools/depot_tools:refs/remotes/origin/master
include::_footer.txt[]
// vim: ft=asciidoc:
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