Giuseppe Lavagetto has submitted this change and it was merged.

Change subject: Checkout and then rebase instead of cherry-pick
......................................................................


Checkout and then rebase instead of cherry-pick

Cherry-picking won't work for cases like 
https://gerrit.wikimedia.org/r/#/c/244237/
where it depends on the parent commit to even apply the patch.

Change-Id: I475b8cffe425c2eb1d2e68c102fd8e3bdcdc041d
---
M puppet_compiler/prepare.py
M puppet_compiler/tests/test_prepare.py
2 files changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Giuseppe Lavagetto: Verified; Looks good to me, approved
  BBlack: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/puppet_compiler/prepare.py b/puppet_compiler/prepare.py
index 66a1e77..0b5ece2 100644
--- a/puppet_compiler/prepare.py
+++ b/puppet_compiler/prepare.py
@@ -137,7 +137,8 @@
             self.change_id, revision)
         git.fetch('-q', 'https://gerrit.wikimedia.org/r/operations/puppet',
                   ref)
-        git.cherry_pick('FETCH_HEAD')
+        git.checkout('FETCH_HEAD')
+        git.pull('--rebase', 'origin', 'production')
 
     def _sh(command):
         try:
diff --git a/puppet_compiler/tests/test_prepare.py 
b/puppet_compiler/tests/test_prepare.py
index af8a13c..7f16c09 100644
--- a/puppet_compiler/tests/test_prepare.py
+++ b/puppet_compiler/tests/test_prepare.py
@@ -63,7 +63,8 @@
         self.m._fetch_change()
         calls = [
             mock.call(['git', 'fetch', '-q', 
'https://gerrit.wikimedia.org/r/operations/puppet', 
'refs/changes/50/227450/1']),
-            mock.call(['git', 'cherry-pick', 'FETCH_HEAD'])
+            mock.call(['git', 'checkout', 'FETCH_HEAD']),
+            mock.call(['git', 'pull', '--rebase', 'origin', 'production'])
         ]
         mocker.assert_has_calls(calls)
 

-- 
To view, visit https://gerrit.wikimedia.org/r/248634
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I475b8cffe425c2eb1d2e68c102fd8e3bdcdc041d
Gerrit-PatchSet: 4
Gerrit-Project: operations/software/puppet-compiler
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@wikimedia.org>
Gerrit-Reviewer: Yuvipanda <yuvipa...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to