Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

nautilus: pass files to hgtk via stdin

Changeset 1cd3105bd18a

Parent 7b5cfcbf6d67

by Simon Heimberg

Changes to one file · Browse files at 1cd3105bd18a Showing diff from parent 7b5cfcbf6d67 Diff from another changeset...

 
140
141
142
143
 
144
145
146
147
148
 
 
 
 
149
150
 
 
 
 
 
151
152
153
 
140
141
142
 
143
144
 
 
 
 
145
146
147
148
149
 
150
151
152
153
154
155
156
157
@@ -140,14 +140,18 @@
  cmdopts = [sys.executable, self.hgproc, hgcmd]     if hgcmd not in nofilecmds and self.files: - # Use temporary file to store file list (avoid shell command + # Use stdin to pass file list (avoid shell command   # line limitations) - fd, tmpfile = tempfile.mkstemp(prefix="tortoisehg_filelist_") - os.write(fd, "\n".join(self.files)) - os.close(fd) - cmdopts += ['--listfile', tmpfile] + pipe = subprocess.PIPE + cmdopts += ['--listfile', '-'] + else: + pipe = None   - subprocess.Popen(cmdopts, cwd=cwd, env=self.env, shell=False) + stdin = subprocess.Popen(cmdopts, cwd=cwd, stdin=pipe, env=self.env, shell=False).stdin + + if pipe: + stdin.write('\n'.join(self.files)) + stdin.close()     if hgcmd not in nocachecmds:   # Remove cached repo object, dirstate may change