monotone

monotone Commit Details

Date:2010-11-19 22:23:27 (8 years 6 months ago)
Author:stephen_leake-2@stephe-leake.org
Branch:net.venge.monotone
Commit:0441b58e2b76c2aac899688f2feebc6ebd064268
Parents: af0b5d1b31f5f340c715c57364d3de5d7fec995f
Message:fix monotone issue 101

* NEWS: note fix

* cmd_conflicts.cc (set_duplicate_name_conflict, set_first_conflict):
fix arg indexing
(CMD resolve_first): improve help

* tests/resolve_conflicts_all_resolutions/__driver__.lua: match previous
change; add progress message

* tests/resolve_conflicts_duplicate_name/__driver__.lua:
* tests/resolve_conflicts_orphaned_file/__driver__.lua:
* tests/resolve_conflicts_content/__driver__.lua: test bad resolution
identifier
Changes:
MNEWS (1 diff)
Mcmd_conflicts.cc (5 diffs)
Mtests/resolve_conflicts_all_resolutions/__driver__.lua (1 diff)
Mtests/resolve_conflicts_content/__driver__.lua (1 diff)
Mtests/resolve_conflicts_duplicate_name/__driver__.lua (1 diff)
Mtests/resolve_conflicts_orphaned_file/__driver__.lua (1 diff)

File differences

NEWS
1212
1313
1414
15
16
17
1518
1619
1720
Bugs fixed
- improve help, fix arg indexing in 'conflicts resolve_first'
(fixes monotone issue 101)
- add compatibility with Botan 1.9.9 and newer
(fixes monotone issue 104)
cmd_conflicts.cc
197197
198198
199199
200
200
201201
202202
203203
......
280280
281281
282282
283
283
284284
285285
286286
......
349349
350350
351351
352
352
353353
354354
355355
......
415415
416416
417417
418
418
419419
420420
421421
......
473473
474474
475475
476
477
476
477
478478
479479
480480
} // show_conflicts
enum side_t {left, right, neither};
static char const * const conflict_resolution_not_supported_msg = N_("%s is not a supported conflict resolution for %s");
static char const * const conflict_resolution_not_supported_msg = N_("'%s' is not a supported conflict resolution for %s");
// Call Lua merge3 hook to merge left_fid, right_fid, store result in result_path
static bool
}
else
E(false, origin::user,
F(conflict_resolution_not_supported_msg) % idx(args,1) % "duplicate_name");
F(conflict_resolution_not_supported_msg) % idx(args,0) % "duplicate_name");
} //set_duplicate_name_conflict
else
{
E(false, origin::user,
F(conflict_resolution_not_supported_msg) % idx(args,1) % "orphaned_node");
F(conflict_resolution_not_supported_msg) % idx(args,0) % "orphaned_node");
}
return;
}
// We don't allow the user to specify 'resolved_internal'; that
// is only done by automate show_conflicts.
E(false, origin::user,
F(conflict_resolution_not_supported_msg) % idx(args,1) % "file_content");
F(conflict_resolution_not_supported_msg) % idx(args,0) % "file_content");
}
return;
}
CMD(resolve_first, "resolve_first", "", CMD_REF(conflicts),
N_("RESOLUTION"),
N_("Set the resolution for the first unresolved single-file conflict"),
"",
N_("Set the resolution for the first unresolved single-file conflict."),
"Use 'mtn conflicts show_first' to see possible resolutions.",
options::opts::conflicts_opts)
{
database db(app);
tests/resolve_conflicts_all_resolutions/__driver__.lua
121121
122122
123123
124
124
125
125126
126127
127128
mkdir("_MTN/resolutions")
check(mtn("--rcfile=merge3_hook.lua", "conflicts", "--conflicts-file=_MTN/conflicts-1", "resolve_first", "interactive", "_MTN/resolutions/interactive_file"), 0, true, true)
check(samelines("stderr", { "mtn: lua: running merge3 hook" }))
check(samelines("stderr", { "mtn: lua: running merge3 hook",
"mtn: interactive merge result saved in '_MTN/resolutions/interactive_file'"}))
check(mtn("conflicts", "--conflicts-file=_MTN/conflicts-1", "show_first"), 0, nil, true)
canonicalize("stderr")
tests/resolve_conflicts_content/__driver__.lua
3939
4040
4141
42
43
44
45
4246
4347
4448
check(indir("files", mtn("conflicts", "store", first, second)), 0, nil, nil)
check(samefilestd("conflicts-1", "_MTN/conflicts"))
-- invalid resolution identifier
check(mtn("conflicts", "resolve_first", "foo"), 1, nil, true)
check(samelines("stderr", { "mtn: misuse: 'foo' is not a supported conflict resolution for file_content"}))
-- bar is the first conflict (alphabetical by file name); it is
-- 'resolved_internal'. The rest are not resolved internal.
--
tests/resolve_conflicts_duplicate_name/__driver__.lua
5050
5151
5252
53
54
55
56
5357
5458
5559
-- Find out what the first unresolved conflict is
check(mtn("conflicts", "show_first"), 0, nil, true)
-- invalid resolution identifier
check(mtn("conflicts", "resolve_first_left", "foo"), 1, nil, true)
check(qgrep("'foo' is not a supported conflict resolution for duplicate_name", "stderr"))
-- Retrieve Abe's version of checkout.sh, and pretend we did a manual
-- merge, using our favorite merge tool. We put the files in the
-- bookkeeping area, so mtn doesn't see them.
tests/resolve_conflicts_orphaned_file/__driver__.lua
3737
3838
3939
40
41
42
43
4044
4145
4246
"mtn: resolve_first drop\n" ..
"mtn: resolve_first rename \"file_name\"\n" == readfile("stderr"))
-- invalid resolution identifier
check(mtn("conflicts", "resolve_first", "foo"), 1, nil, true)
check(qgrep("'foo' is not a supported conflict resolution for orphaned_node", "stderr"))
-- stuff/dir1 => dir1
check(mtn("conflicts", "resolve_first", "rename", "dir1"), 0, nil, nil)

Archive Download the corresponding diff file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status