How to change credentials for Hg repository in Eclipse? - eclipse

This is exactly the same case as this one, but with Hg instead of SVN. I have MercurialEclipse installed, and I have changed the password of my remote repo. Now when I synch it fails.
I have not found any conf file in "C:\Documents and Settings\%USER%\Application Data..." about Hg.
I have deleted the .keyring eclipse file and restarted but still fails.
Eclipse 3.6.1 with MercurialEclipse1.6, on windows Vista
In reply to pyfunc (thanks):
I found an entry like this in .hg\hgrc:
[paths]
default = https://user:oldpassword#bitbucket.org/myprojectpath
so I changed to the new password and restarted eclipse, but still I get 'authorization failed'...

I finally found out a way to achieve this. If I select "Synchronize With" I get a dialog and I am able to insert the good values, so now I could synch!
This does not explain why changing values in .hgrc didn't work, but at least is solved now, although it would be nice to find out about the details...

Typically that is stored in .hgrc file. That is the user configuration file stores in the HOME directory. You should be able to change the password there.
As per the man page of Mercurial, there are some suggestions about the location of config file on windows.
1. <install-dir>\Mercurial.ini
2. HKEY_LOCAL_MACHINE\SOFTWARE\Mercurial
3. C:\Mercurial\Mercurial.ini
4. %HOME%\Mercurial.ini or
5. %HOME%\.hgrc or
6. %USERPROFILE%\Mercurial.ini or
7. %USERPROFILE%\.hgrc
it could also lie in /.hg/hgrc

Finally found the config file after some digging... it's in ${workspace_location}/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.vectrace.MercurialEclipse
If you close Eclipse, open this file, and delete just the lines at the bottom starting with repo_, the settings you have saved for that repository (including credentials) should be cleared the next time you open Eclipse. You'll probably want to make a backup of the file just in case.
Since these credentials override whatever you have in your hgrc, deleting these should allow the repositories to authenticate with your global settings. You won't necessarily see the credentials in the username/password fields in Eclipse, but if you click Next/Finish anyway, it should work fine.

Related

Eclipse local file history

In eclipse, you can right click in a file and then select Team / Show local history. This shows your local saves and is pretty useful.
Now, I made some changes to a file. I am 100% certain I made them. But they have disappeared. Overwritten by someone else I guess. But when I check my local history I can't see my file changes.
My question is:
Does Eclipse always update the local file history for every save? How reliable is it?
Note: I appreciate people are thinking how can someone else overwrite your files. I am working in a force.com project. When you make changes to a file they are push to a central server. There is source control per se. It is like everyone working with a shared folder.
It depends. Each Eclipse plugin dealing with workspace artifacts can optionally set a flag for local history in its API calls to the workspace resource management when deleting or changing files. If the flag is set, changed files surely get copied into local history. But every plugin can set this flag different.
So even if you might have an editor plugin which always uses local history when saving the edited file, another plugin might delete/modify the file without using local history and therefore interfere.
Summary: Local history is not a reliable way to go back to previously saved versions of a file.
If anyone else runs into this issue, check to make sure you didn't accidentally edit a file in a build or target directory. For instance if you are working on a jsp page and make edits, swear you changed it but they are no longer there in the editor or the local history when you open the file, check to make sure you weren't editing the built version by accident.
This sometimes happens if you are quick to use ctrl-shift-R shortcut to open resources. To avoid this, you can set your build or target folder to derived by right clicking on the folder and checking the derived checkbox. This will prevent the resource from showing in the Open Resource view which could save you headaches later.
To get the code back, I opened the target version and used undo to get to the edited version.

Mercurial eclipse plugin push different server

I have installed mercurial and configured in .hgrc file like this:
default (server-1)
default push (server-2)
This works fine in command line as it is using .hgrc file.
I tried using the eclipse plugin for mercurial which is not reading from .hgrc file ( I have to give repo address and credentials to it), I have given the default server-1 address, So How can I configure server-2 for push operation ?
Or
how to make my eclipse to read from .hgrc file directly ?
Thanks in advance.
I believe the plugin is utilizing the .hgrc file (for instance I've never edited it by hand and have a defult definition in it).
Try opening the drop-down list of the URL text field in when pushing/pulling, it will contain server-1 (and probably server-2 too), and if you select it, the plugin will also fill the user credentials (if you saved them too).

Removing SVN username and password from Eclipse does not work in Windows 7

I'm using Eclipse (Helios) 32Bit in Windows 7, with Subclipse 1.6.x.
I want to reset my SVN username and password. On the internet, I found the following steps:
Close Eclipse or RAD/WSAD
Navigate to the following directory replacing {User} with your Windows logon id.
C:\Documents and Settings{User}\Application Data\Subversion
Delete all files under the Subversion directory
Open Eclipse or RAD/WSAD
Synchronize with your SVN repository
If prompted click Accept Permanently to trust the certificate
When prompted enter your Subverion user id and password
These steps aren't working. When I open Eclipse again and synchronize with the repository, it doesn't ask for a username or password.
Other information:
I tried deleting the files in the Subversion directory, but when synchronizing, Eclipse creates a folder there again.
In another post I read about "deleting the .keyring file", but I couldn't find the location of this file.
In the Secure Storage contents tab, I only have this:
There are different possibilities where passwords could be stored in eclipse and subversion. The keyring file is stored in an installation of eclipse I have used with subclipse at <root>/eclipse/configuration/org.eclipse.core.runtime/.keyring. You should at least look if it exists there. The location of that file may be overriden by command line parameters, but that you would know. See the article "How to change Eclipse SVN plugin password" for some more information.
For another option, you could check:
Go into the Preferences by Windows > Preferences.
Select there General > Security > Secure Storage.
Go to the tab Contents and expand there the entry SVN.
You should see now a local cache of SVN related things that SVN can use to answer the password question for the server. Delete the entries that is cached for the location you want to login as a different user. Ensure that your subversion directory is cleaned as well:
Windows XP: C:\Documents and Settings\{User}\Application Data\Subversion
Windows 7: C:\Users\{User}\AppData\Roaming\Subversion\
And delete the .keyring file as well, if you find it.
I've found the fil containig my SVN credentials at ...\Eclipse\config\auth\svn.simple\
https://casecomplete.zendesk.com/hc/en-us/articles/200685197-Resetting-stored-Subversion-credentials
This worked for me. deleting all the files, in the svn.simple directory (for windows 7) deletes all the stored passwords. One will have to set them, while commiting content again, but that is obviously through the usual means.

Deleting files on remote server

I have a PHP project in NetBeans with remote files (over sftp). When I create, modify anything these changes happening both locally and on my web server. However when I'm trying to delete a file or a folder it gets erased only locally. What could be the problem?
Permissions seems to be ok, all files belong to the user I'm using to access the server.
I'm using Netbeans 6.9.1, default configuration, all updates installed.
Netbeans does not have a synchronization function. It is limited to downloading and uploading files. What you can do is to use some external tool, for example WinSCP is capable of synchronizing local and remote directories.
I read what you wrote... but I think it could be a permissions problem.
I also use NetBeans and when I delete a file from the project window it first erase it locally and then syncs with my server.
I login through sftp (using vsftp) as root, which is a bad thing, but you could try this too to be sure if it's a permission issue.
You mistakenly turned off the settings. Please follow these steps:
Right click on the project name
Select properties
From the list of the left select 'Run configuration'
On the left almost down, look for the setting 'Upload files:'
Make sure you set that to 'On Save'
All the best man

How do I configure Eclipse's Subversion config file to use my private-key?

I'm using Eclipse and the Subversive for SVN control, in Windows. I've also installed TortoiseSVN. The SVN repository I'm using is utilizing a svn+ssh scheme, and there is no way to change that.
Now, there's a file in %APPDATA%\Subversion\config that I need to edit to perform SVN interaction in Eclipse without typing in the password every time. The line in this config file reads now (default):
ssh = $SVN_SSH ssh -o ControlMaster=no
I've read a bit on the web that the $SVN_SSH is an environmental variable in Windows, and in this case it points to TortoiseSVN\bin\TortoisePlink.exe, which is correct.
What is the additional parameteres to append this config to make it take my private key? I've updated the "authorized_keys" file on the server (in my .ssh folder) with my public keyphrase, and I've tested and confirmed that logging in to the SVN server outside Eclipse works like it should with my private/public key pair.
The problem here is to make it all work inside Eclipse, and it's quite frankly a small nightmare :/ If anyone has experienced the same, or knows any remedy, I'd appreciate any help.
If you set the 'SVN_SSH' environment variable the rest of the line is ignored, so you should either replace '$SVN_SSH ssh' with the path to the program, or move the required arguments to the end of the SVN_SSH environment variable.