Put patches to refs/patches/<user>/<name>

When using Git, trychange.py used to put patches to refs/patches/<name>
refs, where <name> is a name of a patch. Now the using the username as a part
of the path.

This way we have better control over permissions per user basis

R=agable@chromium.org, iannucci@chromium.org
TEST=Sent a change to quickoffice try server. Master and slave do not
     need to be modified because the ref file in master branch points to
     the correct branch name

Review URL: https://codereview.chromium.org/231663005

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@263432 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
nodir@chromium.org 11 years ago
parent bf157b44ec
commit 8129432fb1

@ -640,12 +640,13 @@ def _SendChangeGit(bot_spec, options):
with _PrepareDescriptionAndPatchFiles(description, options) as (
patch_filename, description_filename):
logging.info('Committing patch')
target_branch = ('refs/patches/' +
os.path.basename(patch_filename).replace(' ','-'))
target_branch = 'refs/patches/%s/%s' % (
Escape(options.user),
os.path.basename(patch_filename).replace(' ','_'))
target_filename = os.path.join(patch_dir, 'patch.diff')
branch_file = os.path.join(patch_dir, GIT_BRANCH_FILE)
try:
# Crete a new branch and put the patch there
# Create a new branch and put the patch there.
patch_git('checkout', '--orphan', target_branch)
patch_git('reset')
patch_git('clean', '-f')

Loading…
Cancel
Save