Carsten Orthbandt
2004-01-18 00:01:26 UTC
Here's something I've been trying to solve for months now...
In office, I use our company perforce server for nearly everything.
But for private projects and at home, I use a p4s running locally
on my notebook. Now while there's nothing interesting on that notebook
that isn't automatically mirrored with our company infrastructure
(everything in MS Outlook hooked to an Exchange Server), I don't see
an easy way to do the same with my local P4 depots.
My notebook acts as a client to both p4 servers.
The easy way would be to apply the known "working disconnected"
techniques in a two-way fashion.
But: Of course I want all my changes on both depots to stay.
And I want full history. So when I sit at home and do 10 revisions
of a file, I'd like to mirror these 10 revisions into the company
server when I'm back at the office. And vice versa.
The task as I see it is actually a two-level challenge:
1st: Master the "private projects" part. This won't involve any
conflicts since I'd be the only one doing changes to a
project at any point in time. And I'd be doing these changes
on only one machine and get to sync the two before switching
workplaces.
2nd: Doing it reliably with multi-user projects. As far as I can
see, this involves merging multiple parallel changes. And as
I understand it, this might prove quite hard.
Example:
Private machine A Company machine B
file#10 file#10 - in sync
- leaving the office now
file#11b - some coworker doing changes
file#12b - some coworker doing more changes
file#11a - me doing changes at home
file#12a - and more
file#13a - I'm really in the mood
- coming back to the office
So what to do now?
Solution 1 I came up with is this:
- submit #11a-#12a to Company machine as #13b-#14b, ignoring the fact
that they aren't actually succeeding #12b, but #10
- submit #11b and #12b to A, creating #14a and #15a
- merge the two changes #10-13a and #10-12b, submit as #16a to A
and #15b _AND_ #16b to B, so I have the same rev numbers again
Actually, that's the wrong way around, since I'd have to do the last
submit to the company server first, to allow for further merging
if someone else did a #13b while I was trying to catch up.
Solution 2 is this:
- submit all A changes to B to get to same file history
- open a branch on B, client at A
- work disconnected
- come back
- iteratively submit all mobile changes to the branch on B
- merge branch with B main line
- "fake" revs on B unseen by A into B's history by submitting
them afterwards
- submit merged branch to A
- do dummy submit on one of the two to sync-up rev numbers if needed
This seems to be the cleaner way, but I think it would leave traces
in form of no-change branches everytime I leave if I don't do anything
at home. Plus AFAIK, I can't do branches on file I don't have in my
client view. So I'd either have to keep two copies on my notebook or
change the notebook's client spec automatically.
Solution 3 is the same as 2, but I could open the branch on A only
when I come back to the office and only if I actually changed
something.
I have no problem with one of the two P4 sites being the "master",
but somehow I hope there's some better solution. Any better ideas?
Bonus points for methods that don't have to lie on the timestamps
and change order. Bat as far as I can see, this would involve heavy
checkpoint surgery and scary changes to the RSC files.
Somehow I have the gut feeling of missing a mire obvious and elegant
solution to this...
Best regards,
Carsten Orthbandt
Founder + Development Director
SEK SpieleEntwicklungsKombinat GmbH
http://www.sek-ost.de
Wenn ich Visionen habe, gehe ich zum Arzt. - Helmut Schmidt
In office, I use our company perforce server for nearly everything.
But for private projects and at home, I use a p4s running locally
on my notebook. Now while there's nothing interesting on that notebook
that isn't automatically mirrored with our company infrastructure
(everything in MS Outlook hooked to an Exchange Server), I don't see
an easy way to do the same with my local P4 depots.
My notebook acts as a client to both p4 servers.
The easy way would be to apply the known "working disconnected"
techniques in a two-way fashion.
But: Of course I want all my changes on both depots to stay.
And I want full history. So when I sit at home and do 10 revisions
of a file, I'd like to mirror these 10 revisions into the company
server when I'm back at the office. And vice versa.
The task as I see it is actually a two-level challenge:
1st: Master the "private projects" part. This won't involve any
conflicts since I'd be the only one doing changes to a
project at any point in time. And I'd be doing these changes
on only one machine and get to sync the two before switching
workplaces.
2nd: Doing it reliably with multi-user projects. As far as I can
see, this involves merging multiple parallel changes. And as
I understand it, this might prove quite hard.
Example:
Private machine A Company machine B
file#10 file#10 - in sync
- leaving the office now
file#11b - some coworker doing changes
file#12b - some coworker doing more changes
file#11a - me doing changes at home
file#12a - and more
file#13a - I'm really in the mood
- coming back to the office
So what to do now?
Solution 1 I came up with is this:
- submit #11a-#12a to Company machine as #13b-#14b, ignoring the fact
that they aren't actually succeeding #12b, but #10
- submit #11b and #12b to A, creating #14a and #15a
- merge the two changes #10-13a and #10-12b, submit as #16a to A
and #15b _AND_ #16b to B, so I have the same rev numbers again
Actually, that's the wrong way around, since I'd have to do the last
submit to the company server first, to allow for further merging
if someone else did a #13b while I was trying to catch up.
Solution 2 is this:
- submit all A changes to B to get to same file history
- open a branch on B, client at A
- work disconnected
- come back
- iteratively submit all mobile changes to the branch on B
- merge branch with B main line
- "fake" revs on B unseen by A into B's history by submitting
them afterwards
- submit merged branch to A
- do dummy submit on one of the two to sync-up rev numbers if needed
This seems to be the cleaner way, but I think it would leave traces
in form of no-change branches everytime I leave if I don't do anything
at home. Plus AFAIK, I can't do branches on file I don't have in my
client view. So I'd either have to keep two copies on my notebook or
change the notebook's client spec automatically.
Solution 3 is the same as 2, but I could open the branch on A only
when I come back to the office and only if I actually changed
something.
I have no problem with one of the two P4 sites being the "master",
but somehow I hope there's some better solution. Any better ideas?
Bonus points for methods that don't have to lie on the timestamps
and change order. Bat as far as I can see, this would involve heavy
checkpoint surgery and scary changes to the RSC files.
Somehow I have the gut feeling of missing a mire obvious and elegant
solution to this...
Best regards,
Carsten Orthbandt
Founder + Development Director
SEK SpieleEntwicklungsKombinat GmbH
http://www.sek-ost.de
Wenn ich Visionen habe, gehe ich zum Arzt. - Helmut Schmidt