Permalink
Browse files

* Implemented 'ti sync'

The ticgit repository needs to be remote and tracked.
In the original repository do something like:
1) ti  # to create the ticgit branch
2) git push origin ticgit # to push it to remote
3) git branch -D ticgit
4) git checkout --track -b ticgit origin/ticgit
5) git checkout master # in my case is branch I usually work on
6) use ticgit normally and call 'ti sync' when you want to sync with the remote repository

When you colaborate you do something like:
1) git clone git://(...)  # clone the repository you want
2) git checkout --trac -b ticgit origin/ticgit
3) git checkout master # in my case is branch I usually work on
4) use ticgit normally and call 'ti sync' when you want to sync with the remote
repository
  • Loading branch information...
1 parent 646891f commit 7388386fab4fb12c36e6eeb7d19eaa4e4b16b853 @bmfs bmfs committed Mar 13, 2010
Showing with 5 additions and 23 deletions.
  1. +5 −23 lib/ticgit/base.rb
View
@@ -195,7 +195,7 @@ def ticket_recent(ticket_id = nil)
def ticket_revparse(ticket_id)
if ticket_id
ticket_id = ticket_id.strip
-
+
if /^[0-9]*$/ =~ ticket_id
if t = @last_tickets[ticket_id.to_i - 1]
return t
@@ -267,30 +267,12 @@ def tic_states
['open', 'resolved', 'invalid', 'hold']
end
- def sync_tickets
- #Dir.chdir "../tidyapp_bugs"
- bs = git.lib.branches_all.map{|b| b.first }
-
- #unless bs.include?('ticgit') && File.directory?(@tic_working)
- # init_ticgit_branch(bs.include?('ticgit'))
- #end
-
- puts "checking out ticgit"
- #in_branch(bs.include?('ticgit')) do
- #puts git.branch('ticgit').checkout()
- # puts git.pull('origin','origin/ticgit')
- #puts git.branch('master').checkout()
- #end
-
- in_branch(bs.include?('ticgit')) do
- #puts git.add('.')
- #puts git.commit('tickets update')
- puts git.pull('origin','origin/ticgit')
- puts git.push('origin','ticgit')
- puts
+ def sync_tickets
+ in_branch(false) do
+ git.pull('origin','origin/ticgit')
+ git.push('origin', 'ticgit:ticgit')
puts "Tickets synchronized."
end
-
end
def load_tickets

0 comments on commit 7388386

Please sign in to comment.