hgext/shelve.py
changeset 30466 893be22cdb38
parent 30465 b924375cce3a
child 30531 7b3136bc7bfd
equal deleted inserted replaced
30465:b924375cce3a 30466:893be22cdb38
   705     shelveunknown = frozenset(shelveunknown.split('\0'))
   705     shelveunknown = frozenset(shelveunknown.split('\0'))
   706     addedafter = frozenset(repo.status().added)
   706     addedafter = frozenset(repo.status().added)
   707     toforget = (addedafter & shelveunknown) - addedbefore
   707     toforget = (addedafter & shelveunknown) - addedbefore
   708     repo[None].forget(toforget)
   708     repo[None].forget(toforget)
   709 
   709 
       
   710 def _finishunshelve(repo, oldtiprev, tr):
       
   711     # The transaction aborting will strip all the commits for us,
       
   712     # but it doesn't update the inmemory structures, so addchangegroup
       
   713     # hooks still fire and try to operate on the missing commits.
       
   714     # Clean up manually to prevent this.
       
   715     repo.unfiltered().changelog.strip(oldtiprev, tr)
       
   716     _aborttransaction(repo)
       
   717 
   710 @command('unshelve',
   718 @command('unshelve',
   711          [('a', 'abort', None,
   719          [('a', 'abort', None,
   712            _('abort an incomplete unshelve operation')),
   720            _('abort an incomplete unshelve operation')),
   713           ('c', 'continue', None,
   721           ('c', 'continue', None,
   714            _('continue an incomplete unshelve operation')),
   722            _('continue an incomplete unshelve operation')),
   844         mergefiles(ui, repo, pctx, shelvectx)
   852         mergefiles(ui, repo, pctx, shelvectx)
   845         restorebranch(ui, repo, branchtorestore)
   853         restorebranch(ui, repo, branchtorestore)
   846         _forgetunknownfiles(repo, shelvectx, addedbefore)
   854         _forgetunknownfiles(repo, shelvectx, addedbefore)
   847 
   855 
   848         shelvedstate.clear(repo)
   856         shelvedstate.clear(repo)
   849 
   857         _finishunshelve(repo, oldtiprev, tr)
   850         # The transaction aborting will strip all the commits for us,
       
   851         # but it doesn't update the inmemory structures, so addchangegroup
       
   852         # hooks still fire and try to operate on the missing commits.
       
   853         # Clean up manually to prevent this.
       
   854         repo.unfiltered().changelog.strip(oldtiprev, tr)
       
   855 
       
   856         unshelvecleanup(ui, repo, basename, opts)
   858         unshelvecleanup(ui, repo, basename, opts)
   857 
       
   858         _aborttransaction(repo)
       
   859     finally:
   859     finally:
   860         ui.quiet = oldquiet
   860         ui.quiet = oldquiet
   861         if tr:
   861         if tr:
   862             tr.release()
   862             tr.release()
   863         lockmod.release(lock)
   863         lockmod.release(lock)