Mercurial > hg-stable
changeset 2283:e506c14382fd
deprecate 'update -m'. use 'merge' instead.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Sun, 14 May 2006 21:07:34 -0700 |
parents | 2efa636eb411 |
children | d6392a7c03dd |
files | mercurial/commands.py tests/README tests/test-conflict tests/test-confused-revert tests/test-excessive-merge tests/test-filebranch tests/test-flags tests/test-hook tests/test-merge1 tests/test-merge4 tests/test-merge6 tests/test-merge7 tests/test-merge7.out tests/test-push-warn tests/test-ro-message tests/test-tags tests/test-up-local-change tests/test-up-local-change.out |
diffstat | 18 files changed, 45 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Sun May 14 17:37:34 2006 -0700 +++ b/mercurial/commands.py Sun May 14 21:07:34 2006 -0700 @@ -797,7 +797,7 @@ (nice(repo.changelog.tip()), nice(node))) if opts['merge'] and op1 != node: ui.status(_('merging with changeset %s\n') % nice(op1)) - update(ui, repo, hex(op1), **opts) + doupdate(ui, repo, hex(op1), **opts) def bundle(ui, repo, fname, dest="default-push", **opts): """create a changegroup file @@ -947,7 +947,7 @@ f.close() if not opts['noupdate']: - update(repo.ui, repo) + doupdate(repo.ui, repo) d.close() @@ -1956,7 +1956,7 @@ marked as changed for the next commit and a commit must be performed before any further updates are allowed. """ - return update(ui, repo, node=node, merge=True, **opts) + return doupdate(ui, repo, node=node, merge=True, **opts) def outgoing(ui, repo, dest="default-push", **opts): """show changesets not found in destination @@ -2035,7 +2035,7 @@ return if optupdate: if modheads == 1: - return update(ui, repo) + return doupdate(ui, repo) else: ui.status(_("not updating, since new heads added\n")) if modheads > 1: @@ -2740,15 +2740,19 @@ there is a linear relationship between the current version and the requested version, the result is the requested version. - Otherwise the result is a merge between the contents of the - current working directory and the requested version. Files that - changed between either parent are marked as changed for the next - commit and a commit must be performed before any further updates - are allowed. + To merge the working directory with another revision, use the + merge command. By default, update will refuse to run if doing so would require merging or discarding local changes. """ + if merge: + ui.warn(_('(the -m/--merge option is deprecated; ' + 'use the merge command instead)\n')) + return doupdate(ui, repo, node, merge, clean, force, branch, **opts) + +def doupdate(ui, repo, node=None, merge=False, clean=False, force=None, + branch=None, **opts): if branch: br = repo.branchlookup(branch=branch) found = [] @@ -3115,7 +3119,7 @@ "^update|up|checkout|co": (update, [('b', 'branch', '', _('checkout the head of a specific branch')), - ('m', 'merge', None, _('allow merging of branches')), + ('m', 'merge', None, _('allow merging of branches (DEPRECATED)')), ('C', 'clean', None, _('overwrite locally modified files')), ('f', 'force', None, _('force a merge with outstanding changes'))], _('hg update [-b TAG] [-m] [-C] [-f] [REV]')),
--- a/tests/README Sun May 14 17:37:34 2006 -0700 +++ b/tests/README Sun May 14 21:07:34 2006 -0700 @@ -16,10 +16,10 @@ There are some tricky points here that you should be aware of when writing tests: -- hg commit and hg up -m want user interaction +- hg commit and hg merge want user interaction for commit use -m "text" - for hg up -m, set HGMERGE to something noninteractive (like true or merge) + for hg merge, set HGMERGE to something noninteractive (like true or merge) - changeset hashes will change based on user and date which make things like hg history output change
--- a/tests/test-conflict Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-conflict Sun May 14 21:07:34 2006 -0700 @@ -10,7 +10,7 @@ echo "something else" > a hg commit -m branch2 -d "1000000 0" HGMERGE=merge; export HGMERGE -hg up -m 1 +hg merge 1 hg id egrep -v ">>>|<<<" a hg status
--- a/tests/test-confused-revert Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-confused-revert Sun May 14 21:07:34 2006 -0700 @@ -28,7 +28,7 @@ echo foo-b > a hg commit -m "2b" -d "1000000 0" -HGMERGE=true hg update -m 1 +HGMERGE=true hg merge 1 echo "%%% should show foo-b" cat a
--- a/tests/test-excessive-merge Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-excessive-merge Sun May 14 21:07:34 2006 -0700 @@ -17,12 +17,12 @@ echo blah > b hg ci -m "branch b" -d "1000000 0" -HGMERGE=true hg up -m 1 +HGMERGE=true hg merge 1 hg ci -m "merge b/a -> blah" -d "1000000 0" hg co 1 -HGMERGE=true hg up -m 2 +HGMERGE=true hg merge 2 hg ci -m "merge a/b -> blah" -d "1000000 0" hg log @@ -43,4 +43,4 @@ hg debugindex .hg/data/a.i -hg verify \ No newline at end of file +hg verify
--- a/tests/test-filebranch Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-filebranch Sun May 14 21:07:34 2006 -0700 @@ -41,7 +41,7 @@ echo merging hg pull ../a -env HGMERGE=../merge hg update -vm +env HGMERGE=../merge hg merge -v echo 2m > foo echo 2b > baz
--- a/tests/test-flags Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-flags Sun May 14 21:07:34 2006 -0700 @@ -27,7 +27,7 @@ hg heads hg history -hg -v co -m +hg -v merge ls -l ../test[12]/a > foo cut -b 1-10 < foo
--- a/tests/test-hook Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-hook Sun May 14 21:07:34 2006 -0700 @@ -29,7 +29,7 @@ echo b > b hg add b hg commit -m b -d '1 0' -hg update -m 1 +hg merge 1 hg commit -m merge -d '2 0' cd ../b
--- a/tests/test-merge1 Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-merge1 Sun May 14 21:07:34 2006 -0700 @@ -22,7 +22,7 @@ hg commit -m "commit #2" -d "1000000 0" echo This is file b1 > b echo %% no merges expected -env HGMERGE=../merge hg update -m 1 +env HGMERGE=../merge hg merge 1 cd ..; /bin/rm -rf t mkdir t @@ -41,9 +41,9 @@ hg commit -m "commit #2" -d "1000000 0" echo This is file b2 > b echo %% merge should fail -env HGMERGE=../merge hg update -m 1 +env HGMERGE=../merge hg merge 1 echo %% merge of b expected -env HGMERGE=../merge hg update -f -m 1 +env HGMERGE=../merge hg merge -f 1 cd ..; /bin/rm -rf t echo %% @@ -68,9 +68,9 @@ echo This is file b22 > b echo %% merge fails -env HGMERGE=../merge hg update -m 2 +env HGMERGE=../merge hg merge 2 echo %% merge expected! -env HGMERGE=../merge hg update -f -m 2 +env HGMERGE=../merge hg merge -f 2 cd ..; /bin/rm -rf t mkdir t @@ -90,7 +90,7 @@ hg commit -m "commit #3" -d "1000000 0" echo This is file b33 > b echo %% merge of b should fail -env HGMERGE=../merge hg update -m 2 +env HGMERGE=../merge hg merge 2 echo %% merge of b expected -env HGMERGE=../merge hg update -f -m 2 +env HGMERGE=../merge hg merge -f 2 cd ..; /bin/rm -rf t
--- a/tests/test-merge4 Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-merge4 Sun May 14 21:07:34 2006 -0700 @@ -11,7 +11,7 @@ echo This is file c1 > c hg add c hg commit -m "commit #2" -d "1000000 0" -hg update -m 1 +hg merge 1 rm b echo This is file c22 > c hg commit -m "commit #3" -d "1000000 0"
--- a/tests/test-merge6 Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-merge6 Sun May 14 21:07:34 2006 -0700 @@ -33,14 +33,14 @@ cd A1 hg pull ../B1 -hg update -m +hg merge hg commit -m "commit test" -d "1000000 0" echo bar should remain deleted. hg manifest cd ../B2 hg pull ../A2 -hg update -m +hg merge hg commit -m "commit test" -d "1000000 0" echo bar should remain deleted. hg manifest
--- a/tests/test-merge7 Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-merge7 Sun May 14 21:07:34 2006 -0700 @@ -35,7 +35,7 @@ # now pull and merge from test-a hg pull ../test-a -HGMERGE=merge hg update -m +HGMERGE=merge hg merge # resolve conflict cat >test.txt <<"EOF" one @@ -57,7 +57,7 @@ # pull and merge from test-a again cd ../test-b hg pull ../test-a -HGMERGE=merge hg update --debug -m +HGMERGE=merge hg merge --debug cat test.txt | sed "s% .*%%"
--- a/tests/test-merge7.out Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-merge7.out Sun May 14 21:07:34 2006 -0700 @@ -22,7 +22,7 @@ (run 'hg heads' to see heads, 'hg merge' to merge) merge: warning: conflicts during merge resolving manifests - force None allow 1 moddirstate True linear False + force False allow True moddirstate True linear False ancestor 055d847dd401 local 2eded9ab0a5c remote 84cf5750dd20 test.txt versions differ, resolve merging test.txt
--- a/tests/test-push-warn Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-push-warn Sun May 14 21:07:34 2006 -0700 @@ -23,7 +23,7 @@ hg push ../a hg pull ../a hg push ../a -hg up -m +hg merge hg commit -m "4" -d "1000000 0" hg push ../a cd .. @@ -44,7 +44,7 @@ hg ci -m d-$i -d "1000000 0" done -HGMERGE=true hg co -m 3 +HGMERGE=true hg merge 3 hg ci -m c-d -d "1000000 0" hg push ../c
--- a/tests/test-ro-message Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-ro-message Sun May 14 21:07:34 2006 -0700 @@ -14,4 +14,4 @@ "$HG" commit -m 'Clarifying the vehicle.' "$HG" update -C 1 chmod a-w b/vehicle -"$HG" update -m 2 2>&1 | sed 's|^\(.*[ ]\).*/\([^/]*/[^/]*/[^/]*\)$|\1\2|g' +"$HG" merge 2 2>&1 | sed 's|^\(.*[ ]\).*/\([^/]*/[^/]*/[^/]*\)$|\1\2|g'
--- a/tests/test-tags Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-tags Sun May 14 21:07:34 2006 -0700 @@ -27,7 +27,7 @@ hg add b hg commit -m "branch" -d "1000000 0" hg id -hg co -m 1 +hg merge 1 hg id hg status
--- a/tests/test-up-local-change Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-up-local-change Sun May 14 21:07:34 2006 -0700 @@ -29,7 +29,7 @@ hg parents hg --debug up 0 hg parents -hg --debug up -m || echo failed +hg --debug merge || echo failed hg parents hg --debug up hg parents @@ -50,8 +50,8 @@ hg status hg parents hg --debug up || echo failed -hg --debug up -m || echo failed -hg --debug up -f -m +hg --debug merge || echo failed +hg --debug merge -f hg parents hg diff | sed -e "s/\(+++ [a-zA-Z0-9_/.-]*\).*/\1/" \ -e "s/\(--- [a-zA-Z0-9_/.-]*\).*/\1/"
--- a/tests/test-up-local-change.out Sun May 14 17:37:34 2006 -0700 +++ b/tests/test-up-local-change.out Sun May 14 21:07:34 2006 -0700 @@ -112,7 +112,7 @@ abort: outstanding uncommitted changes failed resolving manifests - force None allow 1 moddirstate True linear False + force False allow True moddirstate True linear False ancestor a0c8bcbbb45c local 1165e8bd193e remote 4096f2872392 a versions differ, resolve b versions differ, resolve