eclipse mercurial conflict after pull: how to pick remote file - java

I have a repository at bitbucket and I was pulling a changeset from it to Eclipse using Mercurial plugin. Some of the files in Eclipse were modified, so it causes conflicts.
I just want to give up local file and update it with remotes. So I right click project and choose Team - Synchronize with
But what should I click to select remote file and give up a local?

Just right click on the file and select Revert.. as you want to discard your changes.
However in general, if you care about your changes uncommitted workspace update is not recommended. Instead commit your changes first and then rebase or merge after pulling.
Revert - this removes uncommitted changes. It makes the file contents the same as they are in the latest commit
Update - this moves the working directory towards the newest topological head on the current branch.
Rebase - this moves a committed changeset from where it was originally committed so that it becomes based on the target changeset. If in doubt use merge rather than rebase as rebase is an advanced operation.
The problem with uncommitted workspace update is that if there are conflicts there's no easy way to get back to the previous state. If there are conflicts with merge or rebase and you don't want to resolve them now you can press the Abort button in the Mercurial Merge view and it will go back to how it was before.

In Eclipse I can do
right click on file in Package Explorer
Replace with
Another Changeset
select the latest changeset from Remote repository

Related

How to “abort” merge in IntelliJ Idea version 21?

I use IntelliJ IDEA the latest version with Git.
I have created a new feature-branch and changed some things in the pom.
The same time other colleges worked on master, and they have pushed their changes into master.
I did merge my feature-branch to the master and pushed, and it succeeded. Now because of JDK 11 compatibility problem on Jenkins I should abort my merge which I have already pushed.
Anyone knows how should I revert it in IntelliJ IDE?
You can't just abort your commit, but you can revert all changes that were provided by your commit. For this, you need in Intellij idea open git log -> select commit that you want to abort -> select option in the drop-down menu `revert commit -> commit changes -> push changes. You will add a commit that reverts your changes

Arrow up and number on Eclipse meaning

I'm working on a project using Eclipse with Maven and Bitbucket. Right now I can't do any commit, I mean even if I press the commit button, I can't see it on Bitbucket. Furthermore, next to my project's name I got a symbol with an arrow up and the number 2 next to it.
What does it means? What should I do?
This means your local branch is two commits ahead of the remote one. Git is a distributed version control system. The git commit command only introduces the changes to your local repository. To make them appear in the remote, you have to use git push after committing your changes.
Alternatively, you can use Eclipse as a GUI to perform the same steps. In the context menu that pops up when you right-click the project, there should be a Team option. Clicking it brings up another context menu, which should have a Push option.

How to Import github project based on commit history

I have project in github. I have committed a irrelevant code in repo. So due to this my app is not working. So i need to import the project without the last two commits. How is this possible?
I am using eclipse IDE and java language code.
I'm assuming that you committed the last two commits locally. Then you want to do a hard reset to go 2 commits back. You can make a backup branch of the two commits in case you still want them later:
# Make backup branch
git branch backup
# Do a hard reset of the current branch
git reset --hard head~2
You need to grab the repo and reset back 2 commits. The best way to do this is to checkout the repo locally:
git clone https://github.com/user/proj.git
and enter the repo.
git reset --hard HEAD~2
and
git push origin master --fast-forward
The last line only if you want to remove the commits.
Thanks for your answers. I have found the answer in IDE iteslf.
Right click the project -> Team -> Show in History -> (A small window will open, it will have all the commits with the caption) -> Again right click on the commit that you need to import -> Click Checkout

Compare Local checkout version with SVN current version

It is possible to check the locally checkout revision number with repository current version.
i.e I checkout a file from repository and made changes locally, before i commit other user checkout the same file and made changes and committed the file. Before commit i need to check whether the local revision and repository version are same or not. so that intimate the user about the revision incompatibility.
SVN does not allow to same changes directly if you have old copy then SVN in your local.
On every commit it change the revision of the file update. And at the time of commiting those changes it will show the difference and will ask to marge or override the changes and difference made by someone else after you pulled.
Also you can use the option "SVN Show Log" and it will show all the updated files If you double click on any of the file it will show the comparision in your working file and the file on SVN.
You can right click on the folder/file and can see the Revision of the file and folder.
It sounds to me like you want to compare your local file with the latest version in the repository.
The "diff" command will compare your local file with the version you checked out:
http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.tour.cycle.examine.diff
You may also want to use the "status" command to see if anything has changed in the repository since your checkout:
http://svnbook.red-bean.com/en/1.7/svn-book.html#svn.tour.cycle.examine.status
If neither of these is exactly what you want, I'm sure you can find what you are looking for by browsing those pages a bit.

How to properly delete Java packages under SVN control?

I hava a Java project and am using Eclipse (Indigo) with the Subversive SVN plugin. I have successfully setup a remote SVN server that I'm using for the project repo.
I recently decided that I no longer needed a package that had a few unused classes in it. So I did the following:
I deleted the package and all of its contents from inside Package Explorer
I then right-clicked my project's root directory, and went to Team >> Synchronize with Repository
I found the newly-deleted package showing up in the list of changes under the Synchronize SVN panel, right-clicked the package, and select "Commit". My thinking here was, "I've deleted the package locally, now I want to commit those deletion-changes to the server."
The changes were not committed, I got an error message (which I failed to look at...) and now this is what I see back in Package Explorer (the net.appuzi.domain.loads.http package is the one I deleted):
Now, if I go back into Team >> Synchronize with Repository, I see the package like so:
If I select both Java sources and try to "Override and Commit" them, I get the following error:
Some of selected resources were not committed.
svn: Commit failed (details follow):
svn: '/<path-to-my-project>/MyProject/src/main/java/net/appuzi/domain/loads/http/HttpMethod.java' is not under version control
So my immediate question is: how to "synch" my local working copy and the repo so that this deleted package no longer exists in either one (on the server-side I'm committing to trunk/).
Besides that immediate problem, which is my current blocker, I guess the next logical question is: what are the proper procedures for deleting packages that are under version control in SVN.?" Thanks in advance!
Try making sure that your local files are the same as the remote files before trying to delete. That way the only change being detected is the deletion of the entire files, and Eclipse won't get confused about conflicts. Just update or revert as necessary and then try deleting again.
Try this:
delete the packages.
right click on your project inside the project explorer.
go to "Team" and click on "Update to HEAD.
again go to "Team" and click on "commit...".
Good Luck
I had similar issue earlier, all I did was committing parent folder. In you case "src". Get those files back and delete them again, and this time commit the parent folder.
Hope this helps.
Just delete the folder using Svn repository exploring, then update the project.
I had a similar issue where the package got deleted from the SVN repository but still showed up in the Synchronize View in Eclipse. I have the subversion plugin installed in my Eclipse. To resolve my issue, I disconnected the project from SVN (Right Click on Project --> Team --> Disconnect...) while opting to check the option "Also delete the SVN meta information from the file system."
Once disconnected, I reconnect the project to SVN, synchronized with the repository once more and the deleted package/files were no longer visible in the Synchronize view.

Categories