##// END OF EJS Templates
merge: do not delete untracked files silently (issue5962)...
Yuya Nishihara -
r39232:8c6775e8 stable
parent child Browse files
Show More
@@ -1745,13 +1745,19 b' class workingfilectx(committablefilectx)'
1745 1745 wvfs = self._repo.wvfs
1746 1746 f = self._path
1747 1747 wvfs.audit(f)
1748 if wvfs.isdir(f) and not wvfs.islink(f):
1749 wvfs.rmtree(f, forcibly=True)
1750 1748 if self._repo.ui.configbool('experimental', 'merge.checkpathconflicts'):
1749 # remove files under the directory as they should already be
1750 # warned and backed up
1751 if wvfs.isdir(f) and not wvfs.islink(f):
1752 wvfs.rmtree(f, forcibly=True)
1751 1753 for p in reversed(list(util.finddirs(f))):
1752 1754 if wvfs.isfileorlink(p):
1753 1755 wvfs.unlink(p)
1754 1756 break
1757 else:
1758 # don't remove files if path conflicts are not processed
1759 if wvfs.isdir(f) and not wvfs.islink(f):
1760 wvfs.removedirs(f)
1755 1761
1756 1762 def setflags(self, l, x):
1757 1763 self._repo.wvfs.setflags(self._path, l, x)
@@ -30,23 +30,24 b" of the files in a commit we're updating "
30 30
31 31 $ mkdir b && touch b/nonempty
32 32 $ hg up
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 abort: Directory not empty: '$TESTTMP/t/b'
34 [255]
34 35 $ hg ci
35 nothing changed
36 [1]
36 abort: last update was interrupted
37 (use 'hg update' to get a consistent checkout)
38 [255]
37 39 $ hg sum
38 parent: 1:b8bb4a988f25 tip
39 commit #1
40 parent: 0:538afb845929
41 commit #0
40 42 branch: default
41 commit: (clean)
42 update: (current)
43 commit: 1 unknown (interrupted update)
44 update: 1 new changesets (update)
43 45 phases: 2 draft
44 46
45 The following line is commented out because the file doesn't exist at the moment, and some OSes error out even with `rm -f`.
46 $ rm b/nonempty
47 $ rm b/nonempty
47 48
48 49 $ hg up
49 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 51 $ hg sum
51 52 parent: 1:b8bb4a988f25 tip
52 53 commit #1
@@ -50,7 +50,10 b' make sure that this does not erase untra'
50 50 $ hg st
51 51 ? name/file
52 52 $ hg up 1
53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 abort: Directory not empty: '$TESTTMP/r1/r2/name'
54 [255]
55 $ cat name/file
56 text
54 57 $ cd ..
55 58
56 59 #if symlink
General Comments 0
You need to be logged in to leave comments. Login now