Show More
@@ -12,7 +12,7 b' import os' | |||||
12 | import copy |
|
12 | import copy | |
13 |
|
13 | |||
14 | from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \ |
|
14 | from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \ | |
15 |
archival |
|
15 | archival, pathutil, revset | |
16 | from mercurial.i18n import _ |
|
16 | from mercurial.i18n import _ | |
17 | from mercurial.node import hex |
|
17 | from mercurial.node import hex | |
18 | from hgext import rebase |
|
18 | from hgext import rebase | |
@@ -1202,8 +1202,18 b' def overriderollback(orig, ui, repo, **o' | |||||
1202 | if before == after: |
|
1202 | if before == after: | |
1203 | return result # no need to restore standins |
|
1203 | return result # no need to restore standins | |
1204 |
|
1204 | |||
1205 | merge.update(repo, node='.', branchmerge=False, force=True, |
|
1205 | pctx = repo['.'] | |
1206 | partial=lfutil.isstandin) |
|
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 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
1218 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
1209 | orphans = set(lfdirstate) |
|
1219 | orphans = set(lfdirstate) |
@@ -103,9 +103,15 b' Test that "hg rollback" restores status ' | |||||
103 |
|
103 | |||
104 | $ hg update -C -q |
|
104 | $ hg update -C -q | |
105 | $ hg remove large1 |
|
105 | $ hg remove large1 | |
|
106 | $ test -f .hglf/large1 | |||
|
107 | [1] | |||
106 | $ hg forget large2 |
|
108 | $ hg forget large2 | |
|
109 | $ test -f .hglf/large2 | |||
|
110 | [1] | |||
107 | $ echo largeX > largeX |
|
111 | $ echo largeX > largeX | |
108 | $ hg add --large largeX |
|
112 | $ hg add --large largeX | |
|
113 | $ cat .hglf/largeX | |||
|
114 | ||||
109 | $ hg commit -m 'will be rollback-ed soon' |
|
115 | $ hg commit -m 'will be rollback-ed soon' | |
110 | $ echo largeY > largeY |
|
116 | $ echo largeY > largeY | |
111 | $ hg add --large largeY |
|
117 | $ hg add --large largeY | |
@@ -122,10 +128,16 b' Test that "hg rollback" restores status ' | |||||
122 | working directory now based on revision 3 |
|
128 | working directory now based on revision 3 | |
123 | $ hg status -A large1 |
|
129 | $ hg status -A large1 | |
124 | R large1 |
|
130 | R large1 | |
|
131 | $ test -f .hglf/large1 | |||
|
132 | [1] | |||
125 | $ hg status -A large2 |
|
133 | $ hg status -A large2 | |
126 | R large2 |
|
134 | R large2 | |
|
135 | $ test -f .hglf/large2 | |||
|
136 | [1] | |||
127 | $ hg status -A largeX |
|
137 | $ hg status -A largeX | |
128 | A largeX |
|
138 | A largeX | |
|
139 | $ cat .hglf/largeX | |||
|
140 | ||||
129 | $ hg status -A largeY |
|
141 | $ hg status -A largeY | |
130 | ? largeY |
|
142 | ? largeY | |
131 |
|
143 |
General Comments 0
You need to be logged in to leave comments.
Login now