mercurial/commands.py
changeset 2167 f5c2c6e69fd7
parent 2166 d0c02b4dce9a
parent 2165 d821918e3bee
child 2175 b2ae81a7df29
equal deleted inserted replaced
2166:d0c02b4dce9a 2167:f5c2c6e69fd7
   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")