Go to file
Doug Anderson 2630dd9787 Fixed problems w/ 2nd repo init if first repo init had bad URL.
This is the simplest fix: if we had problems syncing the
manifest.git directory and we were the ones that created it,
we should delete it.  This doesn't try to do anything complex
like try to recover from a .repo directory that got broken in
some other way.

This is filed as: <http://crosbug.com/13403>

TEST=manual

Init once with a bad URL:
  $ repo init -u http://foobar.example.com
  Getting manifest ...
     from http://foobar.example.com
  Connection closed by 172.22.121.77
  error: Couldn't resolve host 'foobar.example.com' while accessing http://foobar.example.com/info/refs

  fatal: HTTP request failed
  fatal: cannot obtain manifest http://foobar.example.com

Init again: identical to the first.  Good:
  $ repo init -u http://foobar.example.com
  Getting manifest ...
     from http://foobar.example.com
  Connection closed by 172.22.121.77
  error: Couldn't resolve host 'foobar.example.com' while accessing http://foobar.example.com/info/refs

  fatal: HTTP request failed
  fatal: cannot obtain manifest http://foobar.example.com

Init with correct URL:
  $ repo init -u http://git.chromium.org/git/manifest -m minilayout.xml
  Getting manifest ...
     from http://git.chromium.org/git/manifest
  [ ... cut ... ]

  repo initialized in /.../repoiniterr

Try a bad URL after a good one; it doesn't get saved (good):
  $ repo init -u http://foobar.example.com
  Connection closed by 172.22.121.77
  error: Couldn't resolve host 'foobar.example.com' while accessing http://foobar.example.com/info/refs

  fatal: HTTP request failed
  fatal: cannot obtain manifest http://foobar.example.com

Just to confirm, I can still do a good one after a bad...
  $ repo init -u http://git.chromium.org/git/manifest -m minilayout.xml

  Your Name  [George Washington]:
  Your Email [george@washington.example.com]:

  Your identity is: George Washington <george@washington.example.com>
  is this correct [y/n]? y

  repo initialized in /.../repoiniterr

Change-Id: I1692821a330d97b1d218b2e191a93245b33f2362
2011-04-07 16:51:50 -04:00
docs Support repo-level pre-upload hook and prep for future hooks. 2011-03-11 11:53:23 -08:00
hooks Automatically install Gerrit Code Review's commit-msg hook 2010-03-06 19:21:00 -08:00
subcmds Fixed problems w/ 2nd repo init if first repo init had bad URL. 2011-04-07 16:51:50 -04:00
tests Fix error parsing a non-existant configuration file 2009-07-02 16:12:57 -07:00
.gitignore .gitignore: add an entry for repopickles 2009-06-28 15:08:56 -07:00
.project Add PyDev project files to repo 2009-06-02 00:09:07 +02:00
.pydevproject Add PyDev project files to repo 2009-06-02 00:09:07 +02:00
color.py Add -p to repo forall to improve output formatting 2009-04-18 13:49:13 -07:00
command.py Make path references OS independent 2011-01-09 17:39:19 -08:00
COPYING Initial Contribution 2008-10-21 07:00:00 -07:00
editor.py Fix for handling values of EDITOR which contain a space. 2010-08-06 17:05:04 -07:00
error.py Support repo-level pre-upload hook and prep for future hooks. 2011-03-11 11:53:23 -08:00
git_command.py Use os.environ.copy() instead of dict() 2011-01-09 17:39:22 -08:00
git_config.py upload: Catch and cleanly report connectivity errors 2011-01-09 17:39:22 -08:00
git_refs.py Make usage of open safer by setting binary mode and closing fds 2009-04-18 14:48:03 -07:00
git_ssh Don't allow git fetch to start ControlMaster 2010-10-29 08:15:14 -07:00
main.py Add "repo branch" as an alias for "repo branches" 2011-01-09 17:39:22 -08:00
manifest_xml.py Support repo-level pre-upload hook and prep for future hooks. 2011-03-11 11:53:23 -08:00
pager.py Don't start the pager if stdout is a pipe 2009-04-01 07:24:22 -07:00
progress.py Do not emit progress if stderr is not a tty 2010-05-27 16:48:36 -07:00
project.py Fixed repo abandon to give better messages. 2011-04-07 16:49:23 -04:00
repo Bump repo version to 1,10 2011-01-10 09:01:24 -08:00
SUBMITTING_PATCHES Document how to contribute to the repo project 2009-07-02 13:18:55 -07:00
trace.py Fix repo --trace to show ref and config loads 2009-04-18 09:54:51 -07:00