=== modified file '__init__.py' --- __init__.py 2009-02-20 13:07:39 +0000 +++ __init__.py 2009-08-22 11:24:10 +0000 @@ -10,8 +10,13 @@ version_info = (1, 1) # Ripped straight from GNU touch(1) -FLAGS = os.O_WRONLY | os.O_CREAT | os.O_NONBLOCK | os.O_NOCTTY - + + +import platform +if platform.system() == 'Windows': + FLAGS = os.O_WRONLY | os.O_CREAT +else: + FLAGS = os.O_WRONLY | os.O_CREAT | os.O_NONBLOCK | os.O_NOCTTY class cmd_touch(Command): """Basically: touch && bzr add .""" @@ -21,11 +26,16 @@ def run(self, file_list): wt = WorkingTree.open_containing('.') # Create the files if they don't exist. - for filename in file_list: - filepath = os.path.join(os.getcwd(), filename) - fd = os.open(filepath, FLAGS, 0666) - os.close(fd) - wt[0].smart_add(file_list, recurse=False) + #if len(file_list) > 0: + if file_list: + for filename in file_list: + filepath = os.path.join(os.getcwd(), filename) + fd = os.open(filepath, FLAGS, 0666) + os.close(fd) + wt[0].smart_add(file_list, recurse=False) + else: + print "need to give a FILNAME" + print "command use: bzr touch FILENAME" register_command(cmd_touch)