Skip to content

Commit

Permalink
Allow move_class.py to move untracked files. Refs #7263
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jul 3, 2013
1 parent 02509f8 commit df6f2db
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Code/Mantid/Build/move_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@
def move_one(subproject, classname, newproject, newclassname, oldfilename, newfilename, args):
"""Move one file """

# Do an SVN move
cmd = "git mv " + oldfilename + " " + newfilename
# Move the file
cmd = "mv " + oldfilename + " " + newfilename
if not args.no_vcs:
cmd = "git " + cmd
print "Running:", cmd
os.system(cmd)
retval = os.system(cmd)
if retval != 0:
raise RuntimeError("Error executing cmd '%s'" % cmd)

f = open(newfilename, 'r')
text = f.read()
Expand Down Expand Up @@ -102,6 +106,9 @@ def move_all(subproject, classname, newproject, newclassname, args):
parser.add_argument('--force', dest='force', action='store_const',
const=True, default=False,
help='Force overwriting existing files. Use with caution!')
parser.add_argument('--no-vcs', dest='no_vcs', action='store_const',const=True,
default=False,
help='Can be used to move a class that is not yet under version control. Default: False')
parser.add_argument('--no-header', dest='header', action='store_const',
const=False, default=True,
help="Don't move the header file")
Expand All @@ -120,14 +127,15 @@ def move_all(subproject, classname, newproject, newclassname, args):
parser.add_argument('--project', dest='project',
default="Framework",
help='The project in which this goes. Default: Framework. Can be MantidQt, Vates')


args = parser.parse_args()
subproject = args.subproject
newproject = args.newproject
classname = args.classname
newclassname = args.newclassname
overwrite = args.force

# Make sure the subfolders end with a /
if args.source_subfolder != "":
if args.source_subfolder[-1:] != "/":
Expand Down

0 comments on commit df6f2db

Please sign in to comment.