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 | 762729b50edc462fc76cc0413dae64a3353d28eb (patch) | |
| tree | 3ddc5d51014480d07e38d67b62142ecf4016b49a /lib | |
| parent | 9ddc2b5688163d6ad1f5e83a53e6151a69f9f700 (diff) | |
| download | go-762729b50edc462fc76cc0413dae64a3353d28eb.tar.xz | |
codereview: save CL messages in $(hg root)/last-change
Fixes #2279.
R=bradfitz, r, r
CC=golang-dev
https://golang.org/cl/5096042
Diffstat (limited to 'lib')
| -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 1b70a29c6c..761476371b 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)): |
