Commit Graph

195 Commits

Author SHA1 Message Date
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