From 8129432fb1262396a602d67c2692c4ff755c158c Mon Sep 17 00:00:00 2001 From: "nodir@chromium.org" Date: Sat, 12 Apr 2014 01:01:31 +0000 Subject: [PATCH] Put patches to refs/patches// When using Git, trychange.py used to put patches to refs/patches/ refs, where 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 --- trychange.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/trychange.py b/trychange.py index 8a6e35eac3..8fe2b5fb17 100755 --- a/trychange.py +++ b/trychange.py @@ -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')