Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the OldestStream option in configure file #20

Closed
chenzhiwei opened this issue May 20, 2015 · 6 comments
Closed

the OldestStream option in configure file #20

chenzhiwei opened this issue May 20, 2015 · 6 comments
Labels

Comments

@chenzhiwei
Copy link

Hi, thank you for you guide.

I am very confused, why there is an option OldestStream?

I want to migrate ALL history from a stream to git. Think about this case: The project only has one stream and all changesets are going to this stream.

So, in my understanding, the steps should be:

create a new git repo
list all changesets
loop the changesets in an order from old to new
    checkout the changeset at a time
    copy and commit to git repo
end loop

Thanks.

@WtfJoke
Copy link
Member

WtfJoke commented May 20, 2015

Hi Chen,

The option is needed for recreating the earliest state (including the optional initialbaseline entry in the config) of a workspace.

In your case it will be the same stream as streamtomigrate.
The steps you described roughly are correct. Whereas list is respresented by using by comparing the workspace with the stream (because simply listing all changesets doesnt work in the provided rtc cli api). Checkout is represented as accept of a changeset in this created workspace.

The way I thought this option is useful/should be used is following.
Assume you have different releases of your project and each release will be continued to develop. So in terms of RTC we have different Streams for that. So allthough you have different streams, they originally are based on the same project/history. And to recreate the oldest workspace you need to have the baselines from the earliest state. And an automatic way to get one of these oldest baseline is by reading the baseline of the oldest stream (if you need older baselines than that, you can specify the oldest baseline by set the initialbaseline).

If theres something else, or you didnt get my explaination, keep asking 😅

@WtfJoke
Copy link
Member

WtfJoke commented May 21, 2015

To explain it the same way, as you did.

The steps, how the program works, are:

  1. Create new git repo
  2. Create and load new rtc workspace (as old as possible - therefore with the least amount of history information given - for this step OldestStream and if given InitialBaselines from the config are needed)
  3. Create git branch named after the stream you migrate
  4. Determine changeset by comparing the workspace with the stream (list all missing changesets)
  5. Accept each changeset one by one and after accept each one, do the appropriate git command
  6. Push created git branch
  7. If more streams recreate oldest workspace as created in step 2. and continue

@chenzhiwei
Copy link
Author

@WtfJoke Thanks, it works. I used the steps below:

  1. Get the first snapshot on the stream.(we imported from CVS and create a snapshot after importing)
  2. Create a workspace use the fist snapshot.
  3. Load the workspace and initial a git repo with this workspace
  4. Get the last snapshot on the stream.
  5. Compare the workspace with last snapshot and get the changesets
  6. Loop the changesets and accept the changeset to workspace, then commit to git repo.
  7. Done.

@WtfJoke
Copy link
Member

WtfJoke commented May 26, 2015

Yeah, that's how it supposed to work :)

Were you able to migrate everything successful?

@chenzhiwei
Copy link
Author

Yes, I migrate all the changesets successfully. Thanks.

Besides, I encountered an issue, some of the changesets comment have line breaks, so iterate the file by line will not work. The better practice is iterate the file by every 5 items(uuid, comment, user, email, date).

Thanks again, we escaped from RTC to powerful GIT.

@WtfJoke
Copy link
Member

WtfJoke commented May 26, 2015

Glad to hear that 😄 I'm happy you were successful 🎈

I encountered an issue, some of the changesets comment have line breaks, so iterate the file by line will not work. The better practice is iterate the file by every 5 items(uuid, comment, user, email, date).

I'll open a new issue for that, thanks for reporting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants