@matheusbsbs / matheus-bagliano / commits / 8b72ca0f76
Fork 0

Removed the old patch apply code from git-p4 submit.

Signed-off-by: Simon Hausmann <simon@lst.de>

Simon Hausmann committed Apr 14, 2007 at 16:05 UTC 8b72ca0f76213eb375840e6b9069b260d97f8286
1 file changed +1 -18
contrib/fast-import/git-p4
+1 -18
@@ -170,7 +170,6 @@ class P4Submit(Command):
170 optparse.make_option("--log-substitutions", dest="substFile"),
171 optparse.make_option("--noninteractive", action="store_false"),
172 optparse.make_option("--dry-run", action="store_true"),
173 - optparse.make_option("--apply-as-patch", action="store_true", dest="applyAsPatch")
173 ]
174 self.description = "Submit changes from git to the perforce depot."
175 self.usage += " [name of git branch to submit into perforce depot]"
@@ -181,7 +180,6 @@ class P4Submit(Command):
180 self.substFile = ""
181 self.firstTime = True
182 self.origin = ""
184 - self.applyAsPatch = True
183
184 self.logSubstitutions = {}
185 self.logSubstitutions["<enter description here>"] = "%log%"
@@ -202,10 +200,6 @@ class P4Submit(Command):
200
201 self.config["commits"] = commits
202
205 - if not self.applyAsPatch:
206 - print "Creating temporary p4-sync branch from %s ..." % self.origin
207 - system("git checkout -f -b p4-sync %s" % self.origin)
208 -
203 def prepareLogMessage(self, template, message):
204 result = ""
205
@@ -250,11 +244,7 @@ class P4Submit(Command):
244 else:
245 die("unknown modifier %s for %s" % (modifier, path))
246
253 - if self.applyAsPatch:
254 - system("git diff-tree -p --diff-filter=ACMRTUXB \"%s^\" \"%s\" | patch -p1" % (id, id))
255 - else:
256 - system("git diff-files --name-only -z | git update-index --remove -z --stdin")
257 - system("git cherry-pick --no-commit \"%s\"" % id)
247 + system("git diff-tree -p --diff-filter=ACMRTUXB \"%s^\" \"%s\" | patch -p1" % (id, id))
248
249 for f in filesToAdd:
250 system("p4 add %s" % f)
@@ -397,13 +387,6 @@ class P4Submit(Command):
387 print "No changes found to apply between %s and current HEAD" % self.origin
388 else:
389 print "All changes applied!"
400 - if not self.applyAsPatch:
401 - print "Deleting temporary p4-sync branch and going back to %s" % self.master
402 - system("git checkout %s" % self.master)
403 - system("git branch -D p4-sync")
404 - print "Cleaning out your perforce checkout by doing p4 edit ... ; p4 revert ..."
405 - system("p4 edit ... >/dev/null")
406 - system("p4 revert ... >/dev/null")
390 response = raw_input("Do you want to sync from Perforce now using git-p4 rebase (y/n)? ")
391 if response == "y" or response == "yes":
392 os.chdir(oldWorkingDirectory)