##// 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 r = q.qrepo()
2986 r = q.qrepo()
2987 if r and patch in r.dirstate:
2987 if r and patch in r.dirstate:
2988 wctx = r[None]
2988 wctx = r[None]
2989 wlock = r.wlock()
2989 with r.wlock():
2990 try:
2991 if r.dirstate[patch] == 'a':
2990 if r.dirstate[patch] == 'a':
2992 r.dirstate.drop(patch)
2991 r.dirstate.drop(patch)
2993 r.dirstate.add(name)
2992 r.dirstate.add(name)
2994 else:
2993 else:
2995 wctx.copy(patch, name)
2994 wctx.copy(patch, name)
2996 wctx.forget([patch])
2995 wctx.forget([patch])
2997 finally:
2998 wlock.release()
2999
2996
3000 q.savedirty()
2997 q.savedirty()
3001
2998
General Comments 0
You need to be logged in to leave comments. Login now