1175 lock = repo.lock() |
1175 lock = repo.lock() |
1176 tr = repo.transaction(b'unshelve', report=lambda x: None) |
1176 tr = repo.transaction(b'unshelve', report=lambda x: None) |
1177 oldtiprev = len(repo) |
1177 oldtiprev = len(repo) |
1178 |
1178 |
1179 pctx = repo[b'.'] |
1179 pctx = repo[b'.'] |
1180 tmpwctx = pctx |
|
1181 # The goal is to have a commit structure like so: |
1180 # The goal is to have a commit structure like so: |
1182 # ...-> pctx -> tmpwctx -> shelvectx |
1181 # ...-> pctx -> tmpwctx -> shelvectx |
1183 # where tmpwctx is an optional commit with the user's pending changes |
1182 # where tmpwctx is an optional commit with the user's pending changes |
1184 # and shelvectx is the unshelved changes. Then we merge it all down |
1183 # and shelvectx is the unshelved changes. Then we merge it all down |
1185 # to the original pctx. |
1184 # to the original pctx. |
1186 |
1185 |
1187 activebookmark = _backupactivebookmark(repo) |
1186 activebookmark = _backupactivebookmark(repo) |
1188 tmpwctx, addedbefore = _commitworkingcopychanges( |
1187 tmpwctx, addedbefore = _commitworkingcopychanges( |
1189 ui, repo, opts, tmpwctx |
1188 ui, repo, opts, pctx |
1190 ) |
1189 ) |
1191 repo, shelvectx = _unshelverestorecommit(ui, repo, tr, basename) |
1190 repo, shelvectx = _unshelverestorecommit(ui, repo, tr, basename) |
1192 _checkunshelveuntrackedproblems(ui, repo, shelvectx) |
1191 _checkunshelveuntrackedproblems(ui, repo, shelvectx) |
1193 branchtorestore = b'' |
1192 branchtorestore = b'' |
1194 if shelvectx.branch() != shelvectx.p1().branch(): |
1193 if shelvectx.branch() != shelvectx.p1().branch(): |