##// END OF EJS Templates
context: also consider path conflicts when clearing unknown files...
Mark Thomas -
r34557:7a8a16f8 default
parent child Browse files
Show More
@@ -1933,8 +1933,13 b' class workingfilectx(committablefilectx)'
1933 ``write()`` can be called successfully.
1933 ``write()`` can be called successfully.
1934 """
1934 """
1935 wvfs = self._repo.wvfs
1935 wvfs = self._repo.wvfs
1936 if wvfs.isdir(self._path) and not wvfs.islink(self._path):
1936 f = self._path
1937 wvfs.removedirs(self._path)
1937 if wvfs.isdir(f) and not wvfs.islink(f):
1938 wvfs.rmtree(f, forcibly=True)
1939 for p in reversed(list(util.finddirs(f))):
1940 if wvfs.isfileorlink(p):
1941 wvfs.unlink(p)
1942 break
1938
1943
1939 def setflags(self, l, x):
1944 def setflags(self, l, x):
1940 self._repo.wvfs.setflags(self._path, l, x)
1945 self._repo.wvfs.setflags(self._path, l, x)
@@ -35,6 +35,7 b' Basic merge - local file conflicts with '
35 [1]
35 [1]
36 $ hg update --clean .
36 $ hg update --clean .
37 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
37 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
38 $ rm a~853701544ac3
38
39
39 Basic update - local directory conflicts with remote file
40 Basic update - local directory conflicts with remote file
40
41
@@ -46,13 +47,19 b' Basic update - local directory conflicts'
46 abort: untracked files in working directory differ from files in requested revision
47 abort: untracked files in working directory differ from files in requested revision
47 [255]
48 [255]
48 $ hg up --clean file
49 $ hg up --clean file
49 abort: *: '$TESTTMP/repo/a' (glob)
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 [255]
51 (activating bookmark file)
52
53 Repo state is ok
51
54
52 Repo is in a very bad state now - recover manually
55 $ hg sum
53
56 parent: 1:853701544ac3
54 $ rm -r a
57 file
55 $ hg up -q --clean 0
58 branch: default
59 bookmarks: *file
60 commit: (clean)
61 update: 2 new changesets (update)
62 phases: 4 draft
56
63
57 Basic update - untracked file conflicts with remote directory
64 Basic update - untracked file conflicts with remote directory
58
65
@@ -62,6 +69,9 b' Basic update - untracked file conflicts '
62 a: replacing untracked file
69 a: replacing untracked file
63 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 (activating bookmark dir)
71 (activating bookmark dir)
72 $ cat a.orig
73 untracked
74 $ rm -f a.orig
65
75
66 Basic clean update - local directory conflicts with changed remote file
76 Basic clean update - local directory conflicts with changed remote file
67
77
@@ -73,11 +83,17 b' Basic clean update - local directory con'
73 abort: *: '$TESTTMP/repo/a' (glob)
83 abort: *: '$TESTTMP/repo/a' (glob)
74 [255]
84 [255]
75 $ hg up --clean file2
85 $ hg up --clean file2
76 abort: *: '$TESTTMP/repo/a' (glob)
86 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 [255]
87 (activating bookmark file2)
88
89 Repo state is ok
78
90
79 Repo is in a very bad state now - recover manually
91 $ hg sum
92 parent: 2:f64e09fac717
93 file2
94 branch: default
95 bookmarks: *file2
96 commit: (clean)
97 update: 1 new changesets, 2 branch heads (merge)
98 phases: 4 draft
80
99
81 $ rm -r a
82 $ hg up -q --clean 0
83
General Comments 0
You need to be logged in to leave comments. Login now