diff options
author | Russ Cox <rsc@golang.org> | 2011-09-20 14:56:15 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2011-09-20 14:56:15 -0400 |
commit | dcce52618d4086ae8f9616ee81335d9e72ad170d (patch) | |
tree | a1e9ef56dff4354ad4f9b5e05f73c19a40ec9ab4 /lib/codereview | |
parent | 2c5140298153422e462073586553a894d862493e (diff) | |
download | go-dcce52618d4086ae8f9616ee81335d9e72ad170d.tar.gz |
codereview: save CL messages in $(hg root)/last-change
Fixes issue 2279.
R=bradfitz, r, r
CC=golang-dev
http://codereview.appspot.com/5096042
Diffstat (limited to 'lib/codereview')
-rw-r--r-- | lib/codereview/codereview.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index 1b70a29c6..761476371 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -849,6 +849,18 @@ def EditCL(ui, repo, cl): s = cl.EditorText() while True: s = ui.edit(s, ui.username()) + + # We can't trust Mercurial + Python not to die before making the change, + # so, by popular demand, just scribble the most recent CL edit into + # $(hg root)/last-change so that if Mercurial does die, people + # can look there for their work. + try: + f = open(repo.root+"/last-change", "w") + f.write(s) + f.close() + except: + pass + clx, line, err = ParseCL(s, cl.name) if err != '': if not promptyesno(ui, "error parsing change list: line %d: %s\nre-edit (y/n)?" % (line, err)): |