Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Team Developpement with Mercurial - april 2011
1. The issue
Solutions
Basic operation
Implementation Details
Use case
Team Developpement With Mercurial
April 29, 2011
Team Developpement With Mercurial
2. The issue
Solutions
Basic operation
Implementation Details
Use case
Past vs present
Past: immutable = liquid
Present: mutable = frozen
History: Past + present
Team Developpement With Mercurial
3. The issue
Solutions
Basic operation
Implementation 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
4. The issue
Solutions
Basic operation
Implementation 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
5. The issue
Solutions
Basic operation
Implementation 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
6. The issue
Solutions
Basic operation
Implementation 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ʼ
A and B are merged as C
A
B
A+B
Need to snapshot the whole set of files, but there is no such thing
as a consistent state for the set of heads of a tree.
Changeset are distinct from each other
Team Developpement With Mercurial
7. The issue
Solutions
Basic operation
Implementation 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
8. The issue
Solutions
Basic operation
Implementation 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
9. The issue
Solutions
Basic operation
Implementation 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
10. The issue
Solutions
Basic operation
Implementation 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
11. The issue
Solutions
Basic operation
Implementation 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
12. The issue
Solutions
Basic operation
Implementation Details
Use case
Join
characters: N/A
lines: abcn -> abcdefn
defn ghin
ghin
CHunks: N/A
changeset: o C
| o C
o B |
| -> o A+B
o A |
| -
-
Team Developpement With Mercurial
13. The issue
Solutions
Basic operation
Implementation Details
Use case
Split
characters: N/A
lines: abcdefn -> abcn
ghin defn
ghin
CHunks: N/A
changeset: o C
o C |
| o B
o A+B -> |
| o A
- |
-
Team Developpement With Mercurial
14. The issue
Solutions
Basic operation
Implementation Details
Use case
Move Boundary
characters: N/A
lines: abcn -> abcdn
defn efn
ghin ghin
CHunks: N/A
changeset: o C o B+C
| |
o A+B -> o A
| |
- -
Team Developpement With Mercurial
15. The issue
Solutions
Basic operation
Implementation Details
Use case
sum up
Insert
Delete
Modify
Copy
Move
Join
Split
Move Boundary
Team Developpement With Mercurial
16. The issue
Solutions
Basic operation
Implementation Details
Use case
Proposed solution
create new changeset as usual,
New type of relation between changeset
update
delete
split
merge
(copy)
We can detect
obsolete changeset
conflicting changeset
Out of sync changeset
Team Developpement With Mercurial
17. The issue
Solutions
Basic operation
Implementation 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 and
conflicting changeset,
It’s recommended to have:
Light weight changeset,
Garbage collection.
Team Developpement With Mercurial
18. The issue
Solutions
Basic operation
Implementation 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
19. The issue
Solutions
Basic operation
Implementation Details
Use case
Simple iterative work
D
C Cʼ Cʼʼ E
D
B Bʼ Aʼ
C C Cʼ C Cʼ Cʼʼ
A Bʼʼ
B B Bʼ B Bʼ Aʼ
A A A ΩB
Bʼʼ
Team Developpement With Mercurial
20. The issue
Solutions
Basic operation
Implementation Details
Use case
Feature that need a bug fix
F
B Bʼ
F
B
F Fʼ F Fʼ F Fʼ Fʼʼ
B B Bʼ B Bʼ
Team Developpement With Mercurial
21. The issue
Solutions
Basic operation
Implementation Details
Use case
Multiple people working on the same thing
Aʼ
A
Aʼʼ
A Aʼʼ Aʼ
A Aʼʼ Aʼ
A
Aʼʼ
A
Team Developpement With Mercurial
22. The issue
Solutions
Basic operation
Implementation Details
Use case
People have works base on unwanted changeset
B
A
A
B
A A Bʼ
A
Team Developpement With Mercurial