git-repo/subcmds
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
..
__init__.py Initial Contribution 2008-10-21 07:00:00 -07:00
abandon.py Fixed repo abandon to give better messages. 2011-04-07 16:49:23 -04:00
branches.py branches: Enable output of multiple projects 2010-05-04 07:51:28 -07:00
checkout.py Improve checkout performance for the common unmodified case 2009-04-18 15:04:41 -07:00
diff.py Initial Contribution 2008-10-21 07:00:00 -07:00
download.py Fix to display the usage message of the command download when the user 2011-01-09 17:39:22 -08:00
forall.py forall: Silently skip missing projects 2011-01-09 17:39:22 -08:00
grep.py Fix format string bugs in grep 2010-06-17 19:09:37 -07:00
help.py help: Don't show empty Summary or Description sections 2011-01-09 17:39:22 -08:00
init.py Fixed problems w/ 2nd repo init if first repo init had bad URL. 2011-04-07 16:51:50 -04:00
list.py Add 'list' command to repo. 2011-03-16 12:55:44 -07:00
manifest.py Add repo manifest -o to save a manifest 2009-03-05 10:32:38 -08:00
prune.py Initial Contribution 2008-10-21 07:00:00 -07:00
rebase.py rebase: Pass through more options 2010-07-15 17:43:02 -07:00
selfupdate.py sync: Run git gc --auto after fetch 2011-01-09 17:39:22 -08:00
smartsync.py Aliasing sync -s to 'smartsync' 2010-05-17 09:58:55 -07:00
stage.py Only display project path in 'repo stage -i' 2009-04-18 11:22:13 -07:00
start.py Require a project or '--all' to be specified when using 'repo start'. 2009-04-22 18:05:50 -07:00
status.py Add option to check status of projects in parallel. 2011-04-07 16:36:42 -04:00
sync.py Fix parallel sync on python < 2.6. 2011-04-04 11:34:47 -04:00
upload.py Support repo-level pre-upload hook and prep for future hooks. 2011-03-11 11:53:23 -08:00
version.py Don't permit users to run repo status in a mirror client 2009-03-03 17:47:06 -08:00