diff --git a/mercurial/hg.py b/mercurial/hg.py
index 87484f627422189536d8ee676e31ba1477a33104_bWVyY3VyaWFsL2hnLnB5..1aaa49039a6b109d589db95cd64cd24cef3e4d05_bWVyY3VyaWFsL2hnLnB5 100644
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms
 # of the GNU General Public License, incorporated herein by reference.
 
-import sys, struct, sha, socket, os, time, re, urllib2
+import sys, struct, sha, socket, os, time, re, urllib2, tempfile
 import urllib
 from mercurial import byterange, lock
 from mercurial.transaction import *