[go: nahoru, domu]

Skip to content

Commit

Permalink
http: hack to support hg cp
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaniv Inbar committed May 20, 2013
1 parent c632a8f commit 5ab8e6b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hg_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
deleted_re = re.compile('^deleted file mode \S+$')
fp = re.compile('^rename from (\S+)$')
tp = re.compile('^rename to (\S+)$')
fcp = re.compile('^copy from (\S+)$')
tcp = re.compile('^copy to (\S+)$')
hg_cmd = 'hg'

if len(sys.argv) == 1:
Expand Down Expand Up @@ -56,5 +58,14 @@
if m:
hg_to = m.group(1)
subprocess.check_call([hg_cmd, 'mv', '-f', hg_from, hg_to])
# detect copied file
m = fcp.search(line)
if m:
hg_from = m.group(1)
m = tcp.search(line)
if m:
hg_to = m.group(1)
subprocess.check_call([hg_cmd, 'cp', hg_from, hg_to])
subprocess.check_call([hg_cmd, 'revert', '--no-backup', hg_from])
webFile.close()

0 comments on commit 5ab8e6b

Please sign in to comment.