else:
mute = ""
if debug >= DEBUG_COMMANDS:
- announce(b"executing '%s'%s" % (dcmd, legend))
+ sys.stderr.write(b"executing '%s'%s\n" % (dcmd, legend))
try:
retcode = subprocess.call("(" + dcmd + ")" + mute, shell=True)
if retcode < 0:
def __enter__(self):
if debug >= DEBUG_COMMANDS:
if self.mode == "rb":
- announce(b"%s: reading from '%s'%s" % (rfc3339(time.time()), self.command, self.legend))
+ sys.stderr.write(b"%s: reading from '%s'%s\n" % (rfc3339(time.time()), self.command, self.legend))
else:
- announce(b"%s: writing to '%s'%s" % (rfc3339(time.time()), self.command, self.legend))
+ sys.stderr.write(b"%s: writing to '%s'%s\n" % (rfc3339(time.time()), self.command, self.legend))
try:
self.fp = os.popen(self.command, self.mode)
return self.fp
def capture_or_die(command):
"Run a specified command, capturing the output."
if debug >= DEBUG_COMMANDS:
- announce(b"%s: capturing %s" % (rfc3339(time.time()), command))
+ sys.stderr.write(b"%s: capturing %s\n" % (rfc3339(time.time()), command))
try:
content = subprocess.check_output(command, shell=True)
except (subprocess.CalledProcessError, OSError) as oe:
Rename a file and its master. Refuses to step on existing files or masters.
'cp' is a synonym.
-src moveto 'directory' ['file'...]
- Moves files and their histories to another directory.
-
-src copyto 'directory' ['file'...]
- Copies files and their histories to another directory.
-
src fast-export ['file'...]
Export one or more projects to standard output as a git fast-import stream.
The committer identification is copied from your Git configuration.
do_or_die("cp {0} {1} && cp {2} {3}".format(source, target,
self.master(source),
self.master(target)))
- def moveto(self, arg, target):
- "Move a file and its history to a target directory."
- # Using mv(1) evades cross-filesystem issues
- do_or_die("mv {0} {1} && mv {2} {3]/{4}".format(arg, target, self.master(arg), target, repodir))
- def copyto(self, arg, target):
- "Copy a file and its history to a target directory."
- # Using cp(1) evades cross-filesystem issues
- do_or_die("cp {0} {1} && cp {2} {3]/{4}".format(arg, target, self.master(arg), target, repodir))
def diff(diffspec1, diffspec2, diffopts, arg):
"Report a diff."
# The || : suppresses the error return from diff(1)