Anonymous committed 8501650

using os.chdir to switch to working copy root before doing shelving/unshelving
patch from Ross Cohen

  • Participants
  • Parent commits a1f3ac8

Comments (0)

Files changed (1)

     Note that only those changes done in tracked files will be considered
     so you may want to to hg add untracked files with desired changes.
+    cwd = os.getcwd()
+    os.chdir(repo.root)
     s = repo.attic
     if not s.haschanges (repo, pats, opts):
             ui.status(_('patch %s shelved\n' % (s.currentpatch)))
+    os.chdir(cwd)
 def unshelve(ui, repo, name = None, **opts):
     """applies a patch from the attic to the working copy"""
+    cwd = os.getcwd()
+    os.chdir(repo.root)
     s = repo.attic
     force = opts.get('force')
     if s.applied and not force:
             ui.status(_('patch removed\n'))
+    os.chdir(cwd)
 def listattic(ui, repo, **opts):
     """lists the available patches in the attic"""