##// END OF EJS Templates
shelve: make unshelve work even if it don't run in repository root...
Takumi IINO -
r19943:4de11687 stable
parent child Browse files
Show More
@@ -358,6 +358,10 b' def checkparents(repo, state):'
358 358 raise util.Abort(_('working directory parents do not match unshelve '
359 359 'state'))
360 360
361 def pathtofiles(repo, files):
362 cwd = repo.getcwd()
363 return [repo.pathto(f, cwd) for f in files]
364
361 365 def unshelveabort(ui, repo, state, opts):
362 366 """subcommand that abort an in-progress unshelve"""
363 367 wlock = repo.wlock()
@@ -372,7 +376,8 b' def unshelveabort(ui, repo, state, opts)'
372 376 revertfiles = readshelvedfiles(repo, state.name)
373 377 wctx = repo.parents()[0]
374 378 cmdutil.revert(ui, repo, wctx, [wctx.node(), nullid],
375 *revertfiles, **{'no_backup': True})
379 *pathtofiles(repo, revertfiles),
380 **{'no_backup': True})
376 381 # fix up the weird dirstate states the merge left behind
377 382 mf = wctx.manifest()
378 383 dirstate = repo.dirstate
@@ -532,7 +537,8 b' def unshelve(ui, repo, *shelved, **opts)'
532 537 revertfiles = set(parents[1].files()).difference(ms)
533 538 cmdutil.revert(ui, repo, parents[1],
534 539 (parents[0].node(), nullid),
535 *revertfiles, **{'no_backup': True})
540 *pathtofiles(repo, revertfiles),
541 **{'no_backup': True})
536 542 raise error.InterventionRequired(
537 543 _("unresolved conflicts (see 'hg resolve', then "
538 544 "'hg unshelve --continue')"))
@@ -540,7 +546,8 b' def unshelve(ui, repo, *shelved, **opts)'
540 546 else:
541 547 parent = tip.parents()[0]
542 548 hg.update(repo, parent.node())
543 cmdutil.revert(ui, repo, tip, repo.dirstate.parents(), *tip.files(),
549 cmdutil.revert(ui, repo, tip, repo.dirstate.parents(),
550 *pathtofiles(repo, tip.files()),
544 551 **{'no_backup': True})
545 552
546 553 prevquiet = ui.quiet
@@ -165,7 +165,9 b' expect "a" to no longer be present, but '
165 165
166 166 and now "a/a" should reappear
167 167
168 $ cd a
168 169 $ hg unshelve -q wibble
170 $ cd ..
169 171 $ hg status -C
170 172 M a/a
171 173 A b.rename/b
General Comments 0
You need to be logged in to leave comments. Login now