Skip to content

Commit 4896888

Browse files
author
Yaniv Inbar
committed
http: add -f flag to hg_import.py
https://codereview.appspot.com/9739043/
1 parent 48aa083 commit 4896888

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

hg_import.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,15 @@
3636
print 'must be run from the root directory of the hg workspace'
3737
sys.exit(1)
3838

39-
url = sys.argv[1]
39+
if '-f' == sys.argv[1]:
40+
i = 2
41+
force = ['-f']
42+
else:
43+
i = 1
44+
force = []
45+
url = sys.argv[i]
4046

41-
subprocess.check_call([hg_cmd, 'import', '--no-commit', url])
47+
subprocess.check_call([hg_cmd, 'import'] + force + ['--no-commit', url])
4248
webFile = urllib.urlopen(url)
4349
for line in webFile.readlines():
4450
# detect file name

0 commit comments

Comments
 (0)