hgext/convert/git.py
changeset 32291 bd872f64a8ba
parent 30815 c5bf2e8ec18c
child 34157 a608b46a5ed0
equal deleted inserted replaced
32290:2959c3e986e0 32291:bd872f64a8ba
    30 
    30 
    31     def hgsubstate(self):
    31     def hgsubstate(self):
    32         return "%s %s" % (self.node, self.path)
    32         return "%s %s" % (self.node, self.path)
    33 
    33 
    34 # Keys in extra fields that should not be copied if the user requests.
    34 # Keys in extra fields that should not be copied if the user requests.
    35 bannedextrakeys = set([
    35 bannedextrakeys = {
    36     # Git commit object built-ins.
    36     # Git commit object built-ins.
    37     'tree',
    37     'tree',
    38     'parent',
    38     'parent',
    39     'author',
    39     'author',
    40     'committer',
    40     'committer',
    41     # Mercurial built-ins.
    41     # Mercurial built-ins.
    42     'branch',
    42     'branch',
    43     'close',
    43     'close',
    44 ])
    44 }
    45 
    45 
    46 class convert_git(common.converter_source, common.commandline):
    46 class convert_git(common.converter_source, common.commandline):
    47     # Windows does not support GIT_DIR= construct while other systems
    47     # Windows does not support GIT_DIR= construct while other systems
    48     # cannot remove environment variable. Just assume none have
    48     # cannot remove environment variable. Just assume none have
    49     # both issues.
    49     # both issues.
   453             # (git prefix, hg prefix)
   453             # (git prefix, hg prefix)
   454             ('refs/remotes/origin/', remoteprefix + '/'),
   454             ('refs/remotes/origin/', remoteprefix + '/'),
   455             ('refs/heads/', '')
   455             ('refs/heads/', '')
   456         ]
   456         ]
   457 
   457 
   458         exclude = set([
   458         exclude = {
   459             'refs/remotes/origin/HEAD',
   459             'refs/remotes/origin/HEAD',
   460         ])
   460         }
   461 
   461 
   462         try:
   462         try:
   463             output, status = self.gitrunlines('show-ref')
   463             output, status = self.gitrunlines('show-ref')
   464             for line in output:
   464             for line in output:
   465                 line = line.strip()
   465                 line = line.strip()