mercurial/commands.py
changeset 2165 d821918e3bee
parent 2160 858df1f354c1
child 2167 f5c2c6e69fd7
equal deleted inserted replaced
2164:cbd458228a96 2165:d821918e3bee
   301         if filename:
   301         if filename:
   302             if os.path.exists(filename):
   302             if os.path.exists(filename):
   303                 raise util.Abort(_("file '%s' already exists"), filename)
   303                 raise util.Abort(_("file '%s' already exists"), filename)
   304             fh = open(filename, "wb")
   304             fh = open(filename, "wb")
   305         else:
   305         else:
   306             fd, filename = tempfile.mkstemp(suffix=".hg", prefix="hg-bundle-")
   306             fd, filename = tempfile.mkstemp(prefix="hg-bundle-", suffix=".hg")
   307             fh = os.fdopen(fd, "wb")
   307             fh = os.fdopen(fd, "wb")
   308         cleanup = filename
   308         cleanup = filename
   309 
   309 
   310         if compress:
   310         if compress:
   311             fh.write("HG10")
   311             fh.write("HG10")