1
Vote

"hg archive: invalid arguments" error when ArchiveCommand.Revision property is not null

description

I'm using Mercurial.NET version 1.1 and I'm running into the following issue: Repository.Archive() method throws an exception if a revision is specified via the ArchiveCommand.Revision property. The exception message is: "hg archive: invalid arguments".

Please see the following code snippet:
        ArchiveCommand command = new ArchiveCommand() {
            Revision = new RevSpec(revision),
            ArchiveType = ArchiveType.ZipDeflateCompressed,
            Destination = Path.GetTempFileName()
        };

        Repository repository = new Repository(repositoryPath);
        repository.Archive(command);
It appears to be a bug in the ArchiveCommand.Revision property declaration: the NullableArgument attribute should have NonNullOption = "--rev" option.

comments

lassevk wrote Feb 18, 2013 at 3:46 PM

Thanks, I will look at that part of the code and figure out why it crashes. It should, as far as I can remember, be able to run correctly without that argument, using the current revision of the repository, but I'll look into it.

The project has unfortunately fallen a bit by the wayside for me, but I'm picking up development again these days so hopefully it won't take too long until I can release a new version.