Commit Graph

432 Commits

Author SHA1 Message Date
Oleg Stepanov
ee35622d91 Do not allow merging with uncommitted changes in a subrepo 2011-02-16 08:56:11 -08:00
Dan Villiom Podlaski Christiansen
ec590d5cd4 explicitly close files
Add missing calls to close() to many places where files are
opened. Relying on reference counting to catch them soon-ish is not
portable and fails in environments with a proper GC, such as PyPy.
2010-12-24 15:23:01 +01:00
Martin Geisler
17df79113a merge with stable 2011-01-31 13:38:00 +01:00
Erik Zielke
bf9e13d063 subrepo: make update -C clean the working directory for svn subrepos
This makes 'hg update --clean' behave the same way for both kinds of
subrepositories. Before Subversion subrepos did not take the clean
parameter into account, but just updated to the given revision and
merged uncommitted changes into that.
2011-01-31 13:33:41 +01:00
Adrian Buehlmann
721e368ac1 rename util.unlink to unlinkpath 2011-01-02 19:34:41 +01:00
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
Mads Kiilerich
bd975669e6 merge: remove last traces of fastforward merging
bed0e312bdf5 introduced fast-forward branch merging.
e2079edce509 partly removed it again.

The fastforward variable would always be false if branchmerge was false, so the
fastforward variable makes no difference and we can remove it completely.
2011-03-08 01:21:50 +01: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
Matt Mackall
e7ff3ff5bc merge: allow merging going backwards
New behavior is generally superior and more correct, except possibly
with regards to missing files. hg up . is now effectively a no-op,
which is probably the desired behavior for people expecting to move to
tip, but may surprise people who were expecting deleted files to
reappear.

case 1: update to .

a-w -> a-w

classic: ancestor a
 missing     recreated     right?
 rmed        recreated     WRONG
 added       forgotten     WRONG
 changed     preserved     RIGHT
 conflicted  can't happen

backward merge: ancestor a  (NO EFFECT)
 missing     missing      wrong?
 rm'ed       rm'ed        RIGHT
 added       preserved	  RIGHT
 changed     preserved    RIGHT
 conflicted  can't happen

case 2: update to ancestor of .

a-b-w -> b-w
          \
           a

classic:  ancestor a
 missing       recreated        right?
 rmed          recreated        wrong?
 added         forgotten        wrong?
 changed       preserved        RIGHT
 conflicted    preserved        wrong?

backwards merge: ancestor b
 missing       missing or conflict  right?
 rm'ed         missing or conflict  right?
 changed       preserved            RIGHT
 conflicted    merge                RIGHT
 added         preserved            right?
2009-06-08 18:14:44 -05:00
Matt Mackall
c24a0d4e76 merge: reorder remote creation tests 2009-06-08 18:14:44 -05:00
Matt Mackall
58ccf87682 merge: drop recreating case 2009-06-08 18:14:44 -05:00
Matt Mackall
65d08ecb3f merge: drop an overwrite test 2009-06-08 18:14:44 -05:00
Matt Mackall
fee35db526 merge: simplify a delete case 2009-06-08 18:14:44 -05:00
Matt Mackall
3d83e5d92a merge: reorder get cases for future simplification 2009-06-08 18:14:44 -05:00
Matt Mackall
7d4488886a merge: fix prompt keep 2009-06-08 18:14:44 -05:00
Matt Mackall
2c65849ffa merge: remove a flags case 2009-06-08 18:14:44 -05:00
Matt Mackall
da4ac4f699 merge: pretend ancestor is local to simplify backwards and overwrite 2009-06-08 18:14:44 -05:00
Matt Mackall
60cf366277 merge: simplify flag merging code slightly 2009-06-08 18:14:44 -05:00
Steve Borho
2cd8aa240a merge: give hint as to how to discover uncommitted changes
Many users will try 'hg diff' here, and it will not show them missing files.
2009-05-22 11:42:21 -05:00
Benoit Boissinot
fc43ae9519 update --clean: do not unlink added files (issue575) 2009-05-19 03:59:58 +02:00
Dirkjan Ochtman
43d9564cff some modernization cleanups, forward compatibility 2009-05-13 14:08:39 +02:00
Simon Heimberg
09ac1e6c92 separate import lines from mercurial and general python modules 2009-04-28 17:40:46 +02:00
Steve Borho
52bf113f2e ui: replace regexp pattern with sequence of choices
Use ampersands (&) to delineate the response char in each choice.
ui.prompt() responses are now explicitly case insensitive.  GUIs
that subclass ui can generate dialogs from the full choice names.
2009-04-30 10:15:32 -05:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Martin Geisler
e2222d3c43 replace set-like dictionaries with real sets
Many of the dictionaries created by dict.fromkeys were emulating sets.
These can now be replaced with real sets.
2009-04-22 00:57:28 +02:00
Ronny Pfannschmidt
5356baa346 switch lock releasing in the core from gc to explicit 2009-04-22 02:01:22 +02:00
Matt Mackall
805511403b resolve: move reset to localrepo.commit
This way rebase doesn't leave a stale resolve state
2009-03-16 16:58:41 -05:00
Matt Mackall
d7c2a2e49b merge: mark kept local files as readded on linear update (issue539) 2009-02-15 10:50:48 -06:00
Patrick Mezard
6aa7cd6f84 Merge with crew-stable 2009-01-13 23:17:19 +01:00
Patrick Mezard
a70c4ebc9d merge: fix execute bit update issue introduced by db8aabe14ff1 2009-01-13 22:41:06 +01:00
Benoit Boissinot
9eaa24618d correctly update dirstate after update+mode change (issue1456) 2009-01-07 02:11:17 +01:00
Dirkjan Ochtman
574603a8c0 use dict.iteritems() rather than dict.items()
This should be faster and more future-proof. Calls where the result is to be
sorted using util.sort() have been left unchanged. Calls to .items() on
configparser objects have been left as-is, too.
2009-01-12 09:16:03 +01:00
Matt Mackall
48ebb7a1ba merge: fix bug going backwards for already reverted files (issue1303) 2008-10-08 16:22:08 -05:00
Martin Geisler
28fb695e9a i18n: mark strings for translation in Mercurial 2008-08-31 16:12:02 +02:00
Dirkjan Ochtman
6b51480caa merge with crew-stable 2008-08-12 17:47:08 +02:00
Matt Mackall
e03f4e2f73 util: set_flags shouldn't know about repo flag formats 2008-08-10 21:55:06 -05:00
Paul Moore
ab028fc78a Sort removes first when applying updates (fixes issues 750 and 912)
This change ensures that removes happen first in applyupdates(). This avoids
issues where we try to make a case-only rename of a file on a case insensitive
system. Without this patch, the add of the new name happens before the remove
of the old one - which results in the file not existing, as the two names are
effectively the same.

With the patch, the old name gets removed then the new one gets added, which
is always safe.
2008-07-01 17:59:31 +01:00
Matt Mackall
a65ef7bc5d util: add sort helper 2008-06-27 18:28:45 -05:00
Matt Mackall
fbb5127472 use repo[changeid] to get a changectx 2008-06-26 14:35:46 -05:00
Matt Mackall
b2155285a8 rename checkfolding to checkcase 2008-06-26 13:58:24 -05:00
Matt Mackall
5867ff1667 use repo.changectx(None) to get a workingctx 2008-06-26 13:46:29 -05:00
Patrick Mezard
d06361ae38 merge: replace readline() call, missing from posixfile_nt 2008-04-12 20:51:26 +02:00
Matt Mackall
edf5a0f5d0 resolve: new command
- add basic resolve command functionality
- point failed update and merge at resolve
2008-04-11 12:52:56 -05:00
Dirkjan Ochtman
77eea08b47 python-2.6: use sha wrapper from util for new merge code 2008-04-11 12:04:26 +02:00
Matt Mackall
8d82cba09a merge: introduce mergestate 2008-04-10 15:02:24 -05:00
Matt Mackall
c9895536f8 copies: skip directory rename checks when not merging
The directory rename checks are not meaningful unless we're moving or copying
files across a branch during a merge.
2008-03-29 12:39:47 -05:00
Thomas Arendsen Hein
5690af9ff7 Fix missing space in one of the new update messages. 2008-03-24 20:28:13 +01:00
Matt Mackall
fb8b59de16 update: better logic and messages for updates
- complain about attempts to merge with ancestor
- when updating, differentiate between
  - crossing named branches with no local changes (jump)
  - crossing named branches with local changes (complain)
  - nonlinear update on the same named branch, no changes (complain some more)
  - nonlinear update on the same named branch, changes (different complaining)
2008-03-24 10:01:05 -05:00
Matt Mackall
9454e6e5aa update: no -C needed to switch branches without outstanding changes 2008-03-22 13:30:08 -05:00
Matt Mackall
5c5200eb63 diff: use copy smarts from copies.py 2008-03-15 10:02:31 -05:00
Matt Mackall
79c8f65d30 copies: move findcopies code to its own module
- pass in contexts
- fold symmetricdifference check into copies.copies
2008-03-15 10:02:31 -05:00
Matt Mackall
ce54a3ea46 merge: move symmetricdifferences to ancestor.py 2008-03-15 10:02:31 -05:00
Matt Mackall
f1d323b3b4 merge: simplify some helpers 2008-03-15 10:02:31 -05:00
Matt Mackall
67e4145eba merge: more simplifications to checkcopies 2008-03-15 10:02:31 -05:00
Matt Mackall
8cbc2c104e merge: simplify checkcopies 2008-03-15 10:02:31 -05:00
Matt Mackall
3a2aa805f9 merge: privatize some functions, unnest some others 2008-03-15 10:02:31 -05:00
Alexis S. L. Carvalho
af51350c6e merge: notice uncommited copies (issue1000)
As mentioned in msg5349 in issue988, "hg update" doesn't take into account
uncommitted copies.  To reproduce:

----------------
hg init repo
cd repo

touch foo
hg ci -Am 'add foo'

echo >> foo
hg ci -m 'change foo'

hg up -C 0
hg mv foo bar
HGMERGE=false thg --debug -y update
--------------------------

A similar problem happens with hg merge --force.

I'm attaching a possible patch.
2008-03-14 11:01:31 -05:00
Alexis S. L. Carvalho
fa062ecb4c merge: require --force when there are deleted files 2008-03-14 09:56:58 -03:00
Alexis S. L. Carvalho
d98fc139f2 merge: fix handling of deleted files 2008-03-12 15:44:08 -07:00
Joel Rosdahl
5dae3059a0 Expand import * to allow Pyflakes to find problems 2008-03-06 22:23:26 +01:00
Matt Mackall
22c4273b99 filemerge: pull file-merging code into its own module 2008-02-03 19:29:05 -06:00
Matt Mackall
262c766059 merge: add a bit more sanity to divergent copy checks 2008-01-14 16:28:32 -06:00
Matt Mackall
c7663b5b00 merge: add flag merging intelligence
- properly handle all 27 combinations of flags
- prompt on conflicts
2007-12-27 22:47:44 -06:00
Matt Mackall
d9e4ee2c04 merge: use util.set_flags 2007-12-27 22:27:48 -06:00
Matt Mackall
7edaa19dd3 merge: simplify merge tests, fix exec flag bug
If local changed exec bit and remote changed file contents, exec bit
change would be lost.
2007-12-27 22:27:37 -06:00
Thomas Arendsen Hein
3cd6fe199f merge with crew-stable 2007-12-26 23:03:32 +01:00
Thomas Arendsen Hein
94bdbd585c Fix misleading error and prompts during update/merge (issue556) 2007-12-26 22:47:16 +01:00
Alexis S. L. Carvalho
d5cac48462 Honour the exec bit when we go back in time.
Fixes issue801.
2007-11-05 18:49:35 -02:00
Matt Mackall
5706b9f949 update: default to tipmost branch if default branch doesn't exist 2007-12-02 15:15:49 -06:00
Matt Mackall
639bd228f5 findcopies: fix rename bug
We've fiddled with this line several times, and an old bug has
reappeared from it. Let's take a peek at the history.

The original "or" (rev 3674, in 0.9.2 and 0.9.3):
  http://www.selenic.com/hg/rev/9099b35951af

Then I changed it to an "and" to fix a bug (rev 4304):
  http://www.selenic.com/hg/rev/c0a9681f37d2

Then for reasons now lost in the mists of time, I dropped half (rev 4399):
  http://www.selenic.com/hg/rev/28b43ceec6c1

Then we added back the "or" (rev 4416, in 0.9.4):
  http://www.selenic.com/hg/rev/1b74e1831bb9

So it seems it ought to be "and".
2007-10-08 18:47:22 -05:00
Patrick Mezard
2d1e4a3c40 merge: provide *_ISLINK environment vars to merge helper
Sets HG_MY_ISLINK, HG_OTHER_ISLINK, HG_BASE_ISLINK in environment. Without these variables, it's impossible for the merge application to know whether the 'other' and 'base' files were symlinks in their original contexts. For the purposes of the merge they are always emitted as small text files.
2007-10-03 23:09:36 +02:00
Matt Mackall
3f58de820d merge: add debug diagnostics for findcopies 2007-10-04 19:44:37 -05:00
Alexis S. L. Carvalho
a345c2c9da merge: forcefully mark files that we get from the second parent as dirty
After a hg merge, we want to include in the commit all the files that we
got from the second parent, so that we have the correct file-level
history.  To make them visible to hg commit, we try to mark them as dirty.

Unfortunately, right now we can't really mark them as dirty[1] - the
best we can do is to mark them as needing a full comparison of their
contents, but they will still be considered clean if they happen to be
identical to the version in the first parent.

This changeset extends the dirstate format in a compatible way, so that
we can mark a file as dirty:

Right now we use a negative file size to indicate we don't have valid
stat data for this entry.  In practice, this size is always -1.

This patch uses -2 to indicate that the entry is dirty.  Older versions
of hg won't choke on this dirstate, but they may happily mark the file
as clean after a full comparison, destroying all of our hard work.

The patch adds a dirstate.normallookup method with the semantics of the
current normaldirty, and changes normaldirty to forcefully mark the
entry as dirty.

This should fix issue522.

[1] - well, we could put them in state 'm', but that state has a
different meaning.
2007-08-23 01:48:29 -03:00
Alexis S. L. Carvalho
a866998db8 merge with crew-stable 2007-08-12 12:43:52 -03:00
Alexis S. L. Carvalho
664fc9f5dd merge: fix a copy detection bug (issue672)
When merging rev1 and rev2, we want to search for copies that happened
in rev1 but not in rev2 and vice-versa.  We were starting the search at
rev1/rev2 and then going back, stopping as soon as we reached the revno
of the ancestor, but that can miss some cases (see the new
test-issue672).

Now we calculate the revisions that are ancestors of rev1 or rev2 (but
not both) and make sure the search doesn't stop too early.

Simplified test provided by mpm, based on a test case provided by
Edward Lee.
2007-08-12 12:15:10 -03:00
Bryan O'Sullivan
1b98353d91 Make audit_path more stringent.
The following properties of a path are now checked for:

    - under top-level .hg
    - starts at the root of a windows drive
    - contains ".."
    - traverses a symlink (e.g. a/symlink_here/b)
    - inside a nested repository

If any of these is true, the path is rejected.

The check for traversing a symlink is arguably stricter than necessary;
perhaps we should be checking for symlinks that point outside the
repository.
2007-08-10 10:46:03 -07:00
Matt Mackall
f5270b4251 Merge with -stable 2007-08-02 13:23:53 -05:00
Matt Mackall
2cee92939f merge: avoid double deletion mentioned in issue636 2007-08-02 12:29:10 -05:00
Matt Mackall
600c42bfbf Merge with stable 2007-08-01 14:03:48 -05:00
Matt Mackall
d76c06eeb0 merge: do early copy to deal with issue636
Without copies/renames, merges source names are 1:1 with their
targets. Copies and renames introduce the possibility that there will
be two merges with the same input but different output. By doing the
copy to the destination name before the merge, the actual merge
becomes 1:1 again, and no source is the input to two different merges.

- add a preliminary scan to applyupdates to do copies
- for the merge action, pass the old name (for finding ancestors) and
  the new name (for input to the merge) to filemerge
- eliminate the old post-merge copy
- lookup file contents from new name in filemerge
- pass new name to external merge helper
- report merge failure at new name
- add a test
2007-08-01 12:33:12 -05:00
Matt Mackall
169bd362a1 Merge with -stable 2007-07-26 12:02:55 -05:00
Matt Mackall
0ac116e475 merge: don't forget to update the dirstate for exec bit changes 2007-07-26 11:19:53 -05:00
Matt Mackall
3a3bd8ec5b Make repo locks recursive, eliminate all passing of lock/wlock 2007-07-21 16:02:10 -05:00
Matt Mackall
3e13c68628 Use try/finally pattern to cleanup locks and transactions 2007-07-21 16:02:10 -05:00
Matt Mackall
cf691df912 dirstate: break update into separate functions 2007-07-21 16:02:09 -05:00
Matt Mackall
1e9e9e4cdd merge: fix unnecessary rename merges on linear update (issue631)
If one side's revision is identical to the ancestor, we skip the rest
of the copy detection logic.
2007-07-15 14:43:38 -05:00
Matt Mackall
d00f8a1d6c merge: fix adding untracked files on directory rename (issue612)
Fix from Brendan
Added test case
2007-07-05 16:01:07 -05:00
Matt Mackall
cfe7a0a522 merge: make test for fast-forward merge stricter (issue619)
don't allow merging with an ancestor
fix != on contexts
add a test
2007-07-05 13:34:18 -05:00
Alexis S. L. Carvalho
cc6e60f60e merge: fix small bug with a failed merge across a rename
If $HGMERGE wasn't able to fix the conflicts, we wouldn't copy
f to fd, and util.set_exec wouldn't find the file.
2007-06-22 20:44:40 -03:00
Matt Mackall
a38809cf9e merge: warn user about divergent renames 2007-06-21 18:02:03 -05:00
Thomas Arendsen Hein
4d29c6dc8e Updated copyright notices and add "and others" to "hg version" 2007-06-19 08:51:34 +02:00
Thomas Arendsen Hein
483231d996 Cleanup of whitespace, indentation and line continuation. 2007-06-19 08:06:37 +02:00
Brendan Cully
b969d388db Make fast-forward merges full merges 2007-06-18 12:38:54 -07:00
Matt Mackall
5fa7270b2d Merge with stable 2007-05-08 11:42:48 -05:00
Matt Mackall
6bf7f7256d merge: fix spurious merges for copies in linear updates
We make better use of contexts to accurately identify copies that
don't need merges.

Add a simple test and update other tests.
2007-05-08 02:59:13 -05:00
Brendan Cully
fb4b5549c3 Add fast-forward branch merging 2007-05-06 20:27:45 -07:00
Matt Mackall
5290628c48 Merge with stable 2007-05-03 17:27:21 -05:00
Matt Mackall
32c298df8a merge: reorganize some hunks in findcopies 2007-05-03 17:24:43 -05:00
Matt Mackall
e05a1595b6 merge: simplify a check in checkcopies 2007-05-03 17:24:43 -05:00
Matt Mackall
b3ab26f105 merge: expand and simplify the invalid handling for directory moves 2007-05-03 17:24:43 -05:00
Matt Mackall
691e10a07c merge: fix a bug detecting directory moves
When all the files in a directory are moved, it may be incorrectly marked as moved even if it contains subdirectories.
2007-05-03 17:24:43 -05:00
Matt Mackall
47ec1c2825 merge: clarify the findcopies code 2007-05-03 17:24:43 -05:00
Matt Mackall
e2dfe968ea Merge with stable 2007-04-16 12:37:30 -05:00
Matt Mackall
f63e728c54 merge: fix quadratic behavior in find-copies 2007-04-16 12:24:52 -05:00
Matt Mackall
1e8fed06d8 merge: fix a bug where copies were getting ignored 2007-04-05 16:25:47 -05:00
Alexis S. L. Carvalho
47cb22b5a2 Merge with crew-stable 2007-03-16 00:45:18 -03:00
Matt Mackall
e896adead6 Merge with -stable, fix small test failure 2007-03-14 01:26:09 -05:00
Matt Mackall
c2bb73121f Move branch read/write to dirstate where it belongs 2007-03-13 18:50:02 -05:00
Brendan Cully
5641becd5a Merge with crew-stable 2007-03-10 17:45:32 -08:00
Matt Mackall
4458a1780a merge: fix renaming of subdirectories under renamed directories 2007-02-27 16:20:06 -06:00
Matt Mackall
53a83c6c22 Merge with stable 2007-02-27 16:47:16 -06:00
Matt Mackall
de434078f7 symlinks: minimal support for symlinks in merge/update
This will get angry, confused, and sad if you try to merge a symlink
with a regular file.
2006-12-29 20:04:31 -06:00
Matt Mackall
9a533e02cb symlinks: add flags param to wwrite
Now wwrite can set symlink and exec for files
2006-12-29 20:04:31 -06:00
Matt Mackall
8ed93098b6 replace filehandle version of wwrite with wwritedata 2006-12-29 20:04:31 -06:00
Matt Mackall
ebc2b5ccc8 merge: fix a bug where copies were ignored 2007-04-05 16:43:18 -05:00
Matt Mackall
296d6a7cb8 Simplify i18n imports 2006-12-14 20:25:19 -06:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Matt Mackall
2623870448 Remove deprecated old-style branch support 2006-12-12 18:16:23 -06:00
Matt Mackall
d9f0b69ae5 Fix copy detection corner case
We were aborting if the copied from rev was before the cut-off limit,
rather than the copied _to_ rev. The copied from rev can be
arbitrarily old.
2006-12-12 17:52:33 -06:00
Alexis S. L. Carvalho
63ae667098 Use UTF-8 in .hg/branch 2006-12-10 20:35:28 -02:00
Matt Mackall
a8fff7f220 imported patch collision 2006-12-04 17:10:31 -06:00
Matt Mackall
aaf36f881a Handle transcoding of branch names 2006-12-03 16:16:33 -06:00
Matt Mackall
05748f203d merge: handle directory renames
commit: handle new copy dirstate case correctly
findcopies:
 keep a map of all copies found for directory logic
 add dirs filter
 check for merge:followdirs config option
 generate a directory move map
 find files that match directory move map
manifestmerge:
 add directory rename cases
applyupdates:
 skip actions with None file
 add "d" action
recordupdates:
 add "d" action
add simple directory rename test
2006-11-30 17:36:33 -06:00
Matt Mackall
452ab5fc24 merge: pull findcopies helpers inside, refactor checkpair to checkcopies 2006-11-30 17:36:33 -06:00
Matt Mackall
f8e4088f12 merge: move check for empty ancestor into findcopies 2006-11-30 17:36:33 -06:00
Matt Mackall
f9ab52977a merge: only store one direction of copies in the copy map
simplify checkpair
generate copied hash from copy map
make copy cases more symmetrical
2006-11-30 17:36:33 -06:00
Matt Mackall
224d8a5d1f merge: add copied hash to simplify copy logic 2006-11-30 17:36:33 -06:00
Matt Mackall
1c0e2e44bd merge: remove unused match logic from findcopies 2006-11-30 17:36:33 -06:00
Matt Mackall
8732a61bab merge: report destinations of moves in merge action messages 2006-11-30 17:36:33 -06:00
Brendan Cully
261404dfe1 Make context __eq__ handle arbitrary RHS values 2006-11-27 15:27:09 -08:00
Brendan Cully
791078de93 merge: Don't search for copies across unrelated manifests 2006-11-23 22:45:00 -08:00
Matt Mackall
f9f3aa2d91 avoid unnecessary copy merges 2006-11-18 11:34:19 -06:00
Thomas Arendsen Hein
411d64ce3e white space and line break cleanups 2006-11-17 08:06:54 +01:00
Matt Mackall
6239f7b678 Clarify untracked file merge message 2006-11-01 21:47:55 -06:00
Benoit Boissinot
83a68d580f merge with backout 2006-10-31 13:03:23 +01:00
Benoit Boissinot
3f2046d235 Backed out changeset 0fc94973be4ffeb0b5ace8a920dec676a9a51130 2006-10-31 13:02:49 +01:00
Benoit Boissinot
b8176cb795 use workingcontext.files() to detect if the repo is unclean 2006-10-29 14:18:55 +01:00
Benoit Boissinot
58322272ec allow update to switch to a different branch if the repo is clean 2006-10-29 13:08:10 +01:00
Thomas Arendsen Hein
687e4a7111 Define and use nullrev (revision of nullid) instead of -1. 2006-10-29 10:53:51 +01:00
Matt Mackall
785d7f44cb merge: fix branch setting
(and remove debugging message)
2006-10-17 22:59:01 -05:00
Matt Mackall
8c602e592a imported patch foo 2006-10-17 22:34:43 -05:00
Matt Mackall
384f4460ac merge: if filemerge skips merge, report as updated 2006-10-15 16:18:09 -05:00
Matt Mackall
492924b1a5 merge: update dirstate correctly for non-branchmerge updates
- we don't actually need the context in recordupdates
- use -1 for filesize to force check on normal update
- only record copy for branchmerges
- forget moved files on update
2006-10-13 17:58:04 -05:00
Matt Mackall
4d37ff4a92 merge: turn followcopies on by default 2006-10-12 14:49:19 -05:00
Matt Mackall
fef0705ae8 merge: pull user messages out to hg.py
- add _update for shadowing in clone
- add _showstats helper
- remove update parameter defaults
- move stats message and merge help messages
2006-10-10 03:39:44 -05:00
Matt Mackall
47200ceb34 merge: update some docstrings 2006-10-10 02:31:02 -05:00
Matt Mackall
2e860ba70d merge: various tidying
update tests to handle corrected output and new workingctx display
2006-10-10 02:15:20 -05:00
Matt Mackall
285d3e6b86 merge: use contexts in checkunknown and forgetremoved 2006-10-10 01:43:58 -05:00
Matt Mackall
41f0942fa0 merge: shortcircuit filemerge for identical files
- use filectx.cmp to compare files
- move merge messages into filemerge
- kill the redundant resolving message
- update tests
2006-10-10 01:16:06 -05:00
Matt Mackall
d2113ca490 merge: pull file copy/move out of filemerge 2006-10-10 00:54:00 -05:00
Matt Mackall
8df16edc62 merge: unify merge and copy actions 2006-10-10 00:41:55 -05:00
Matt Mackall
03952b0c2d merge: swap file and mode args for act() 2006-10-10 00:32:30 -05:00