Mercurial And NetBeans: Happy Marriage After One Year

draindecorumSoftware and s/w Development

Aug 15, 2012 (5 years and 1 day ago)

376 views

Mercurial And NetBeans:

Happy Marriage After
One Year
Maroš Šándor
Munich, October 2008
Sun Microsystems, Inc.
Agenda

Distributed source control

Mercurial

NetBeans meets Mercurial
>
Dating
>
Engagement
>
Wedding
>
The Family

Mercurial support in NetBeans IDE
Agenda

Distributed source control

Mercurial

NetBeans meets Mercurial
>
Dating
>
Engagement
>
Wedding
>
The Family

Mercurial support in NetBeans IDE
Distributed Source Control
Bob
Update
Commit
Merge
Alice
Update
Commit
Merge
John
Update
Commit
Merge
Push
Pull
Working copy
Repository
Working copy
Working copy
Repository
Repository
Push
Pull
Distributed Source Control
Y
7
8
Bob
Distributed Source Control
Y
7
8
Y
C
D
Bob
Alice
Distributed Source Control
Y
7
8
Y
C
D
8
7
Bob
Alice
Distributed Source Control
Y
7
8
Y
C
D
8
7
M1
Bob
Alice
Distributed Source Control
Y
7
8
Y
C
D
Y
α
β
8
7
Bob
Alice
John
Distributed Source Control
Y
7
8
Y
C
D
Y
α
β
8
7
8
7
C
D
Bob
Alice
John
Distributed Source Control
Y
7
8
Y
C
D
Y
α
β
8
7
8
7
M2
C
D
Bob
Alice
John
Distributed Source Control
Y
7
8
Y
C
D
Y
α
β
8
7
8
7
M2
C
D
M3
Bob
Alice
John
Distributed Source Control

How does it compare to SVN?
>
Everyone gets a copy of the
repository (the clone)
>
No true central repository
>
Most operations are local

Advantages
>
Crash-proof, Freedom, No network,
Changesets, Easy and local branching

Disadvantages
>
Merging, New concept, No revision #
Agenda

Distributed source control

Mercurial

NetBeans meets Mercurial
>
Dating
>
Engagement
>
Wedding
>
The Family

Mercurial support in NetBeans IDE
Mercurial (Hg)

One of many modern DSCM systems
>
Mercurial, Bazaar, GIT, Darcs ...

Adoption in Sun
>
OpenJDK, OpenSolaris, NetBeans

Features
>
Support on all major platforms
>
Simple, small & clean source code
>
Extensibility, Fast I/O (disk seeks)
>
Mature repository and WC format
>
Clean working copy
Agenda

Distributed source control

Mercurial

NetBeans meets Mercurial

>
Dating
>
Engagement
>
Wedding
>
The Family

Mercurial support in NetBeans IDE
NetBeans IDE

Open source IDE for Java, C/C++, Ruby,
PHP, JavaScript, Web and more

Features GUI Builder (Matisse), Java
SE/EE profiler

840 MB repository, 646 MB working copy

~ 100.000 source files

~ 200 active contributors

~ 100 changes per day

Sponsored by Sun Microsystems, Inc.
Agenda

Distributed source control

Mercurial

NetBeans meets Mercurial

>
Dating
>
Engagement
>
Wedding
>
The Family

Mercurial support in NetBeans IDE
NetBeans and Mercurial - Dating

Motivation? CVS!
>
CVS is old, obsolete system that
does not meet current requirements
>
No atomic commits
>
No renames
>
No changeset management
>
Poor performance of large scale
operations (tagging, updating)
>
Weird keyword substitution

NetBeans begins dating Mercurial
Agenda

Distributed source control

Mercurial

NetBeans meets Mercurial

>
Dating
>
Engagement
>
Wedding
>
The Family

Mercurial support in NetBeans IDE
NetBeans and Mercurial - Engagement

Most suitable tool:
hg convert

cvsps
reconstructs changesets from
CVS commits

Strip branches, leave out deleted files
and binaries

Import only existing text files in trunk
with their trunk history

No keyword substitution imported

Perfect time to do housekeeping!
Agenda

Distributed source control

Mercurial

NetBeans meets Mercurial

>
Dating
>
Engagement
>
Wedding
>
The Family

Mercurial support in NetBeans IDE
NetBeans and Mercurial - Wedding

Freeze the CVS repository

Run custom scripts to prepare the
repository being imported

Run
hg convert

Setup hooks to
>

Forbid pushing of \r\n
>

Forbid pushing binaries

Setup special server for binary files

Migrate users
Agenda

Distributed source control

Mercurial

NetBeans meets Mercurial

>
Dating
>
Engagement
>
Wedding
>
The Family

Mercurial support in NetBeans IDE
NetBeans and Mercurial – The Family
Working copy
Repository
main-golden
release65
release60
contrib
main
clone
clone
pull
pull
push
NetBeans repository server
Binary files server
Working copy
Binaries
01010
0011
01010
0011
01010
0011
01010
0011
01010
0011
01010
0011
01010
0011
01010
0011
http GET
http://hg.netbeans.org
NetBeans and Mercurial – The Family
main-golden
release65
release60
contrib
main
clone
clone
pull
pull
push
NetBeans repository server
Binary files server
Binaries
01010
0011
01010
0011
01010
0011
01010
0011
01010
0011
01010
0011
01010
0011
01010
0011
http GET
Working copy
Repository
Team repository
Working copy
Repository
Working copy
Bob
Working copy
Repository
Working copy
Alice
Working copy
Repository
Working copy
John
pull
push
http://hg.netbeans.org
NetBeans and Mercurial – The Family

Binary files are NOT kept in Hg
repositories
>
Size concerns: Hg repositories are
self-contained
>
440 MB in 436 external binaries
>
Lists of binaries are used instead
/netbeans/subversion/external/binaries-list

638FCE90C61929E735ABA7BA3C42A469 svnClientAdapter-1.4.0.jar

285EC6ABE06CCFFD660B7DA858D822C0 svnjavahl-1.5.0.jar
>
Build process fetches binaries from a
http server and caches them locally
NetBeans and Mercurial – The Family

Initial barrier for new hg users
>
Different idioms
>
Confusing merging

Push contention
>
Team repositories
>
Repository subdivision

Partial clones impossible
>
Repository subset
>
Partial history
Agenda

Distributed source control

Mercurial

NetBeans meets Mercurial
>
Dating
>
Engagement
>
Wedding
>
The Family

Mercurial support in NetBeans IDE
Mercurial support in NetBeans IDE

Common UI
-
Versioning view, Coloring,
Badges, Diff, Labels
Mercurial support in NetBeans IDE

Based on NetBeans Versioning support

Utilizes common UI components
>
Versioning view: live view of changed files
>
Live Editable Diff View
>
Inline Diff in the Editor
>
Annotations bar integrated in the Editor
>
Graphical conflicts resolving tool
>
History browser

Integrated with refactoring

Streamlines common development
Thank you!

Q & A
Maroš Šándor
Sun Microsystems, Inc.
nbusers@netbeans.org
http://www.netbeans.org
http://versioncontrol.netbeans.org