Jump to content

fast-import fails : "An item with the same key has already been added"


Cyber Sinh

Recommended Posts

Hi,

I'm trying to test plastic SCM by importing a git repository, through fast-import, but I get this error:

C:\Users\Cyber Sinh>cm fast-import Echosync "D:\Temporaire\Download\scm\git-repo\Luminescence.Xiph.fastimport"

An item with the same key has already been added.

reset refs/heads/master

commit refs/heads/master

mark :1

author xxxxxx <xxx@free.fr> 1217260939 +0000

committer xxxxxx <xxx@free.fr> 1217260939 +0000

data 1

commit refs/heads/master

mark :2

author xxxxxx <xxx@free.fr> 1217261026 +0000

committer xxxxxx <xxx@free.fr> 1217261026 +0000

data 15

from :1

Error: An item with the same key has already been added.

You will find attached the git repository with the fast-import file.

Everything is fine if I import the file with the git or veracity fast-import command.

Thanks for your help.

Best regards.

Cyber Sinh

git-repo.zip

Link to comment
Share on other sites

Hi Cyber Sihn,

let me check with our crazy build master if we can send you a patched release, I have it working:

Repository test does not exist. It will be created

Luminescence.Xiph\Luminescence.Xiph.fastimport correctly parsed. 65 commits. 149

8 ms

2.0.0.0

2.1.1.0

master

3 branches

0 modified files found refering to an SHA instead of a mark

241 modified files

01,6 Mb in blobs. 147 blobs

Link to comment
Share on other sites

Hi Manu,

The fast-import command doesn't crash with the new release. Thanks!

But the result of the command is not optimal for me:

1. Git tags are not converted to plastic label (so, missing labels and useless branches)

2. The root folder has been renamed from "Luminescence.Xiph" to "src" in Git, and plastic didn't take into account the move:

2.1 If I check the changeset history in repository, I only have the last commit (the "git mv" comment) -> all my history is lost !

2.2 If I checkout the master into workspace, plastic created me two folders: Luminescence.Xiph AND src

Do you know why and what can I do?

Thank you very much for your help.

Best regards.

Cyber Sinh

Link to comment
Share on other sites

1. Git tags are not converted to plastic label (so, missing labels and useless branches)

Can you post us the command line order you use for fast-exporting the git repository?

2.1 If I check the changeset history in repository, I only have the last commit (the "git mv" comment) -> all my history is lost !

Click in the advanced button and remove the time filter, by default only the last months changesets are shown..

2.2 If I checkout the master into workspace, plastic created me two folders: Luminescence.Xiph AND src

At the changeset #38 you have a "Move" operation from Git (at least it's written in the fast-export file) and the same move is in Plastic.

Link to comment
Share on other sites

Can you post us the command line order you use for fast-exporting the git repository?

Sure! I used this command:

git fast-export --all -C > my_repo.fastimport

I sent you the git repo, so you could test yourself.

Click in the advanced button and remove the time filter, by default only the last months changesets are shown..

Sorry, I'm a noob.

But I expected a filter like "last x commit" and not a date-based filter by default.

At the changeset #38 you have a "Move" operation from Git (at least it's written in the fast-export file) and the same move is in Plastic.

If plastic knows that it is a renamed folder, why does it create two folders? Try to checkout the repo in a workspace, and you could view my issue.

Thanks.

Link to comment
Share on other sites

Sure! I used this command:

git fast-export --all -C > my_repo.fastimport

I sent you the git repo, so you could test yourself.

Sure, I'll try to give it a try.

Sorry, I'm a noob.

But I expected a filter like "last x commit" and not a date-based filter by default.

Don't worry, it's a common mistake when you are importing repositories with relatively old changesets.

If plastic knows that it is a renamed folder, why does it create two folders? Try to checkout the repo in a workspace, and you could view my issue.

Thanks.

Actually It's not creating two directories, it's "preserving". Since Plastic can version directories the directories remains empty. You have all your content correctly moved to \src except the "Luminescence.Xiph\XiphTestProject\Test References\Luminescence.Xiph.accessor" item that for some reason remains under "\Luminescence.Xiph".

It's as easy as right click in "Luminescence.Xiph" -> Delete -> Commit.

Link to comment
Share on other sites

You have all your content correctly moved to \src except the "Luminescence.Xiph\XiphTestProject\Test References\Luminescence.Xiph.accessor" item that for some reason remains under "\Luminescence.Xiph".

It's as easy as right click in "Luminescence.Xiph" -> Delete -> Commit.

And for what reason "Luminescence.Xiph\XiphTestProject\Test References\Luminescence.Xiph.accessor" remains under "\Luminescence.Xiph"? Its root folder has been renamed though...

I'm waiting for your feedback concerning the label vs branch issue.

Thanks for your support.

Link to comment
Share on other sites

And for what reason "Luminescence.Xiph\XiphTestProject\Test References\Luminescence.Xiph.accessor" remains under "\Luminescence.Xiph"? Its root folder has been renamed though...

Sorry, I post it wrong, I have all the contents moved to src. Check it out:

post-112-0-09870200-1344937913_thumb.png

I'm waiting for your feedback concerning the label vs branch issue.

As you may know branches and tags (In git) are only ephemeral references to commits, they can be moved. And regarding branches that's how git actually works. Take a look to your repository in git:

post-112-0-19460400-1344938023_thumb.png

As you can see the graph is quite similar to the Plastic One, it seems you have been moving the tag reference along the commits, which is obviously not recommended. A tag/Label must be an static and immutable object. So there's no difference between your Git and you Plastic SCM repository (except the empty directories).

If you want to strat working with Plastic I do recommend you 2 things:

  1. Delete the empty directories structure.
  2. Label the last changesets of your "pseudo git tags"

Link to comment
Share on other sites

Hi,

The git repo comes from a git svn clone. I tried some cleanup to the repo: the "git branch -a" and "git tag" output is OK, but some additional work seems necessary for tags...

It's OK to simply delete the empty ghost folder, although I still don't understand why plastic created it in my workspace if it doesn't exist anymore.

Thank you very much for your help.

Link to comment
Share on other sites

I still don't understand why plastic created it in my workspace if it doesn't exist anymore.

I'll try to explain it.

Git is not able to manage directories, only files are under the Git control. So a delete order such us "D /foo" is never going to be included in a Git fast-export file. If you move a file from /foo to /bar, Plastic is going to create first the /foo directory (due to the add file order) and then it's going to create the /bar directory (due to the move operation) and the /foo directory will remain empty due to Plastic doesn't have the git instruction to remove it.

Thank you very much for your help.

You are welcome :)

Link to comment
Share on other sites

Ok manu.

I understand now.

It seems that veracity has found a workaround for that issue because if I checkout the master branch, veracity creates only a "src" folder (the same fast-import file has been used for creating the repo). A such workaround for plastic would be nice also.

Link to comment
Share on other sites

I keep going to cleanup my git repository. I checked with the GitExtensions: I only have one branch with two tags.

However, my imported repo in plastic has again imported the tags as branchs. I'm going to become crazy.

You will find attached the new git repository with the corresponding fast-import file. So, you could test yourself.

Thanks.

xiph2.zip

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...