+ All Categories
Home > Technology > Team Developpement with Mercurial - april 2011

Team Developpement with Mercurial - april 2011

Date post: 23-Jan-2015
Category:
Upload: logilab
View: 115 times
Download: 0 times
Share this document with a friend
Description:
Talk given by Pierre-Yves David (@marmoute) for Logilab during the mercurial developpement sprint in april 2011
22
The issue Solutions Basic operation Implementation Details Use case Team Developpement With Mercurial April 29, 2011 Team Developpement With Mercurial
Transcript
Page 1: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Team Developpement With Mercurial

April 29, 2011

Team Developpement With Mercurial

Page 2: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Past vs present

Past: immutable = liquidPresent: mutable = frozenHistory: Past + present

Team Developpement With Mercurial

Page 3: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Why clean history:

easy to read

Review process

hg annotate

easy to process

hg bisect

hg annote

Continuous Integration tools

Changeset

From valid state to valid state.

Atomic

As small as possible

Team Developpement With Mercurial

Page 4: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

clean history

Errare humanum est won’t make it right.

Iterative

Collaborative

Multiple task in Parallel

tool: Version control System (distributed)

Team Developpement With Mercurial

Page 5: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Partial Solutions exist

rebase and histedit

limited

hard to share

hard get older version

mq

overlay: (unknown by core and extension)

limited: (queue only)

fragile: (no transaction, reject, .hg/patches consistency)

break rules: (truncate revlog)

Team Developpement With Mercurial

Page 6: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

The full solution

DVCS trace changes to set of files,Must trace changes to changesets.

A is updated as A’

A

A and B are merged as CA

A+B

B

Need to snapshot the whole set of files, but there is no such thingas a consistent state for the set of heads of a tree.

Changeset are distinct from each otherChangeset define their own dependency

Every edition write a new tree. We need a perpendicularhistory for Changeset

Team Developpement With Mercurial

Page 7: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Insert

characters: abc -> aXbc

lines: abc abc

ghi -> def

ghi

CHunks: adding a chunk to a changeset

changeset: o C

o C |

| o B

o B |

| -> o D

o A |

| o A

- |

-Team Developpement With Mercurial

Page 8: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Delete

characters: abc -> ac

lines: abc abc

def -> ghi

ghi

CHunks: remove chunk from a changeset

changeset: o C

| o C

o B |

| -> o A

o A |

| -

-

Team Developpement With Mercurial

Page 9: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Modify

characters: abc -> adc

lines: abc abc

def -> jkl

ghi ghi

CHunks: modify a chunk in a changeset

changeset: o C

| o C

o B |

| -> o A

o A |

| -

-

Team Developpement With Mercurial

Page 10: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Copy

characters: abc -> abac

lines: abc abc

def -> def

abc

ghi ghi

CHunks: N/A

changeset: o cherry pick of C

|

o C o | C

| | |

| o B | o B

| | -> | |

o | A o | A

|/ |/

- - Team Developpement With Mercurial

Page 11: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Move

characters: abc -> bac

lines: abc def

def -> abc

ghi ghi

CHunks: N/A

changeset: o C o C

| |

o B o A

| -> |

o A o B

| |

- -

Team Developpement With Mercurial

Page 12: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Join

characters: N/A

lines: abc\n -> abcdef\n

def\n ghi\n

ghi\n

CHunks: N/A

changeset: o C

| o C

o B |

| -> o A+B

o A |

| -

-

Team Developpement With Mercurial

Page 13: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Split

characters: N/A

lines: abcdef\n -> abc\n

ghi\n def\n

ghi\n

CHunks: N/A

changeset: o C

o C |

| o B

o A+B -> |

| o A

- |

-

Team Developpement With Mercurial

Page 14: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Move Boundary

characters: N/A

lines: abc\n -> abcd\n

def\n ef\n

ghi\n ghi\n

CHunks: N/A

changeset: o C o B+C

| |

o A+B -> o A

| |

- -

Team Developpement With Mercurial

Page 15: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

sum up

Insert

Delete

Modify

Copy

Move

Join

Split

Move Boundary

Team Developpement With Mercurial

Page 16: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Proposed solution

create new changeset as usual,

New type of relation between changeset

updatedeletesplitmerge(copy)

We can detect

obsolete changeset

conflicting changeset

Out of sync changeset

Team Developpement With Mercurial

Page 17: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Core change

It’s Necessary to :

Alter existing command to hide obsolete changeset,

Add new command to recognise//solve out-of-sync andconflicting changeset,

It’s recommended to have:

Light weight changeset,

Garbage collection.

Team Developpement With Mercurial

Page 18: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Extensions change

Do not alter Frozen changeset

Add relevant link on edit

Define hooks to update they internal state

Team Developpement With Mercurial

Page 19: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Simple iterative work

A

C

B

A

C

B Bʼ

A

C

B Bʼ

Bʼʼ

Cʼʼ

D

A

C

B Bʼ

Bʼʼ

Cʼʼ

D

ΩB

E

Team Developpement With Mercurial

Page 20: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Feature that need a bug fix

B

F

F

B

B

F Fʼ F

B

F

B

Fʼʼ

Team Developpement With Mercurial

Page 21: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

Multiple people working on the same thing

A

A

AAʼʼ

AAʼʼ Aʼ

A

Aʼʼ Aʼ

Aʼʼ

Team Developpement With Mercurial

Page 22: Team Developpement with Mercurial - april 2011

The issueSolutions

Basic operationImplementation Details

Use case

People have works base on unwanted changeset

A

A

B

AA

BA Bʼ

Team Developpement With Mercurial


Recommended