##// END OF EJS Templates
with: use context manager in qrename
Bryan O'Sullivan -
r27848:9bda75a0 default
parent child Browse files
Show More
@@ -2986,16 +2986,13 b' def rename(ui, repo, patch, name=None, *'
2986 2986 r = q.qrepo()
2987 2987 if r and patch in r.dirstate:
2988 2988 wctx = r[None]
2989 wlock = r.wlock()
2990 try:
2989 with r.wlock():
2991 2990 if r.dirstate[patch] == 'a':
2992 2991 r.dirstate.drop(patch)
2993 2992 r.dirstate.add(name)
2994 2993 else:
2995 2994 wctx.copy(patch, name)
2996 2995 wctx.forget([patch])
2997 finally:
2998 wlock.release()
2999 2996
3000 2997 q.savedirty()
3001 2998
General Comments 0
You need to be logged in to leave comments. Login now