Commit Graph

276 Commits

Author SHA1 Message Date
Greg Ward
885d349b11 merge: document some internal return values. 2010-12-13 11:46:31 -05:00
Mads Kiilerich
9772d9af5a merge: fast-forward merge with descendant
issue2538 gives a case where a changeset is merged with its child (which is on
another branch), and to my surprise the result is a real merge with two
parents, not just a "fast forward" "merge" with only the child as parent.

That is essentially the same as issue619.

Is the existing behaviour as intended and correct?

Or is the following fix correct?

Some extra "created new head" pops up with this fix, but it seems to me like
they could be considered correct. The old branch head has been superseeded by
changes on the other branch, and when the changes on the other branch is merged
back to the branch it will introduce a new head not directly related to the
previous branch head.

(I guess the intention with existing behaviour could be to ensure that the
changesets on the branch are directly connected and that no new heads pops up
on merges.)
2010-12-07 03:29:21 +01:00
Dan Villiom Podlaski Christiansen
17cfc8fdc9 merge: make 'diverging renames' diagnostic a more helpful note.
See the Hg Book on why we actually want to detect this case:
http://hgbook.red-bean.com/read/mercurial-in-daily-use.html#id364290

Before:

$ hg up deadbeef
warning: detected divergent renames of X to:
...

After:

$ hg up deadbeef
note: possible conflict - X was renamed multiple times to:
...

No functionality change.
2010-10-10 09:50:25 -05:00
timeless
ad9a9b223b merge/progress: marking strings for localization 2010-08-02 07:15:47 +03:00
Brodie Rao
2187fcb2bb update: use higher level wording for "crosses branches" error
When using "hg update" to update to a revision on another branch, if
the user has uncommitted changes in the working directory, hg aborts
with the following message:

  abort: crosses branches (use 'hg merge' to merge or use 'hg update
  -C' to discard changes)

If the user isn't trying to update to tip and they follow the command
examples verbatim, they would end up updating to the wrong revision.

This patch removes the command examples in favor of just telling the
user to either merge or use --clean:

  abort: crosses branches (merge branches or use --clean to discard
  changes)

hg also aborts if the user tries to use "hg update" to get to tip
(without specifying a revision) and tip is on another branch:

  abort: crosses branches (use 'hg merge' or use 'hg update -c')

This message is changed in the same fashion:

  abort: crosses branches (merge branches or use --check to force
  update)
2010-10-09 17:02:28 -05:00
Matt Mackall
bc4d4ff1d1 merge: handle no file parent in backwards merge (issue2364) 2010-10-09 14:50:20 -05:00
Matt Mackall
51b3b09c8f backout most of 26e0b9a8ce0d 2010-09-24 12:46:54 -05:00
Brodie Rao
7362459729 cleanup: use x in (a, b) instead of x == a or x == b 2010-09-23 00:02:31 -05:00
Peter Arrenbrecht
c3d38bfaec merge: delay writing the mergestate during until commit is called
This speeds up merges of lots of files considerably.
2010-09-06 17:35:49 +02:00
Adrian Buehlmann
79059e20c1 combine tests 2010-09-14 12:20:51 +02:00
Martin Geisler
bfea979db3 util: remove lexists, Python 2.4 introduced os.path.lexists 2010-08-25 16:23:32 +02:00
Matt Mackall
5fd0f613e6 merge with stable 2010-08-21 10:48:49 -05:00
Matt Mackall
395274c87f merge: move reverse-merge logic out of filemerge (issue2342) 2010-08-21 10:41:29 -05:00
Alecs King
f476a3469b merge: fix typo in docstring 2010-08-11 20:16:22 +08:00
Matt Mackall
81392aed00 merge: drop reference to file contents after write
This reduces memory usage on large consecutive gets.
2010-08-05 16:17:17 -05:00
timeless
bf09d7af0f progress: use gerund (updating) for merge progress 2010-07-30 10:32:24 +03:00
Matt Mackall
c0eb9c1315 Merge with stable 2010-08-06 12:59:13 -05:00
Matt Mackall
c11fac2ec1 Merge with stable 2010-07-31 18:12:50 -05:00
Nicolas Dumazet
064d677bd7 filectx: use cmp(self, fctx) instead of cmp(self, text)
This allows more flexibility in implementation, and in particular,
lets the context decide if revision text has to be loaded or not.
2010-07-27 23:40:46 +09:00
Matt Mackall
49d11c6847 subrepo: correctly handle update -C with modified subrepos (issue2022)
(based on a patch by Saint Germain)
2010-06-30 23:56:35 -05:00
Matt Mackall
e02c6fa5ff update: synchronize permissions in the dirstate (issue1473)
fix by Benoit, updated by mpm to not affect all clean files
2010-06-30 17:34:20 -05:00
Peter Arrenbrecht
a5728c19b7 merge: pass constant cset ancestor to fctx.ancestor 2010-06-18 08:49:24 +02:00
Martin Geisler
d90427e78b resolve: do not crash on empty mergestate
I managed to get an empty .hg/merge/state file by interrupting a merge
by pressing Control-C. This lead to this error:

  TypeError: a2b_hex() argument 1 must be string or read-only buffer,
  not None

since localnode is assigned None before the iteration over lines in
the mergestate begins.
2010-06-27 23:12:05 +02:00
Matt Mackall
a6428604f4 merge: improve merge with ancestor message 2010-06-20 14:21:56 -05:00
Gilles Moris
446a842b86 merge: avoid to break the dirstate copy status on moved files
In the case a file is locally tracked as copied in dirstate, and that a merge
affects this file, this file should not be marked as modified in dirstate, as
this will break the current copy state.
Note: only affect working directory merge, not branch merge.
2010-05-04 09:57:16 +02:00
Matt Mackall
ad8006c15f context: only scan unknowns when needed 2010-05-05 20:21:57 -05:00
Benoit Boissinot
33390381d7 dirstate: more explicit name, rename normaldirty() to otherparent() 2010-04-20 11:17:01 +02:00
Sune Foldager
2369132b4b run commit and update hooks after command completion (issue1827)
Previously, the working dir state hadn't been written when these
hooks were invoked, so external commands couldn't see all changes.
2010-02-17 15:43:21 +01:00
Augie Fackler
dfd90db0f0 update: make calls to ui.progress() 2010-02-07 17:44:30 -06:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Matt Mackall
238098252f submerge: properly deal with overwrites
also pull .hgsubstate check out of inner loop
2009-11-08 10:29:52 -06:00
Matt Mackall
34dc7c3fa5 subrepo: notice dirty subrepo states when merging 2009-11-07 16:30:42 -06:00
Stuart W Marks
c06e10d43b update: allow branch crossing without -c or -C, with no uncommitted changes
Update will now allow crossing branches within the same named branch,
when given a specific revision, if the working dir is clean, without
requiring the -c or -C option. Abort if no revision is given and
this would cross branches.  Minor change to abort message if
uncommitted changes are found.

Modify test-update-branches and output to reflect the altered case. Modify
test-merge5.out to reflect the altered case. Modify
test-up-local-change.out with new message.
2009-11-05 10:53:59 +01:00
Stuart W Marks
34fa5664cf update: add comments and test cases for updating across branches
Add comment to merge.py:update() showing various cases of 'hg update': to a
descendant, crossing named branches, and crossing branches within a named
branch; with no option, -c or -C; with or without uncommitted changes; and
with or without a specific revision. Add tests for all of these cases.
2009-11-05 10:53:36 +01:00
Martin Geisler
9f1896c083 do not attempt to translate ui.debug output 2009-09-19 01:15:38 +02:00
Simon Heimberg
e0e4fc74e3 ui: extract choice from prompt
avoid translating single characters (as l for _local or sym_link)
2009-06-21 01:13:19 +02:00
Alejandro Santos
b1c42d384b compat: can't compare two values of unequal datatypes 2009-07-05 11:01:01 +02:00
Matt Mackall
430046de97 subrepo: add update/merge logic 2009-06-15 02:45:38 -05:00
Matt Mackall
826dfe5eff merge: refactor manifestmerge init to better report effective ancestor 2009-06-08 18:14:44 -05:00
Matt Mackall
664da24230 merge: simplify file revision comparison logic 2009-06-08 18:14:44 -05:00
Matt Mackall
8021cf3e72 merge: make locally-added file test more correct 2009-06-08 18:14:44 -05:00
Matt Mackall
7c7918e441 merge: drop unused diverge initialization 2009-06-08 18:14:44 -05:00
Matt Mackall
810956c62b merge: refactor some initialization, drop backwards var 2009-06-08 18:14:44 -05:00
Matt Mackall
a9d2386a66 merge: combine a copy and move case 2009-06-08 18:14:44 -05:00
Matt Mackall
74a311ea36 merge: drop a flag update case 2009-06-08 18:14:44 -05:00
Matt Mackall
40f6d9b1a4 merge: combine three identical 'remote is newer' cases 2009-06-08 18:14:44 -05:00
Matt Mackall
b9716ff4b9 merge: drop 'remote deleted' case 2009-06-08 18:14:44 -05:00
Matt Mackall
68db9b76df merge: simplify 'other deleted' case 2009-06-08 18:14:44 -05:00
Matt Mackall
003d63fe39 merge: simplify backwards revert test, ready to combine with other cases 2009-06-08 18:14:44 -05:00