1. 08 Apr, 2016 1 commit
    • Mark E. Hamilton's avatar
      repo: Repo does not always handle '.' parameter correctly · f9fe3e14
      Mark E. Hamilton authored
      The repo script allows a manifest to specify a '.' as the path the
      top-level directory, which co-locates the .git and .repo directories,
      and places files from the git repository at the top-level:
      
        <project name="proj_name" path="." />
        <project name="sierra.other.git" path="other" />
      
      Most commands work correctly with this setup. Some commands, however,
      fail to find the project. For instance, 'repo sync' works, and 'repo sync .'
      works in a sub-project ('other' in this case) but 'repo sync .' in the
      top-level directory fails with the error:
      
      error: project . not found
      
      There are two reasons for this:
      
      1. The self.worktree attribute of the Project object is not normalized,
      so with a '.' for path its value would be '/my/project/root/.'. This is
      fine when used as a path, since it's the same path as '/my/project/root',
      but when used in a string comparison it fails. This commit applies
      os.path.normpath() to that value before storing it.
      
      2. The _GetProjectByPath method in command.py was not checking the path
      against manifest.topdir, so even once it was normalized the project was
      not found. This commit adds a check against manifest.topdir if the
      loop drops out without finding a project.
      
      Change-Id: Ic84d053f1bbb5a357cad566805d5a326ae8246d2
      f9fe3e14
  2. 06 Apr, 2016 1 commit
    • Dan Willemsen's avatar
      Fix symlinking of new projects · bdb866ea
      Dan Willemsen authored
      We weren't copying these lists, so the += was actually changing the
      underlying lists.
      
      When a new project was added to the manifest, we run _CheckDirReference
      against the manifest project with share_refs=True, which added the
      working_tree_* to the shareable_* lists. Then, when we load the new
      manifest and create the new project, it uses the lists that already
      contain the working_tree_* files, even though we passed
      share_refs=False.
      
      This happens reliably under the above conditions, but doesn't seem to
      happen when syncing a fresh tree. So we've got a mixture of links that
      may need to be cleaned up later. This patch will just stop it from
      happening in the future.
      
      Change-Id: Ib7935bfad78af1e494a75e55134ec829f13c2a41
      bdb866ea
  3. 05 Apr, 2016 2 commits
  4. 15 Mar, 2016 1 commit
  5. 14 Mar, 2016 1 commit
  6. 05 Mar, 2016 1 commit
    • Mike Frysinger's avatar
      RepoHook: set __file__ when running the hook · 4aa4b211
      Mike Frysinger authored
      A common design pattern is to use __file__ to find the location of the
      active python module to assist in output or loading of related assets.
      The current hook systems runs the pre-upload.py hook in a context w/out
      that set leading to runtime errors:
      
      $ repo upload --cbr .
      ERROR: Traceback (most recent call last):
        File ".../repo/project.py", line 481, in _ExecuteHook
          self._script_fullpath, 'exec'), context)
        File ".../repohooks/pre-upload.py", line 32, in <module>
          path = os.path.dirname(os.path.realpath(__file__))
      NameError: name '__file__' is not defined
      
      Define this variable in this context so code can safely use it.
      
      Change-Id: If6331312445fa61d9351b59f83abcc1c99ae6748
      4aa4b211
  7. 02 Mar, 2016 2 commits
    • Mark E. Hamilton's avatar
      command.py: Cleaned up pylint/pep8 violations · 8ccfa74d
      Mark E. Hamilton authored
      I noticed when running pylint (as the SUBMITTING_PATCHES file directs)
      that there were a few violations reported. This makes it difficult
      to see violations I might have introduced. This commit corrects all
      pylint violations in the command.py script.
      
      This script now has a pylint score of 10.0.
      
      Change-Id: Ibb35fa9af0e0b9b40e02ae043682b3af23286748
      8ccfa74d
    • Mark E. Hamilton's avatar
      project.py: Cleaned up pylint/pep8 violations · 30b0f4e0
      Mark E. Hamilton authored
      I noticed when running pylint (as the SUBMITTING_PATCHES file directs)
      that there were a number of violations reported. This makes it difficult
      to see violations I might have introduced. This commit corrects all
      pylint violations in the project.py script.
      
      This script now has a pylint score of 10.0, and no violations reported
      by pep8.
      
      Change-Id: I1462fd84f5b6b4c0dc893052671373e7ffd838f1
      30b0f4e0
  8. 27 Feb, 2016 1 commit
  9. 18 Feb, 2016 1 commit
    • Alexandre Garnier's avatar
      Better error display on forall · 4cfb6d71
      Alexandre Garnier authored
      It was only displaying 'Project list error: GitError()'
      without any useful info about the project nor the error
      
      Change-Id: Iad66cbaa03cad1053b5ae9ecc90d7772aa42ac13
      4cfb6d71
  10. 17 Feb, 2016 1 commit
  11. 15 Feb, 2016 1 commit
    • Mark E. Hamilton's avatar
      repo: Cleaned up pylint/pep8 violations · 4088eb43
      Mark E. Hamilton authored
      I noticed when running pylint (as the SUBMITTING_PATCHES file directs)
      that there were a number of violations reported. This makes it difficult
      to see violations I might have introduced. This commit corrects all
      pylint violations in the repo script.
      
      First I ran this to clean up the formatting:
      
       autopep8 --max-line-length=80 --indent-size 2 repo
      
      Following that the following violations remained:
      
      % pylint --rcfile=.pylintrc repo
      ************* Module repo
      W:220,21: Redefining name 'init_optparse' from outer scope (line 156)
      (redefined-outer-name)
      W:482, 2: No exception type(s) specified (bare-except)
      C:704, 0: Old-style class defined. (old-style-class)
      
      For line 220, the parameter to _GitcInitOptions was renamed so as not to
      mask the init_optparse global.
      
      For line 482, a pylint directive was added to disable the bare-execpt
      violation for just that line.
      
      For line 704, the _Options class was changed to subclass object.
      
      Additionally, the comments at lines 107-113 were spaced out to line up
      with the comment at line 112 that autopep8 moved.
      
      This script now has a pylint score of 10.0
      
      Change-Id: I779b66eb6b061a195d3c4372b99dec1b6d2a214f
      4088eb43
  12. 10 Feb, 2016 1 commit
    • Mark E. Hamilton's avatar
      repo: Add check of REPO_URL env variable · 55536286
      Mark E. Hamilton authored
      We want to be able to run repo on a system that is not connected to
      the Internet and cannot access https://gerrit.googlesource.com. We
      can put a clone of that repos there, but would prefer to use the
      stable version of the repo script instead of a locally modified
      version.
      
      This commit adds a check for the REPO_URL environment variable. If
      that is set and not empty its value will be set in the REPO_URL
      global in repo.  Otherwise the standard path will be used.
      
      Change-Id: I0616f5f81ef75f3463b73623b892cb5eed6bb7ba
      55536286
  13. 04 Feb, 2016 4 commits
  14. 28 Jan, 2016 1 commit
    • Xiaohui Chen's avatar
      Add option to rebase onto project's manifest version · 0b4cb325
      Xiaohui Chen authored
      Some teams have a continuous build server that would mark certain
      manifest green and safe to sync to.  Then team members could repo
      sync to that particular manifest file and make sure they always
      sync to a green build.  But if she/he has some local changes and
      wants to rebase, currently it would be a manual process to find the
      correct version to rebase onto.  This patch helps with that use
      case by automating the process to rebase onto the currently synced
      manifest version.
      
      Change-Id: I847c9eb6addf7f84fd3f5594fbf8c0bcc103f9a5
      0b4cb325
  15. 15 Dec, 2015 1 commit
    • Dan Willemsen's avatar
      Fix prune when bare git has detached head · 1a799d14
      Dan Willemsen authored
      We don't really use HEAD much in the bare git repositories, but there
      have been reports of errors in git-symbolic-ref:
      
        symbolic-ref: fatal: Refusing to point HEAD outside of refs/
      
      That happen when the bare git repo is in the detached head state. It's
      possible that previous operations were killed while we were pruning
      branches.
      
      Use DetachHead instead of SetHead if we're restoring the repo into a
      detached head state.
      
      Change-Id: I9062e8957bc70367d3ded399685ac026fbb421fc
      1a799d14
  16. 11 Dec, 2015 1 commit
  17. 26 Nov, 2015 2 commits
    • Hu Xiuyun's avatar
      Sync: Fix error exit code when both -n and -f are used · e9becc07
      Hu Xiuyun authored
      When repo sync is used with -f (--force-error) and a project fails to
      sync, the sync will continue but then exit with an error status.
      
      However if -n (--network-only) is also used, the exit code is 0, even
      when a project failed.
      
      Modify the logic to make sure the sync exits with the correct status.
      
      Bug: Issue 214
      Change-Id: I0b5d97a34642c5aa3743750ef14a42c9d5743c1d
      e9becc07
    • Dan Willemsen's avatar
      Set GIT_ALLOW_PROTOCOL to limit dangerous protocols · 466b8c4e
      Dan Willemsen authored
      See git commit 33cfccbbf35a -- some protocols allow arbitrary command
      execution as part of the URL. Instead of blindly allowing those,
      whitelist the allowed URL protocols unless the user has already done so.
      
      Bug: Issue 210
      Change-Id: I6bd8e721aa5e3dab53ef28cfdc8fde33eb74ef76
      466b8c4e
  18. 19 Nov, 2015 1 commit
    • Dan Willemsen's avatar
      Check for broken links when updating linkfiles · e1e0bd1f
      Dan Willemsen authored
      If a linkfile is a broken link (destination does not exist), and it
      needs to be updated, we didn't notice that it needed to be removed
      first. Use lexists instead of exists to check for this condition.
      
      Change-Id: I1f6a1f0193d3fd2b9f7a647836044997f6ab32eb
      e1e0bd1f
  19. 27 Oct, 2015 1 commit
    • David Pursehouse's avatar
      Sync: Add option to prune refs during sync · 74cfd270
      David Pursehouse authored
      By passing --prune to the sync command, the --prune option is
      given to the `git fetch`, causing refs that no longer exist on
      the remote to be removed.
      
      Change-Id: I3cedacce14276d96ac2d5aabf2d07fd05e92bc02
      74cfd270
  20. 22 Oct, 2015 1 commit
    • Pascal Muetschard's avatar
      A couple of fixes to the init command's -p option. · c2a64ddf
      Pascal Muetschard authored
      Adds windows as one of the allowed platforms flags.
      Fixes -p foo to append 'platform-foo', instead of each letter (list.extend
      expects a list and thus appends each char in the string, rather than the
      string itself).
      
      Change-Id: I73a92127ac29a32fc31b335cc54a246302904140
      c2a64ddf
  21. 07 Oct, 2015 1 commit
    • Dan Willemsen's avatar
      Fix gitc-init behavior · 745b4ad6
      Dan Willemsen authored
      With gitc-init, a gitc client may be specified using '-c'. If we're
      not currently in that client, we need to change directories so that
      we don't affect the local checkout, and to ensure that repo is
      checked out in the new client.
      
      This also makes '-c' optional if already in a gitc client, to match
      the rest of the init options.
      
      Change-Id: Ib514ad9fd101698060ae89bb035499800897e9bd
      745b4ad6
  22. 02 Oct, 2015 2 commits
    • David Pursehouse's avatar
      Sync: Add HTTP Cookie File header on temporary cookie file · 4c5f74e4
      David Pursehouse authored
      The .gitcookies file generated by googlesource.com does not have
      the header:
      
       # (Netscape) HTTP Cookie File
      
      which causes python's MozillaCookieJar.load to fail with the
      error:
      
       "does not look like a Netscape format cookies file"
      
      Prepend the expected header onto the generated cookie file.
      
      We don't bother to check if the header already exists on the
      file; repeating it does not cause any problem.
      
      Bug: Issue 207
      Change-Id: I7d39720a1d36a6aae00f70691156514ebc04e579
      4c5f74e4
    • David Pursehouse's avatar
      Sync: Don't fail when git cookies can't be loaded · b1ad2190
      David Pursehouse authored
      If the git cookies file fails to load, use a default
      cookie jar instead.
      
      Bug: Issue 207
      Change-Id: I7cb326c204f2784ab4dbd13801b3186667af5b78
      b1ad2190
  23. 01 Oct, 2015 1 commit
    • Simran Basi's avatar
      GITC: Add repo gitc-delete command. · f231db11
      Simran Basi authored
      repo gitc-delete deletes a GITC client and all the locally
      saved sources. Useful for removing unnecessary clients and
      recovering disk space.
      
      Change-Id: Idf23addcea52b8713d268c34a7b37da0c5e5cd26
      f231db11
  24. 29 Sep, 2015 1 commit
  25. 14 Sep, 2015 2 commits
  26. 11 Sep, 2015 1 commit
  27. 10 Sep, 2015 2 commits
    • Ruslan Bilovol's avatar
      docs: add copyfile and linkfile elements description · 54527e7e
      Ruslan Bilovol authored
      
      The "copyfile" element is available since 2009 and
      have been used in every Android manifest; the "linkfile"
      element is available since 2014.
      Now it's a good time to add both to the documentation
      
      Change-Id: Ia987edf5f69a006235fbd3f33b744e9794a6d964
      Signed-off-by: default avatarRuslan Bilovol <ruslan.bilovol@gmail.com>
      54527e7e
    • Dan Willemsen's avatar
      GITC: Always update the gitc manifest from the repo manifest · 5ea32d13
      Dan Willemsen authored
      This way any changes made to the main manifest are reflected in the gitc
      manifest. It's also necessary to use both manifests to sync since the
      information required to update the gitc manifest is actually in the repo
      manifest.
      
      This also fixes a few issues that came up when testing. notdefault
      groups weren't being saved to the gitc manifest in a method that matched
      'sync'. The merge branch wasn't always being set to the correct value
      either.
      
      Change-Id: I435235cb5622a048ffad0059affd32ecf71f1f5b
      5ea32d13
  28. 09 Sep, 2015 4 commits