Advertisement
Guest User

reposurgeon-0.3 Mercurial compatibility patch.

a guest
Nov 8th, 2010
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.05 KB | None | 0 0
  1. *** reposurgeon-0.3/reposurgeon 2010-11-07 15:49:17.000000000 +0000
  2. --- reposurgeon/reposurgeon 2010-11-08 10:06:00.282948809 +0000
  3. ***************
  4. *** 51,59 ****
  5.                "git checkout"),
  6.        # FIXME: hg and bzr methods are untested
  7.       "hg" : (".hg",
  8. !             "hg-fast-export.sh %s",   # Not part of stock hg
  9.               "hg init",
  10. !             "hg fast-import %s",      # Not part of stock hg
  11.               "hg checkout"),
  12.       "bzr" : (".bzr",
  13.                "bzr fast-export --plain %s",
  14. --- 51,59 ----
  15.                "git checkout"),
  16.        # FIXME: hg and bzr methods are untested
  17.       "hg" : (".hg",
  18. !             "hg-fast-export.py --marks /dev/null --mapping /dev/null --heads /dev/null --status /dev/null --repo .",   # Not part of stock hg
  19.               "hg init",
  20. !             "hg fastimport %s",      # Not part of stock hg
  21.               "hg checkout"),
  22.       "bzr" : (".bzr",
  23.                "bzr fast-export --plain %s",
  24. ***************
  25. *** 580,585 ****
  26. --- 580,590 ----
  27.                               self.error("bad count in data")
  28.                       else:
  29.                           self.error("malformed data header %s" % `line`)
  30. +                        
  31. +                     line = readline()
  32. +                     if line != '\n':
  33. +                         pushback(line) # Data commands may optionally end with LF
  34. +
  35.                       return dp
  36.                   def readline():
  37.                       if linebuffers:
  38. ***************
  39. *** 658,674 ****
  40.                                               break
  41.                                       else:
  42.                                           self.error("no blob matches commit reference to %s" % fileop.ref)
  43. !                                 elif fileop.ref[0] == 'inline':
  44. !                                     fileop.copyname = self.subdir() + "/inline-" + `id(self)` + "-" + `inline_count`
  45. !                                     self.read_data(open(fileop.copyname, "w")).close()
  46. !                                     inline_count += 1
  47.                                   else:
  48.                                       self.error("unknown content type in filemodify")
  49.                               # Handling of file ops ends.
  50.                               else:
  51.                                   pushback(line)
  52.                                   break
  53. !                         if not (commit.mark and commit.author and commit.committer):
  54.                               self.import_line = commitbegin
  55.                               self.error("missing required fields in commit")
  56.                           self.events.append(commit)
  57. --- 663,686 ----
  58.                                               break
  59.                                       else:
  60.                                           self.error("no blob matches commit reference to %s" % fileop.ref)
  61. !                                 elif fileop.ref == 'inline':
  62. !                                     fileop.copyname = self.subdir() + "/inline-" + `id(self)` + "-" + `inlinecount`
  63. !                                     read_data(open(fileop.copyname, "w")).close()
  64. !                                     inlinecount += 1
  65.                                   else:
  66.                                       self.error("unknown content type in filemodify")
  67.                               # Handling of file ops ends.
  68.                               else:
  69.                                   pushback(line)
  70.                                   break
  71. !
  72. !                         if not commit.author:
  73. !                             commit.author = commit.committer
  74. !                         # git-fast-import(1) says the author command is not
  75. !                         # mandatory, and importers should use the committer
  76. !                         # info if it is ommitted.
  77. !
  78. !                         if not (commit.mark and commit.committer):
  79.                               self.import_line = commitbegin
  80.                               self.error("missing required fields in commit")
  81.                           self.events.append(commit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement