Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 07-22-2011, 02:06 PM   #1
Halo
Connoisseur
Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.
 
Halo's Avatar
 
Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
Question Workflow for making and submitting changes

What is the recommended workflow for creating and submitting changes to calibre? Last night I was surprised to see that changes in my branch on Launchpad were merged into calibre. I had not requested the merge and was still working on it. That's ok, but it made me wonder if I was doing something wrong and should be using a different process.

Here's my workflow:
  1. bzr branch lp:calibre. I only need to do this once, right?
  2. bzr push lp:~mp/calibre/mybranch to create my new working branch on Launchpad.
  3. bzr pull to keep my checkout up-to-date.
  4. bzr commit occasionally to save my work.
  5. Request a merge via Launchpad when I am satisfied that my changes are safe to include.

Is this right? I've only done up to #4 but my changes were merged. Should I use a different process? Things were fine now but I am worried about if I make GUI changes that are experimental and things break. I want to make things easy on everyone.

I have no experience with version control systems and, despite reading the bzr manual, I am barely understanding the concepts of branching, merging, etc. Feel free to explain things to me like I'm a three-year-old.
Halo is offline   Reply With Quote
Old 07-22-2011, 02:22 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,445
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use

bzr merge

in your branch to merge changes from trunk from time to time, rather than pull.

Use bzr commit

to save your work from time to time.

When your changes are ready, use

bzr push

to upload them to Launchpad and then create a merge request.
kovidgoyal is offline   Reply With Quote
Old 07-22-2011, 03:06 PM   #3
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,433
Karma: 950001
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Kovid doesn't merge changes unless you ask him to. That said mistakes can happen. In the rare event that a change is merged early it can always be reverted.

It is a good idea to only push working code to your branch. That doesn't mean you have to be finished with what your working on.
user_none is offline   Reply With Quote
Old 07-22-2011, 03:12 PM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
This is my basic workflow (except for 6), copied from chaley, and I've also copied his description of his workflow from my notes:

Quote:
I keep 2 sources locally. One is a copy of trunk called 'base', obtained with bzr pull. The other is my development branch.

All my branches use a shared repository. This makes pulls, pushes, and merging much faster.

Workflow:

1. pull changes from launchpad to 'base'
2. merge base into 'dev'
3. make changes, do work, etc
4. commit changes in dev. Often more than one commit.
5. check if new changes are in base. If so, repeat steps 1 and 2 to ensure that there are no change conflicts.
6. push changes from dev to my repository on launchpad. Kovid reviews and merges from there.

I have both base and dev so I can run from either to help debug, have rapid access to the change logs and diffs, and rarely to add print statements in the trunk code to help see what is going on. In the latter case, I revert the branch before pulling from launchpad.
In step 6. I haven't bothered to set up a launchpad repository, since I don't have time to do much extensive work. I've just created a diff file with:
bzr send -o "Automerge_Updates.txt"
and posted them to the buglist with a request to have them merged in.
Starson17 is offline   Reply With Quote
Old 07-23-2011, 12:36 PM   #5
Halo
Connoisseur
Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.Halo did not drink the Kool Aid.
 
Halo's Avatar
 
Posts: 96
Karma: 72130
Join Date: Nov 2008
Location: San Francisco Bay Area, CA, USA
Device: Sony PRS-505, Kindle DX 1st Gen, Kindle Fire 1st Gen
I will make sure I only push the branch to LP when it's ready for merging. That brings up another question. Should I use the same branch on LP for everything or should I create a new one for each feature I work on?
Halo is offline   Reply With Quote
Old 07-23-2011, 12:48 PM   #6
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,433
Karma: 950001
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Create a new branch for each thing you're working on concurrently. So if you have some basic changes you're working on, a store plugin and a new recipe and you're working on them all at the same time then use three different branches. This way you can request merges for the finished parts as they are ready.
user_none is offline   Reply With Quote
Old 07-24-2011, 05:42 AM   #7
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,057
Karma: 802238
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Halo View Post
I will make sure I only push the branch to LP when it's ready for merging. That brings up another question. Should I use the same branch on LP for everything or should I create a new one for each feature I work on?
I have 5 branches.
- base (the trunk, never changed)
- dev (where I normally work on things I intend to submit, has launchpad copy)
- store (for store plugins, has launchpad copy)
- temp (for small changes when I am in the middle of bigger ones in dev, has launchpad copy)
- test (for making experimental changes, no launchpad copy)
chaley is offline   Reply With Quote
Old 09-17-2011, 06:58 AM   #8
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 2,742
Karma: 2920103
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
What happens when I issue bzr commit command?

Hi.

I have been trying to merge changes from the main tree (maintained by Kovid) to my private copy of the source, which has a few changes that I have made.

I was told that all that I have to do is:

Get sources from net to my machine
bzr branch lp:calibre

Make my desired [tiny] changes (that are unlikely to be accepted to the mainline)

update my private tree from the net, keeping my changes, by
bzr merge

When I issue bzr merge command, I am told that:
bzr: ERROR: Working tree "/home/kacir/MyCalibre/calibre/" has uncommitted changes (See bzr status).


So what happens when I commit changes?
Are my changes pushed to the net (which is, obviously, NOT what I want)?
Are my private changes in my private copy of sources marked as "commited" (whatever that means) and bzr stops complaining?

I thought that I understand basic operation of bzr, and that commit pushes my changes to the net, but now I suspect, it is a bit more complicated.

By the way, bzr complained when I was trying to pull the initial state of source until I have set my name by
bzr whoami kacir from Mobileread <kacir@thisisnotmyemail.com>
command.
kacir is offline   Reply With Quote
Old 09-17-2011, 10:04 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,445
Karma: 4961459
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Commit will only commit your changes locally, unless you have used bzr bind to bind your branch to a remote one.
kovidgoyal is offline   Reply With Quote
Old 09-17-2011, 10:36 AM   #10
kacir
Wizard
kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.kacir ought to be getting tired of karma fortunes by now.
 
kacir's Avatar
 
Posts: 2,742
Karma: 2920103
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
Quote:
Originally Posted by kovidgoyal View Post
Commit will only commit your changes locally, unless you have used bzr bind to bind your branch to a remote one.
Thank you for clarification.

So. The steps that work for me on Linux are:
  1. Set your ID - bzr whoami John Smith <JSmith@thisisnotmyemail.com>
  2. Get sources from net to my machine - bzr branch lp:calibre (Issue command from inside your working directory, for example ~/src directory. The command will create ~/src/calibre directory and populate it (about 400 Mega Bytes of files) )
  3. Make desired small tweaks, such as replacement of splash screen, icons, little change in some *.py file
  4. Commit your changes - bzr commit (issue command in your private calibre development directory ~/src/calibre)
  5. Every week or so merge changes from the net, so your version of Calibre is still up-to-date - bzr merge (again issue command in your private calibre development directory)
  6. Repeat steps 3-5
kacir is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Submitting update to iBookstore JCarig Apple Devices 3 06-24-2011 04:55 AM
submitting a new ebook bobcdy Kindle Formats 30 12-10-2009 04:32 AM
Good blog for those interested in submitting work to publishers khalleron Writers' Corner 0 12-01-2009 07:36 PM
Opinion on workflow (and enhancing it) - research-type workflow TheDarkTrumpet Which one should I buy? 8 03-02-2009 10:41 AM


All times are GMT -4. The time now is 10:10 AM.


MobileRead.com is a privately owned, operated and funded community.