MercurialVersionControl

About

Mercurial: a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects.

The primary goal of the mercurial.netbeans.org project is to deliver first class Mercurial integration module for NetBeans IDE 6.0 and above. To learn more about its features, check out the Releases below.

The Mercurial NetBeans plugin module is currently under active development. It is designed to work with the new Version Control framework in NetBeans 6.0 and the 6.1 releases. We've been able to base much of our work on the new Subversion module, which has allowed us to make more rapid progress than we otherwise could have. Thanks Maros and Thomas!

News

JavaOne2008 BOF-5622

Using the Mercurial Plugin and NetBeans IDE on large Open Source Projects using OpenJDK as an example.

Dev Releases

Well due to popular demand here's the link to get at our nightly build of the Plugin. It's only for those who are happy living on the bleeding edge, but it's reasonably stable :)

NetBeans Nightly Build - as the Mercurial plugin is now built as part of NetBeans trunk, to get the plug-in just download, install and launch the NetBeans nightly build of which ever NetBeans Pack you are using.

Search History - restrict files displayed for each changeset to selected context. Selecting top level project gives old behavior.

Issues

A number of Mercurial 1.0 issues have been fixed, caused by changes in the various error messages, which the plugin needs to capture and handle. Without these fixes some errors come up as generic command warning failures, with the diagnostic information displayed in the Output window, as opposed to a more user friendly dialog.

Menus - reorganisation of menus to simplify their usage, see Main Menu UI.

Clone Other & Paths - a new step has been added to the Clone Other Wizard to allow you to set the Mercurial Paths for default-pull and default-push for the new clone.

Clarify and rework Update, Revert and Rollback and add Strip and Backout #127399.

Update - update to any revision and also do a forced update if you want

Revert - revert to any revision you want in the working dir and choose to create backups of locally modified files if you want.

Strip - strip a revision out of the repository, including all of its descendants. Optionally backup the changes in a bundle file that can be reapplied using hg unbundle to reverse the Strip.

Backout - backout a changeset selectively. It will create a new backout changeset and commit this to the repo with the specified commit message. If this creates multiple heads you will be given the option to Merge.

Rollback - as before rollback the last transaction, commit, push/pull or unbundle. It warns you first before running the command, stressing that it cannot be undone.

Searching with Show Incoming and Out. Can search on Message, Username and To revision (From defaults to the earliest available Incoming/ Outgoing changeset when To is specified).

Export Diff from Show commands. In Show History and Show Out, added Export Diff beside the Changeset bar Diff and Revert commands, makes it much easier to see exactly what you will be exporting when you choose a given revision.

The Mercurial Plugin rev 1.5.42 is available from the NetBeans 6.0 Stable Update Center as part of the NetBeans 6.0.1 Patch. When NetBeans 6.0 is running. Just click on the globe in the status bar or go to Tools -> Plugins -> Updates tab. Then click the "Reload Catalog" button and follow the installation instructions.Release Notes

Search History improvement - display Search History tab which supports searching on description, username, revision and date. It also supports diff of any of the revisions, revert to a revision and view of a revision #121593.

Show Incoming view - similar to the History tab Show Incoming displays a list of revisions that would be pulled into a repository on the next Pull from the remote repository #117653.

Show Out view - similar to the History tab Show Out displays a list of revisions for Outgoing changesets that would be pushed to the remote repository #117653.

Support Fetch extension - the fetch extension allows you to pull from a remote repository, update and if needed merge and commit with an automated merge message in one step. This is very useful when working on large collaborative projects #125704.

Proxy support - use the IDE proxy settings for Fetch and Pull/ Push to default.

Optimize UI for Large repos - a lot of work is going on to support working with large repositories. This is ongoing, but many optimizations are already in this release #126311.

Development

Help

Maros Sandor has written a Version Control API overview, which is a very useful starting point for anyone wanting to integrate their VCS into NetBeans 6.0.

Developers

John Rice (Sun Microsystems), developer

Padraig O'Briain (Sun Microsystems), developer

Maroš Šándor (Sun Microsystems), developer

Tomas Stupka (Sun Microsystems), developer

Open Issues

Ignore - currently when you put in a directory into the .hgignore file, you will get back all the ignored files in that directory, which causes a performance hit. We work around this by processing the .hgignore file instead of using mercurial, this is far from ideal 126124.

Status - There is a general issue with Hg status information and there are proposals to bypass the hg command and read the memory mapped dirstate directly 126156. Currently No Plan to Fix - user must run refresh within IDE if making external changes, could add Refresh to top level Versioning menu.

Revision info - if the user turns on revision labels in the project view there is a performance hit. We need to look at caching htis revision information in the file status cache 124895. Recommend remove {revision} label support in Options - DONE.

Interrupting long running tasks - problem with external hg commands is we get no progress on how much of the task has been done, so tasks are essentially atomic for us. Currently on cancel on Unix we catch the interrupted exception and call Process.destroy on the exec'ed process, which tears down the exec'ed python shell and the hg command. This will not work on Windows, as there is no parent child relationship maintained between the shell exec'ed to run the hg command and the hg command itself. On Windows we see hg.exe continuing to run after task canceled in IDE, suggestion is to look at Subversion code and change from Process Builder to Runtime perhaps, still need to support setup of exec environment for some commands 136080

Merge - when we do a Pull or a Push into a repository where the original files have diverged and a merge is needed we have to handle this. We are integrated into the current IDE Resolver, but this does not give a 3 way merge. There are changes in Mercurial 1.0 (Merge Tool Configuration) that might require changes in how merge is currently handled by the plugin. Fetch without external diff tool setup, with any merge conflicts will result in conflicts being committed - can catch this from Output error info and warn user and possibly offer to rollback and let them do a Pull/Merge themselves. Other options would be to get Fetch to call the internal resolver when it needs to do a diff during Fetch.

Followup outsanding mercurial bugs 102523 Access to files information should not need --debug flag. Need to get at copy info no template key for this. Also need change to IDE Interceptor to report Copy and notify hg using "hg copy -A".

A11Y - some issues same as svn 127837127839 Change Ok to Export or Import and make sure they have mnemonics. Cancel does not need a mnemonic - DONE.

Rename of Mercurial controlled Project with rename dir - .hg dir lost 135882 - known issue and is a problem with CVS and SVN. Its how rename is implemented.

Mercurial support doesn't scan project for changes, need to execute Status before commit, can have performance hit, will show progress so this is ok, commit the patch 135672

Mercurial Project - cloned project label not displaying, can we rely on VCSContext with multiple files = Project node ?? 135521 Workaround using query against VSContext and getElements to get Lookup .... (Maros for details).

Fire status change event for files updated after push - issue here is we are dependent on "hg update -V" output 134937. Problem also exists with local Pull and needs fixed - DONE.

Userid with domain & backslash not allowed - workaround for ini4j breaks https://DOMAIN\user:pw@foobar.com/, the \ is replaced with or the ini4j sees it as an escape sequence in the config file 131440 Best solution is to fix ini4j or workaround problem by looking for this pattern in config file before running clone, push or pull and overriding it with --config on the command with the DOMAINuserid replaced with DOMAIN\userid.

Standard/Power User Mode - hide a lot of the commands for a standard User, only show them when Power User mode selected. Admin commands such as Recover commands, Initialize and those to work with remote repositories perhaps.

Error Codes - currently we scrape the hg output, this is prone to break with new Mercurial releases. Should submit patch to Mercurial for all error states of commands plugin cares about so it can deal directly with returned error codes, not output. As interim solution have script to check for used error strings in HgCommand.java against Mercurial python code.

Mercurial Bugs & RFE's

Rollback - ability to call hg rollback in information mode to see if a rollback is available and if so what type of rollback. Would also like more information when a rollback is done to tell me what type of rollback has just happened (commit, push/pull etc).

Selective Push/Pull - would be great to be able to restrict what was being pushed/ pulled, by excluding certain files.

Incoming/Outgoing changes - tracked in issue 117653 Starting work with sources under Mercurial repository, users have to clone the the repository. Mercurial is based on decentralized approach - users wants to push/pull changes from the central repository, mercurial support doesn't provide any functionality that would show changes between local clone and the original one that is was cloned from. There is an externsion that now provides this functionality rdiff that we could look at integrating.

Want to Participate?

Mercurial users who want to try the Mercurial support in the IDE and give us feedback would be a great help. We have our basic feature set now, but want to look at making the common use cases as simple as possible going forward. Any thoughts or ideas on how to do so would be more than welcome.

To send feedback, get support, and receive updates and information about Mercurial support in NetBeans, subscribe to interest@mercurial.netbeans.org