Cvs2svn does not work with "xxx is not valid, v file"

I finally found the answer to my question when I wanted to publish it! However, I will post it anyway, including my answer, if it helps someone else:

When converting from CVS to Subversion cvs2svn, some message files failed to execute

"xxx is not a valid ,v file"

What is the problem?

+5
source share
4 answers

As it turned out, CVSNT skips the last 0xa from some files, where cvs2svn needs them. This can be easily fixed with the following C # code:

static void Main(string[] args)
{
  foreach (string file in Directory.GetFiles(args[0], "*,v", SearchOption.AllDirectories))
  {
    using (FileStream sin=File.Open(file, FileMode.Open, FileAccess.ReadWrite))
    {
      sin.Position=sin.Length-1;
      if (sin.ReadByte()==0x40)
      {
        Console.WriteLine("fixed "+file);
        sin.WriteByte(0xa);
      }
    }
  }
}
+3
source

In my case, a failure occurred in the symbolsfile section xxx,v. The expected format , but there have been cases:tag_name:tag_rev

  • :tag_rev, . tag_name
    .
  • tag_name, . tag_name1:tag_name2:tag_rev
    ( , , , ).
  • /. z ( ASCII : z). tag_nameztag_rev
    z :.

, print cvs2svn_rcsparse\common.py. , , , .

def _parse_admin_symbols(self, token):
while 1:
  tag_name = self.ts.get()
  # WileCau print the token and tag_name
  print 'token=|%s| tag_name=|%s|' % (token, tag_name)
  if tag_name == ';':
    break
  self.ts.match(':')
  tag_rev = self.ts.get()
  self.sink.define_tag(tag_name, tag_rev)

, , .


, , - . .

http://tigris-scm.10930.n7.nabble.com/suggestions-for-cvs2svn-fix-for-error-quot-myfile-txt-v-is-not-a-valid-v-file-quot-td54240.html

, , - xxx,v, 0x0A (LF) 0x0D/0x0A (CR/LF), .

+1

. cvs2git cvs git, . , 0x40 (@).

, :

1. Open the corrupted cvs-history-file e.g. with vim (maybe in binary mode)
2. Add the missing @

, RCS : rcs_man_page

0

One way to troubleshoot is to run rcs log *file,v*, which may give you some idea.

In my case, I had files missing @, some files were missing a semicolon, and the tool that I used to import my old repository to cvsperver was thrown into an unpublished version.

Good luck

0
source

All Articles