equal
deleted
inserted
replaced
347 git=True): |
347 git=True): |
348 ui.write(chunk, label=label) |
348 ui.write(chunk, label=label) |
349 finally: |
349 finally: |
350 fp.close() |
350 fp.close() |
351 |
351 |
352 def readshelvedfiles(repo, basename): |
|
353 """return the list of files touched in a shelve""" |
|
354 fp = shelvedfile(repo, basename, 'files').opener() |
|
355 return fp.read().split('\0') |
|
356 |
|
357 def checkparents(repo, state): |
352 def checkparents(repo, state): |
358 """check parent while resuming an unshelve""" |
353 """check parent while resuming an unshelve""" |
359 if state.parents != repo.dirstate.parents(): |
354 if state.parents != repo.dirstate.parents(): |
360 raise util.Abort(_('working directory parents do not match unshelve ' |
355 raise util.Abort(_('working directory parents do not match unshelve ' |
361 'state')) |
356 'state')) |
521 basename = util.split(shelved[0][1])[1] |
516 basename = util.split(shelved[0][1])[1] |
522 ui.status(_("unshelving change '%s'\n") % basename) |
517 ui.status(_("unshelving change '%s'\n") % basename) |
523 else: |
518 else: |
524 basename = shelved[0] |
519 basename = shelved[0] |
525 |
520 |
526 shelvedfiles = readshelvedfiles(repo, basename) |
521 if not shelvedfile(repo, basename, 'files').exists(): |
|
522 raise util.Abort(_("shelved change '%s' not found") % basename) |
527 |
523 |
528 wlock = lock = tr = None |
524 wlock = lock = tr = None |
529 try: |
525 try: |
530 lock = repo.lock() |
526 lock = repo.lock() |
531 wlock = repo.wlock() |
527 wlock = repo.wlock() |