Commit Graph

161 Commits

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