contrib/convert-repo
changeset 450 9d785fd7deec
parent 431 dfc44f3f587c
child 692 695dd9a491da
equal deleted inserted replaced
449:df83b2c306ac 450:9d785fd7deec
    19 #
    19 #
    20 # This updates the mapfile on each commit copied, so it can be
    20 # This updates the mapfile on each commit copied, so it can be
    21 # interrupted and can be run repeatedly to copy new commits.
    21 # interrupted and can be run repeatedly to copy new commits.
    22 
    22 
    23 import sys, os, zlib, sha
    23 import sys, os, zlib, sha
    24 from mercurial import hg, ui
    24 from mercurial import hg, ui, util
    25 
    25 
    26 class convert_git:
    26 class convert_git:
    27     def __init__(self, path):
    27     def __init__(self, path):
    28         self.path = path
    28         self.path = path
    29 
    29 
    89         h = [ hg.hex(x) for x in h ]
    89         h = [ hg.hex(x) for x in h ]
    90         return h
    90         return h
    91         
    91         
    92     def putfile(self, f, e, data):
    92     def putfile(self, f, e, data):
    93         self.repo.wfile(f, "w").write(data)
    93         self.repo.wfile(f, "w").write(data)
    94         hg.set_exec(self.repo.wjoin(f), e)
    94         util.set_exec(self.repo.wjoin(f), e)
    95 
    95 
    96     def delfile(self, f):
    96     def delfile(self, f):
    97         try:
    97         try:
    98             os.unlink(self.repo.wjoin(f))
    98             os.unlink(self.repo.wjoin(f))
    99             self.repo.remove([f])
    99             self.repo.remove([f])