bit of remote work

This commit is contained in:
Peter Cottle 2013-06-24 08:59:02 -07:00
parent 8a4f8baafb
commit af632eaa5e
6 changed files with 55 additions and 1142 deletions

View file

@ -7924,10 +7924,10 @@ GitEngine.prototype.push = function(options) {
// HAX HAX update o/master
chain = chain.then(_.bind(function() {
var localLocationID = localBranch.get('target').get('id');
var localCommit = this.refs[localLocationID];
// HAX HAX
this.setTargetLocation(this.refs['o/master'], localCommit);
var localCommit = this.getCommitFromRef(localBranch);
var remoteBranchID = localBranch.getRemoteBranchIDFromTracking();
// less hacks hax
this.setTargetLocation(this.refs[remoteBranchID], localCommit);
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
}, this));
@ -9278,9 +9278,23 @@ var Ref = Backbone.Model.extend({
var Branch = Ref.extend({
defaults: {
visBranch: null,
remoteTrackingBranch: null,
remote: false
},
getRemoteBranchIDFromTracking: function() {
if (this.getIsRemote()) {
throw new Error('I am a remote branch! dont try to get remote from me');
}
// TODO check if remote tracking also
return 'o/' + this.getRemoteTrackingBranchName();
},
getRemoteTrackingBranchName: function() {
var originBranchName = this.get('remoteTrackingBranch');
return (originBranchName) ? originBranchName : this.get('id');
},
getIsRemote: function() {
return this.get('remote');
},
@ -24075,10 +24089,10 @@ GitEngine.prototype.push = function(options) {
// HAX HAX update o/master
chain = chain.then(_.bind(function() {
var localLocationID = localBranch.get('target').get('id');
var localCommit = this.refs[localLocationID];
// HAX HAX
this.setTargetLocation(this.refs['o/master'], localCommit);
var localCommit = this.getCommitFromRef(localBranch);
var remoteBranchID = localBranch.getRemoteBranchIDFromTracking();
// less hacks hax
this.setTargetLocation(this.refs[remoteBranchID], localCommit);
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
}, this));
@ -25429,9 +25443,23 @@ var Ref = Backbone.Model.extend({
var Branch = Ref.extend({
defaults: {
visBranch: null,
remoteTrackingBranch: null,
remote: false
},
getRemoteBranchIDFromTracking: function() {
if (this.getIsRemote()) {
throw new Error('I am a remote branch! dont try to get remote from me');
}
// TODO check if remote tracking also
return 'o/' + this.getRemoteTrackingBranchName();
},
getRemoteTrackingBranchName: function() {
var originBranchName = this.get('remoteTrackingBranch');
return (originBranchName) ? originBranchName : this.get('id');
},
getIsRemote: function() {
return this.get('remote');
},

File diff suppressed because one or more lines are too long

1
build/bundle.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -427,7 +427,7 @@
For a much easier time perusing the source, see the individual files at:
https://github.com/pcottle/learnGitBranching
-->
<script src="build/bundle.min.8854fb9b.js"></script>
<script src="build/bundle.js"></script>
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
The downside? No raw logs to parse for analytics, so I have to include

View file

@ -879,10 +879,10 @@ GitEngine.prototype.push = function(options) {
// HAX HAX update o/master
chain = chain.then(_.bind(function() {
var localLocationID = localBranch.get('target').get('id');
var localCommit = this.refs[localLocationID];
// HAX HAX
this.setTargetLocation(this.refs['o/master'], localCommit);
var localCommit = this.getCommitFromRef(localBranch);
var remoteBranchID = localBranch.getRemoteBranchIDFromTracking();
// less hacks hax
this.setTargetLocation(this.refs[remoteBranchID], localCommit);
return AnimationFactory.playRefreshAnimation(this.gitVisuals);
}, this));
@ -2233,9 +2233,23 @@ var Ref = Backbone.Model.extend({
var Branch = Ref.extend({
defaults: {
visBranch: null,
remoteTrackingBranch: null,
remote: false
},
getRemoteBranchIDFromTracking: function() {
if (this.getIsRemote()) {
throw new Error('I am a remote branch! dont try to get remote from me');
}
// TODO check if remote tracking also
return 'o/' + this.getRemoteTrackingBranchName();
},
getRemoteTrackingBranchName: function() {
var originBranchName = this.get('remoteTrackingBranch');
return (originBranchName) ? originBranchName : this.get('id');
},
getIsRemote: function() {
return this.get('remote');
},