monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Re: resolving name conflicts; file suturing vs drop


From: Marcin W. Dąbrowski
Subject: [Monotone-devel] Re: resolving name conflicts; file suturing vs drop
Date: Thu, 08 May 2008 21:56:07 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.14) Gecko/20080421 Thunderbird/2.0.0.14 Mnenhy/0.7.5.666

Hi.

I was lurking into this conversation, and while being only a user,
and not a coder, and I don't get the internals, etc - I was
thinking about how monotone could interact with the user when ncc
will occur, and how it could be resolved.

I attached a hypothethical output from a session with mtn, with
some options and comments dropped in it (I hope it's readable enough).

Just a mere 0.02€ - I hope it will be useful. An idea was kind-of
treating nccs as in Git, where almost all conflicts are about
content - but in the case of monotone we preserve history by
suturing. And, as you can see, I'd like to have the conflicts
resolved in workspace - there may be more changes needed to have
the project in sane state.

PS: Don't ask me about resurrections, graveyards, implementation,
    etc - I might not have the answers. Just foot for thought. :)

Best regards,
-- 
Marcin W. Dąbrowski
$ mtn version
monotone 0.40 (base revision: 5ccc279f9dea0444b47f03dd5291ecc985fcb7f6)

$ mtn -d d db init

$ mtn -d d setup . -b main

$ echo blah >blah

$ mtn add blah
mtn: adding blah to workspace manifest

$ mtn ci -m "add blank file, creating base revision"
mtn: beginning commit on branch 'main'
mtn: committed revision c7a2360dbefaecd6e5c3529ba05f4ded68483ad4

$ echo bar1 >bar

$ echo safe1 >safe1

$ mtn add foo bar safe1
mtn: adding bar to workspace manifest
mtn: adding foo to workspace manifest
mtn: adding safe1 to workspace manifest

$ mtn ci -m "add files on right side"
mtn: beginning commit on branch 'main'
mtn: committed revision 8d79b71def0a26652bd1da2c66ac58d301238081

$ mtn tag h: right
mtn: expanding selection 'h:'
mtn: expanded to '8d79b71def0a26652bd1da2c66ac58d301238081'

$ mtn up -r p:
mtn: expanding selection 'p:'
mtn: expanded to 'c7a2360dbefaecd6e5c3529ba05f4ded68483ad4'
mtn: selected update target c7a2360dbefaecd6e5c3529ba05f4ded68483ad4
mtn: [left]  fbfcae5b1be482198b127d10fd9b2b680719f6e3
mtn: [right] c7a2360dbefaecd6e5c3529ba05f4ded68483ad4
mtn: dropping safe1
mtn: dropping bar
mtn: updated to base revision c7a2360dbefaecd6e5c3529ba05f4ded68483ad4

$ echo bar2 >bar

$ echo safe2 >safe2

$ mtn add bar safe2
mtn: adding bar to workspace manifest
mtn: adding safe2 to workspace manifest

$ mtn ci -m "add files on left side"
mtn: beginning commit on branch 'main'
mtn: committed revision 01e80706407c1cfa6b1b5c7a88c7ceae493d1c32
mtn: note: this revision creates divergence
mtn: note: you may (or may not) wish to run 'mtn merge'

$ mtn merge
mtn: 2 heads on branch 'main'
mtn: [left]  01e80706407c1cfa6b1b5c7a88c7ceae493d1c32
mtn: [right] 8d79b71def0a26652bd1da2c66ac58d301238081
mtn: conflict: duplicate name 'bar' for the directory ''
mtn: added as a new file on the left
mtn: added as a new file on the right
mtn: error: merge failed due to unresolved conflicts

$ mtn merge_into_workspace t:right
mtn: expanding selection 't:right'
mtn: expanded to '8d79b71def0a26652bd1da2c66ac58d301238081'
mtn: [left]  01e80706407c1cfa6b1b5c7a88c7ceae493d1c32
mtn: [right] 8d79b71def0a26652bd1da2c66ac58d301238081
mtn: conflict: duplicate name 'bar' for the directory ''
mtn: added as a new file on the left
mtn: added as a new file on the right
mtn: error: merge failed due to unresolved conflicts
mtn: try merge_into_workspace --interactive

$ mtn merge_into_workspace t:left --interactive
mtn: expanding selection 't:left'
mtn: expanded to '8d79b71def0a26652bd1da2c66ac58d301238081'
mtn: [left]  01e80706407c1cfa6b1b5c7a88c7ceae493d1c32
mtn: [right] 8d79b71def0a26652bd1da2c66ac58d301238081
mtn: conflict: duplicate name 'bar' for the directory ''
mtn: added as a new file on the left
mtn: added as a new file on the right
mtn:       use: [c]urrent, [m]erged, [e]dit;
     or rename: [l]eft - merged, [r]ight - workspace, [b]oth
mtn% c
mtn: suturing as 'bar' with content from workspace

mtn% m
mtn: suturing as 'bar' with content from 
8d79b71def0a26652bd1da2c66ac58d301238081

mtn% e
mtn: diffing as content conflict, runnig $VISUAL to resolve
-- here, user edits the file, and after leaving editor...
mtn: suturing as 'bar' using edited content

mtn% l
mtn: misuse: use 'l new_file_name'

mtn% l bar-left
mtn: renaming 'bar' from 8d79b71def0a26652bd1da2c66ac58d301238081 as 'bar-left'
mtn: adding bar-left

mtn% r
mtn: misuse: use 'r new_file_name'
mtn% r bar-current
mtn: renaming 'bar' in workspace as 'bar-current'
mtn adding bar

mtn% b
mtn: misuse: use 'b left_file_name right_file_name'

mtn% b bar-left bar-right
mtn: renaming 'bar' from 8d79b71def0a26652bd1da2c66ac58d301238081 as 'bar-left'
mtn: adding bar-left
mtn: renaming 'bar' in workspace as 'bar-current'

mtn: modifying blah
mtn: adding safe1
mtn: updated to result of merge
mtn:  [left] 01e80706407c1cfa6b1b5c7a88c7ceae493d1c32
mtn: [right] 8d79b71def0a26652bd1da2c66ac58d301238081

$ mtn ci -m "merged"
mtn: beginning commit on branch 'main'
mtn: committed revision 9701b3e8c7f49b2bf8878c4bb29c994ea2d85314


reply via email to

[Prev in Thread] Current Thread [Next in Thread]