This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 155893 - Usernames can be different in "Mercurial Properties" and HTTP authentication
Summary: Usernames can be different in "Mercurial Properties" and HTTP authentication
Status: RESOLVED INVALID
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-20 22:40 UTC by rmsh
Modified: 2009-04-20 14:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rmsh 2008-12-20 22:40:28 UTC
Hi 

I'm a relative newbie to Mercurial. Following the wiki pages I've setup Mercurial on the server (Redhat) and made the 
repositories available via HTTP using Tomcat (hgweb cgi). I've also configured webapp security and coupled it with our 
corporate LDAP. Anyone can browse, pull the repositories, but pushing is allowed by authenticated users only. So far so 
good.

There is a "test" NetBeans Project (simple app) repository on the server. From NetBeans GUI, I clone the project to my 
laptop (Windows XP) locally. I make some changes to files. I go to Mercurial -> Properties in NetBeans and change the 
following

Push URL: http://ramesh:mypassword@myserver.com/hg/repos/test/
Username: someone@somewhere.com

Later, I can commit the changes locally and "Push" the changes to the server.

However, server records that changes were made by "someone@somewhere.com" but not by "ramesh". To me this sounds like a 
bug, either in NetBeans or Mercurial. Mercurial must record that the change was "Pushed" by user who authenticates, not 
one who is entered in the "Mercurial -> Properties -> Username" field.

Ignore if this is not a bug.
Comment 1 Ondrej Vrabec 2009-04-20 14:26:56 UTC
Hi,
well, this may not be what you would expect, but that's how Mercurial works. Mercurial links every change made to the
repository with a person (username) who makes a commit (not a push). This is similar to the way centralized repositories
work (like subversion).

So when you commit local changes to your LOCAL repository, those changes will be connected to someone@somewhere.com.
Push then transfers all changes from LOCAL to a REMOTE repository (and it does not changes the commit information - like
date, author, changeset IDs and so on). And 'ramesh' represents only a username to authenticate to the server (it has
nothing to do with mercurial system).

Imagine that there would be another user who clones your LOCAL repository. Then there will be three (REMOTE on the
server, LOCAL on your laptop and the third on college's station). Your college then commits his changes to HIS local
repository and pushes to YOUR LOCAL repository (on your laptop).
Now when you decide to transfer all changes to the REMOTE server (you will invoke push on 'http://ramesh:....'),
mercurial will correctly keep the information about the author (your college' changes were made by your college, not by
'ramesh') and will not be overwritten to 'ramesh'.

I recommend a book about mercurial and distributed VCSs (try e.g. http://hgbook.red-bean.com/)

BTW, is is usual to set username in a more descriptive form - like: Ondrej Vrabec <ovrabec@netbeans.org>

I hope this might convince you (at least a bit) that someone@somewhere.com is the correct username for changes.