From: Eric S. Raymond Date: Sat, 8 Nov 2014 21:06:17 +0000 (-0500) Subject: Gice up on moveto and copyto, they're too complicated. X-Git-Tag: 0.2~3 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=f0925f88cebcb5d1e63884a7f13081684cc4dd19;p=src.git Gice up on moveto and copyto, they're too complicated. --- diff --git a/src b/src index 6fa2f78..cd8f259 100755 --- a/src +++ b/src @@ -45,7 +45,7 @@ def do_or_die(dcmd, legend=b"", loud=False): 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: @@ -68,9 +68,9 @@ class popen_or_die: 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 @@ -87,7 +87,7 @@ class popen_or_die: 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: @@ -310,12 +310,6 @@ src copy 'old' 'new' 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. @@ -822,14 +816,6 @@ class RCS: 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) diff --git a/srctest b/srctest index 5f964d3..77641db 100755 --- a/srctest +++ b/srctest @@ -195,6 +195,4 @@ EOF src $TESTOPTS ls | diff -u testfile16 - check "ls" -# untested: moveto, copyto - # end