|Why doesn't my patch work? [message #1753905]
||Sun, 12 February 2017 05:45
| Jim DeLaHunt
Registered: March 2014
Location: Vancouver, Canada
I am using EGit with LiClipse, an Eclipse derivative. I am trying to move changes from one Git repository using patches. Team > Apply patches... cannot recognise the relevant locations to patch. The patch was created by History > Create Patch..., and is in Eclipse format.
Both Git repositories are versions of the Python source code tree on github. I'm moving from a clone of python/cpython-mirror to a clone of python/cpython.
I created a patch from the History view of the source repo. I right-clicked on the commit with my changes. A pop-up menu appeared. I selected Create Patch.... I followed the two-step wizard. I specified the format "Eclipse workspace". All this was as described in the User Guide section on patches.
Here's an excerpt of the patch file:
### Eclipse Workspace Patch 1.0
diff --git Doc/Makefile Doc/Makefile
index 91f937f..6e1c183 100644
@@ -10,7 +10,7 @@
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
-ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_paper_size=$(PAPER) \
+ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees -D latex_elements.papersize=$(PAPER) \
$(SPHINXOPTS) . build/$(BUILDER) $(SOURCES)
.PHONY: help build html htmlhelp latex text changes linkcheck \
diff --git Doc/conf.py Doc/conf.py
index b1bb620..6640349 100644
... [omit the rest to save space]...
I switched to the destination repo. I didn't see any way to apply the patch from the EGit perspective. Is there?
I opened the "PyDev Package Explorer" view. I right-clicked on a node in the project. A pop-up menu appeared. I selected the Team > Create patch... menu item. An Apply Patch dialogue box appeared. Under Patch Contents, it listed each file I expected, and each set of lines I expected.
What I didn't expect:
Each item in the Patch Contents pane had a bright red circle with a white "X" on it. I take it that EGit is trying to tell me there was a problem. I'm not sure what was the problem.
In the Text Compare pane, the left "Patched Local File" part looked correct, but the right-hand part was labelled "Unmatched Patch Segment". I don't know how to interpret "Unmatched", but it sounds like something went wrong.
When I clicked the [Finish] button, the dialogue closed. The changes seemed not to have been applied.
Why isn't this patch being applied? What is the problem which EGit is trying to tell me about with the red and white "X" marks? How do I make this work?
My LiClipse IDE is based on Eclipse Platform 4.6.1.v20160907-1200, with Eclipse Git Team Provider 18.104.22.168609210915-r. I am on Mac OS X 10.10.5.
Thanks in advance for your help.
--Jim DeLaHunt, multilingual websites consultant, Vancouver Canada
Running Liclipse. Coding in Python, SQL, PHP, Prolog.
Powered by FUDForum
. Page generated in 0.02158 seconds