##// END OF EJS Templates
largefiles: restore standins according to restored dirstate...
FUJIWARA Katsunori -
r22285:85bded43 default
parent child Browse files
Show More
@@ -12,7 +12,7 b' import os'
12 12 import copy
13 13
14 14 from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \
15 archival, merge, pathutil, revset
15 archival, pathutil, revset
16 16 from mercurial.i18n import _
17 17 from mercurial.node import hex
18 18 from hgext import rebase
@@ -1202,8 +1202,18 b' def overriderollback(orig, ui, repo, **o'
1202 1202 if before == after:
1203 1203 return result # no need to restore standins
1204 1204
1205 merge.update(repo, node='.', branchmerge=False, force=True,
1206 partial=lfutil.isstandin)
1205 pctx = repo['.']
1206 for f in repo.dirstate:
1207 if lfutil.isstandin(f):
1208 if repo.dirstate[f] == 'r':
1209 repo.wvfs.unlinkpath(f, ignoremissing=True)
1210 elif f in pctx:
1211 fctx = pctx[f]
1212 repo.wwrite(f, fctx.data(), fctx.flags())
1213 else:
1214 # content of standin is not so important in 'a',
1215 # 'm' or 'n' (coming from the 2nd parent) cases
1216 lfutil.writestandin(repo, f, '', False)
1207 1217
1208 1218 lfdirstate = lfutil.openlfdirstate(ui, repo)
1209 1219 orphans = set(lfdirstate)
@@ -103,9 +103,15 b' Test that "hg rollback" restores status '
103 103
104 104 $ hg update -C -q
105 105 $ hg remove large1
106 $ test -f .hglf/large1
107 [1]
106 108 $ hg forget large2
109 $ test -f .hglf/large2
110 [1]
107 111 $ echo largeX > largeX
108 112 $ hg add --large largeX
113 $ cat .hglf/largeX
114
109 115 $ hg commit -m 'will be rollback-ed soon'
110 116 $ echo largeY > largeY
111 117 $ hg add --large largeY
@@ -122,10 +128,16 b' Test that "hg rollback" restores status '
122 128 working directory now based on revision 3
123 129 $ hg status -A large1
124 130 R large1
131 $ test -f .hglf/large1
132 [1]
125 133 $ hg status -A large2
126 134 R large2
135 $ test -f .hglf/large2
136 [1]
127 137 $ hg status -A largeX
128 138 A largeX
139 $ cat .hglf/largeX
140
129 141 $ hg status -A largeY
130 142 ? largeY
131 143
General Comments 0
You need to be logged in to leave comments. Login now