Merge lp:~barry/udd/docs into lp:udd

Proposed by Barry Warsaw
Status: Rejected
Rejected by: John A Meinel
Proposed branch: lp:~barry/udd/docs
Merge into: lp:udd
Diff against target: 1428 lines (+1360/-0)
13 files modified
.bzrignore (+1/-0)
docs/Makefile (+130/-0)
docs/conf.py (+216/-0)
docs/getting.rst (+102/-0)
docs/index.rst (+59/-0)
docs/latest.rst (+46/-0)
docs/merging.rst (+113/-0)
docs/newpackage.rst (+171/-0)
docs/patchsys.rst (+188/-0)
docs/setup.rst (+48/-0)
docs/sponsorship.rst (+110/-0)
docs/uploading.rst (+117/-0)
docs/working.rst (+59/-0)
To merge this branch: bzr merge lp:~barry/udd/docs
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+45932@code.launchpad.net

Description of the change

This converts the wiki documentation to a reStructuredText document. I got tired of editing the wiki. I have not yet added /usr/share/doc/bzr-builddeb/user_manual but I intend to do that once this branch lands and is published.

I'm not positive this is the best place for this, but I couldn't think of anything better. Also, we'll need a web server some place to throw this onto.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

Sorry for not reviewing this earlier. I think there is something wrong which is causing us to not see the review request. Maybe the default reviewer is set to something we don't see?

I didn't actually review the content, since I'm pretty sure what you wanted was just to have this included as rest docs.

I'm wondering if this is the best branch to have the documentation in. I suppose it is *a* branch which deals with this code. I might have said "udd-docs" or some other project, but in the short term, this seems fine. I'd rather have it available somewhere than nowhere.

Then we just need to figure out how to get this deployed so people can actually browse it.

Is it as simple as running "make" on Jubany and having the output in the right place for "package-import.ubuntu.com" to show it?

review: Approve
Revision history for this message
Barry Warsaw (barry) wrote :

On Jan 28, 2011, at 04:06 PM, John A Meinel wrote:

>I didn't actually review the content, since I'm pretty sure what you wanted
>was just to have this included as rest docs.

Yep. I want to get the documentation out of the wiki.

>I'm wondering if this is the best branch to have the documentation in. I
>suppose it is *a* branch which deals with this code. I might have said
>"udd-docs" or some other project, but in the short term, this seems fine. I'd
>rather have it available somewhere than nowhere.

I agree that this is not the best place for the docs. Since submitting this
mp, I've chatted with Daniel and I actually think it's better in the new
packaging guide he's putting together. I plan on moving the docs over to that
project (thankfully, also in reST :).

>Then we just need to figure out how to get this deployed so people can
>actually browse it.

I'm pretty sure Daniel is working on that for the packaging guide, so we
should get that for free once it's integrated there.

>Is it as simple as running "make" on Jubany and having the output in the
>right place for "package-import.ubuntu.com" to show it?

I have no idea! ;)

Revision history for this message
Max Bowsher (maxb) wrote :

Hi Barry,

Based on your earlier comment in this MP and recent email on the u-d-d mailing list, is it correct that these docs are now targeted at landing in lp:ubuntu-packaging-guide ?

If so, would it be accurate to mark this MP as superseded so that it no longer shows up on udd's +activereviews page?

Thanks,
Max.

Revision history for this message
Barry Warsaw (barry) wrote :

Hi Max. Yep, you're correct, and in fact they *have* landed in upg, so I'll close this merge proposal.

Revision history for this message
Barry Warsaw (barry) wrote :

Well, it doesn't look like I can. I can only set the mp status to WiP, Needs review, or Merged. I have abandoned the branch and invalid'd the bug, but I'll leave it up to you to dispose of this mp.

Unmerged revisions

389. By Barry Warsaw

new packages

388. By Barry Warsaw

Added patchsys

387. By Barry Warsaw

More wiki conversion

386. By Barry Warsaw

Latest

385. By Barry Warsaw

uploading.rst

384. By Barry Warsaw

More page conversions.

383. By Barry Warsaw

Convert getting.

382. By Barry Warsaw

Twiddle.

381. By Barry Warsaw

sphinx-quickstart

380. By Barry Warsaw

The start of some documentation.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2010-02-18 20:26:19 +0000
3+++ .bzrignore 2011-01-11 23:17:27 +0000
4@@ -1,1 +1,2 @@
5 ./tags
6+_build
7
8=== added directory 'docs'
9=== added file 'docs/Makefile'
10--- docs/Makefile 1970-01-01 00:00:00 +0000
11+++ docs/Makefile 2011-01-11 23:17:27 +0000
12@@ -0,0 +1,130 @@
13+# Makefile for Sphinx documentation
14+#
15+
16+# You can set these variables from the command line.
17+SPHINXOPTS =
18+SPHINXBUILD = sphinx-build
19+PAPER =
20+BUILDDIR = _build
21+
22+# Internal variables.
23+PAPEROPT_a4 = -D latex_paper_size=a4
24+PAPEROPT_letter = -D latex_paper_size=letter
25+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
26+
27+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
28+
29+help:
30+ @echo "Please use \`make <target>' where <target> is one of"
31+ @echo " html to make standalone HTML files"
32+ @echo " dirhtml to make HTML files named index.html in directories"
33+ @echo " singlehtml to make a single large HTML file"
34+ @echo " pickle to make pickle files"
35+ @echo " json to make JSON files"
36+ @echo " htmlhelp to make HTML files and a HTML help project"
37+ @echo " qthelp to make HTML files and a qthelp project"
38+ @echo " devhelp to make HTML files and a Devhelp project"
39+ @echo " epub to make an epub"
40+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
41+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
42+ @echo " text to make text files"
43+ @echo " man to make manual pages"
44+ @echo " changes to make an overview of all changed/added/deprecated items"
45+ @echo " linkcheck to check all external links for integrity"
46+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
47+
48+clean:
49+ -rm -rf $(BUILDDIR)/*
50+
51+html:
52+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
53+ @echo
54+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
55+
56+dirhtml:
57+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
58+ @echo
59+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
60+
61+singlehtml:
62+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
63+ @echo
64+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
65+
66+pickle:
67+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
68+ @echo
69+ @echo "Build finished; now you can process the pickle files."
70+
71+json:
72+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
73+ @echo
74+ @echo "Build finished; now you can process the JSON files."
75+
76+htmlhelp:
77+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
78+ @echo
79+ @echo "Build finished; now you can run HTML Help Workshop with the" \
80+ ".hhp project file in $(BUILDDIR)/htmlhelp."
81+
82+qthelp:
83+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
84+ @echo
85+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
86+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
87+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/udd.qhcp"
88+ @echo "To view the help file:"
89+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/udd.qhc"
90+
91+devhelp:
92+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
93+ @echo
94+ @echo "Build finished."
95+ @echo "To view the help file:"
96+ @echo "# mkdir -p $$HOME/.local/share/devhelp/udd"
97+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/udd"
98+ @echo "# devhelp"
99+
100+epub:
101+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
102+ @echo
103+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
104+
105+latex:
106+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
107+ @echo
108+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
109+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
110+ "(use \`make latexpdf' here to do that automatically)."
111+
112+latexpdf:
113+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
114+ @echo "Running LaTeX files through pdflatex..."
115+ make -C $(BUILDDIR)/latex all-pdf
116+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
117+
118+text:
119+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
120+ @echo
121+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
122+
123+man:
124+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
125+ @echo
126+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
127+
128+changes:
129+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
130+ @echo
131+ @echo "The overview file is in $(BUILDDIR)/changes."
132+
133+linkcheck:
134+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
135+ @echo
136+ @echo "Link check complete; look for any errors in the above output " \
137+ "or in $(BUILDDIR)/linkcheck/output.txt."
138+
139+doctest:
140+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
141+ @echo "Testing of doctests in the sources finished, look at the " \
142+ "results in $(BUILDDIR)/doctest/output.txt."
143
144=== added directory 'docs/_static'
145=== added directory 'docs/_templates'
146=== added file 'docs/conf.py'
147--- docs/conf.py 1970-01-01 00:00:00 +0000
148+++ docs/conf.py 2011-01-11 23:17:27 +0000
149@@ -0,0 +1,216 @@
150+# -*- coding: utf-8 -*-
151+#
152+# udd documentation build configuration file, created by
153+# sphinx-quickstart on Tue Jan 11 13:19:17 2011.
154+#
155+# This file is execfile()d with the current directory set to its containing dir.
156+#
157+# Note that not all possible configuration values are present in this
158+# autogenerated file.
159+#
160+# All configuration values have a default; values that are commented out
161+# serve to show the default.
162+
163+import sys, os
164+
165+# If extensions (or modules to document with autodoc) are in another directory,
166+# add these directories to sys.path here. If the directory is relative to the
167+# documentation root, use os.path.abspath to make it absolute, like shown here.
168+#sys.path.insert(0, os.path.abspath('.'))
169+
170+# -- General configuration -----------------------------------------------------
171+
172+# If your documentation needs a minimal Sphinx version, state it here.
173+#needs_sphinx = '1.0'
174+
175+# Add any Sphinx extension module names here, as strings. They can be extensions
176+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
177+extensions = []
178+
179+# Add any paths that contain templates here, relative to this directory.
180+templates_path = ['_templates']
181+
182+# The suffix of source filenames.
183+source_suffix = '.rst'
184+
185+# The encoding of source files.
186+#source_encoding = 'utf-8-sig'
187+
188+# The master toctree document.
189+master_doc = 'index'
190+
191+# General information about the project.
192+project = u'udd'
193+copyright = u'2011, Barry Warsaw'
194+
195+# The version info for the project you're documenting, acts as replacement for
196+# |version| and |release|, also used in various other places throughout the
197+# built documents.
198+#
199+# The short X.Y version.
200+version = '1.0'
201+# The full version, including alpha/beta/rc tags.
202+release = '1.0'
203+
204+# The language for content autogenerated by Sphinx. Refer to documentation
205+# for a list of supported languages.
206+#language = None
207+
208+# There are two options for replacing |today|: either, you set today to some
209+# non-false value, then it is used:
210+#today = ''
211+# Else, today_fmt is used as the format for a strftime call.
212+#today_fmt = '%B %d, %Y'
213+
214+# List of patterns, relative to source directory, that match files and
215+# directories to ignore when looking for source files.
216+exclude_patterns = ['_build']
217+
218+# The reST default role (used for this markup: `text`) to use for all documents.
219+#default_role = None
220+
221+# If true, '()' will be appended to :func: etc. cross-reference text.
222+#add_function_parentheses = True
223+
224+# If true, the current module name will be prepended to all description
225+# unit titles (such as .. function::).
226+#add_module_names = True
227+
228+# If true, sectionauthor and moduleauthor directives will be shown in the
229+# output. They are ignored by default.
230+#show_authors = False
231+
232+# The name of the Pygments (syntax highlighting) style to use.
233+pygments_style = 'sphinx'
234+
235+# A list of ignored prefixes for module index sorting.
236+#modindex_common_prefix = []
237+
238+
239+# -- Options for HTML output ---------------------------------------------------
240+
241+# The theme to use for HTML and HTML Help pages. See the documentation for
242+# a list of builtin themes.
243+html_theme = 'default'
244+
245+# Theme options are theme-specific and customize the look and feel of a theme
246+# further. For a list of options available for each theme, see the
247+# documentation.
248+#html_theme_options = {}
249+
250+# Add any paths that contain custom themes here, relative to this directory.
251+#html_theme_path = []
252+
253+# The name for this set of Sphinx documents. If None, it defaults to
254+# "<project> v<release> documentation".
255+#html_title = None
256+
257+# A shorter title for the navigation bar. Default is the same as html_title.
258+#html_short_title = None
259+
260+# The name of an image file (relative to this directory) to place at the top
261+# of the sidebar.
262+#html_logo = None
263+
264+# The name of an image file (within the static path) to use as favicon of the
265+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
266+# pixels large.
267+#html_favicon = None
268+
269+# Add any paths that contain custom static files (such as style sheets) here,
270+# relative to this directory. They are copied after the builtin static files,
271+# so a file named "default.css" will overwrite the builtin "default.css".
272+html_static_path = ['_static']
273+
274+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
275+# using the given strftime format.
276+#html_last_updated_fmt = '%b %d, %Y'
277+
278+# If true, SmartyPants will be used to convert quotes and dashes to
279+# typographically correct entities.
280+#html_use_smartypants = True
281+
282+# Custom sidebar templates, maps document names to template names.
283+#html_sidebars = {}
284+
285+# Additional templates that should be rendered to pages, maps page names to
286+# template names.
287+#html_additional_pages = {}
288+
289+# If false, no module index is generated.
290+#html_domain_indices = True
291+
292+# If false, no index is generated.
293+#html_use_index = True
294+
295+# If true, the index is split into individual pages for each letter.
296+#html_split_index = False
297+
298+# If true, links to the reST sources are added to the pages.
299+#html_show_sourcelink = True
300+
301+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
302+#html_show_sphinx = True
303+
304+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
305+#html_show_copyright = True
306+
307+# If true, an OpenSearch description file will be output, and all pages will
308+# contain a <link> tag referring to it. The value of this option must be the
309+# base URL from which the finished HTML is served.
310+#html_use_opensearch = ''
311+
312+# This is the file name suffix for HTML files (e.g. ".xhtml").
313+#html_file_suffix = None
314+
315+# Output file base name for HTML help builder.
316+htmlhelp_basename = 'udddoc'
317+
318+
319+# -- Options for LaTeX output --------------------------------------------------
320+
321+# The paper size ('letter' or 'a4').
322+#latex_paper_size = 'letter'
323+
324+# The font size ('10pt', '11pt' or '12pt').
325+#latex_font_size = '10pt'
326+
327+# Grouping the document tree into LaTeX files. List of tuples
328+# (source start file, target name, title, author, documentclass [howto/manual]).
329+latex_documents = [
330+ ('index', 'udd.tex', u'udd Documentation',
331+ u'Barry Warsaw', 'manual'),
332+]
333+
334+# The name of an image file (relative to this directory) to place at the top of
335+# the title page.
336+#latex_logo = None
337+
338+# For "manual" documents, if this is true, then toplevel headings are parts,
339+# not chapters.
340+#latex_use_parts = False
341+
342+# If true, show page references after internal links.
343+#latex_show_pagerefs = False
344+
345+# If true, show URL addresses after external links.
346+#latex_show_urls = False
347+
348+# Additional stuff for the LaTeX preamble.
349+#latex_preamble = ''
350+
351+# Documents to append as an appendix to all manuals.
352+#latex_appendices = []
353+
354+# If false, no module index is generated.
355+#latex_domain_indices = True
356+
357+
358+# -- Options for manual page output --------------------------------------------
359+
360+# One entry per manual page. List of tuples
361+# (source start file, name, description, authors, manual section).
362+man_pages = [
363+ ('index', 'udd', u'udd Documentation',
364+ [u'Barry Warsaw'], 1)
365+]
366
367=== added file 'docs/getting.rst'
368--- docs/getting.rst 1970-01-01 00:00:00 +0000
369+++ docs/getting.rst 2011-01-11 23:17:27 +0000
370@@ -0,0 +1,102 @@
371+==================
372+Getting the source
373+==================
374+
375+Every source package in Ubuntu has an associated source branch on Launchpad.
376+These source branches are updated automatically by Launchpad, however if you
377+notice any version skew (e.g. version 1.7 is available as a source package but
378+only 1.5 as a source branch), see the `importer status page`_ for possible
379+failures.
380+
381+If your source package is not yet available in Ubuntu, but it is available in
382+Debian, see below for importing the Debian source package into a local Bazaar
383+branch.
384+
385+Either way, if you want to work on a source package in bzr then you should
386+create a shared repository on your machine in order to make future operations
387+more efficient. Once you have that then you can checkout branches in to it.
388+
389+There are a couple of things that we do first in order to make things more
390+efficient later. Once you are used to the process you will learn when it makes
391+sense to skip these steps.
392+
393+
394+Creating a shared repository
395+============================
396+
397+Say we want to work on the `foobar` source package. We first create a shared
398+repository to hold our branches for this package.
399+
400+We do this using the `bzr init-repo` command, passing it the directory name we
401+would like to use::
402+
403+ $ bzr init-repo foobar
404+
405+You will see that a `foobar` directory is created in your current working
406+area. Now we need to change to this new directory for the rest of our work::
407+
408+ $ cd foobar
409+
410+
411+Getting the trunk branch
412+========================
413+
414+We use the `bzr branch` command to create a local branch of the package, and
415+the `ubuntu:` directory service (URL prefix) so that we can specify a shorter
416+URL::
417+
418+ $ bzr branch ubuntu:foobar
419+
420+You will need at least bzr 2.3 to utilize the `ubuntu:` prefix, otherwise
421+you'll use the `lp:` prefix for slightly longer URLs::
422+
423+ $ bzr branch lp:ubuntu/foobar
424+
425+This will create a branch in the new `foobar` directory. It will contain the
426+contents of the source package for the current Ubuntu development release
427+(also called a *distroseries*). If you prefer to name the resulting directory
428+after the current distroseries, do something like::
429+
430+ $ bzr branch ubuntu:foobar natty
431+
432+This puts the branch for the `foobar` package in Natty_ into the `natty`
433+directory.
434+
435+
436+Getting a branch for a particular release
437+=========================================
438+
439+When you want to do something like a `stable release update`_ (SRU), or you
440+just want to examine the code in an old release, you may want to grab the
441+branch corresponding to a particular pocket in a particular Ubuntu release.
442+All package versions in all distroseries are exposed on Launchpad and
443+available through both the `ubuntu:` and `lp:` directory services. For
444+example, to get the `foobar` package for Maverick *one* of the following:
445+
446+ $ bzr branch ubuntu:m/foobar maverick
447+ $ bzr branch ubuntu:maverick/foobar maverick
448+ $ bzr branch lp:ubuntu/maverick/foobar maverick
449+
450+
451+Importing a Debian source package
452+=================================
453+
454+If the package you want to work on is available in Debian but not Ubuntu, it's
455+still easy to import the code to a local bzr branch for development. Let's
456+say you want to import the `newpackage` source package. We'll start by
457+creating a shared repository as normal, but we also have to create a working
458+tree to which the source package will be imported::
459+
460+ $ bzr init-repo newpackage
461+ $ cd new-package
462+ $ bzr init debian
463+ $ cd debian
464+ $ bzr import-dsc http://ftp.de.debian.org/debian/pool/main/n/newpackage/newpackage_1.0-1.dsc
465+
466+As you can see, we just need to provide the remote location of the dsc file,
467+and bzr will do the rest. You've now got a bzr source branch.
468+
469+.. _`importer status page`: http://package-import.ubuntu.com/status
470+.. _Natty: https://wiki.ubuntu.com/NattyNarwhal
471+.. _`stable release update`: https://wiki.ubuntu.com/StableReleaseUpdates
472+.. _Maverick: https://wiki.ubuntu.com/MaverickMeerkat
473
474=== added file 'docs/index.rst'
475--- docs/index.rst 1970-01-01 00:00:00 +0000
476+++ docs/index.rst 2011-01-11 23:17:27 +0000
477@@ -0,0 +1,59 @@
478+==============================
479+Ubuntu Distributed Development
480+==============================
481+
482+*Ubuntu Distributed Development* (UDD) is a technique for developing Ubuntu
483+ packages that uses tools, processes, and workflows similar to generic
484+ distributed version control system-based software development. The dVCS used
485+ for UDD is Bazaar_.
486+
487+UDD is an ongoing effort. This means that some things will not yet be
488+documented, and some things that are documented will not yet work. Volunteers
489+to help move this forward are of course, welcome.
490+
491+This document contains a series of task-oriented guides for helping you with
492+common tasks. Intrepid_ or later is currently required for these instructions
493+to work.
494+
495+
496+Related information
497+===================
498+
499+The UDD project has a `presence on the Ubuntu wiki`_ which contains a
500+(probably out-of-sync) copy of this documentation, links to the bug tracker
501+and `project page on Launchpad`_, as well as links and minutes of public
502+meetings.
503+
504+Once the relevant packages are installed, you might also find useful
505+information in `/usr/share/doc/bzr-builddeb/usr_manual/`.
506+
507+
508+Table of Contents
509+=================
510+
511+.. toctree::
512+ :glob:
513+
514+ setup
515+ getting
516+ working
517+ sponsorship
518+ uploading
519+ latest
520+ merging
521+ patchsys
522+ newpackage
523+
524+
525+Indices and tables
526+==================
527+
528+* :ref:`genindex`
529+* :ref:`modindex`
530+* :ref:`search`
531+
532+
533+.. _`Bazaar`: http://bazaar.canonical.com/en/
534+.. _`Intrepid`: https://wiki.ubuntu.com/IntrepidIbex
535+.. _`presence on the Ubuntu wiki`: https://wiki.ubuntu.com/DistributedDevelopment
536+.. _`project page on Launchpad`: http://launchpad.net/udd
537
538=== added file 'docs/latest.rst'
539--- docs/latest.rst 1970-01-01 00:00:00 +0000
540+++ docs/latest.rst 2011-01-11 23:17:27 +0000
541@@ -0,0 +1,46 @@
542+==================
543+Getting The Latest
544+==================
545+
546+If someone else has landed changes on a package, you will want to pull down
547+those changes in your own copies of the package branches.
548+
549+
550+Updating your main branch
551+=========================
552+
553+Updating your copy of a branch that corresponds to the package in a particular
554+release is very simple, simply use `bzr pull` from the appropriate directory::
555+
556+ $ cd foobar/natty
557+ $ bzr pull
558+
559+This works wherever you have a checkout of a branch, so it will work for
560+things like branches of `maverick`, `hardy-proposed`, etc.
561+
562+
563+Getting the latest in to your working branches
564+==============================================
565+
566+Once you have updated your copy of a distroseries branch, then you may want to
567+merge this in to your working branches as well, so that they are based on the
568+latest code.
569+
570+You don't have to do this all the time though. You can work on slightly older
571+code with no problems. The disadvantage would come if you were working on
572+some code that someone else changed. If you are not working on the latest
573+version then your changes may not be correct, and may even produce conflicts.
574+
575+The merge does have to be done at some point though. The longer it is left,
576+the harder may be, so doing it regularly should keep each merge simple. Even
577+if there are many merges the total effort would hopefully be less.
578+
579+To merge the changes you just need to use `bzr merge-package`, but you must
580+have committed your current work first.
581+
582+ $ cd foobar/bug-12345
583+ $ bzr merge-package ../natty
584+
585+Any conflicts will be reported, and you can fix them up. To review the
586+changes that you just merged use `bzr diff`. To undo the merge use `bzr
587+revert`. Once you are happy with the changes then use `bzr commit`.
588
589=== added file 'docs/merging.rst'
590--- docs/merging.rst 1970-01-01 00:00:00 +0000
591+++ docs/merging.rst 2011-01-11 23:17:27 +0000
592@@ -0,0 +1,113 @@
593+=======
594+Merging
595+=======
596+
597+Merging is one of the strengths of Bazaar, and something we do often in Ubuntu
598+development. Updates can be merged from Debian, from a new upstream release,
599+and from other Ubuntu developers.
600+
601+Doing it in bzr is pretty simple, and all based around the `bzr merge-package`
602+command.
603+
604+The first thing to do is to check that the `package importer`_ hasn't failed
605+for the package you're going to work on.
606+
607+When you are in any branch's working directory then you can merge from
608+another. First check you have no uncommitted changes::
609+
610+ $ bzr status
611+
612+If that reports anything then you will either have to commit the changes,
613+revert them, or shelve them to come back to later.
614+
615+
616+Merging from Debian
617+===================
618+
619+Next run `bzr merge-package` passing the URI of the branch to merge from. For
620+instance, to merge from the version of the package in Debian Squeeze_ run::
621+
622+ $ bzr merge-package lp:debian/squeeze/foobar
623+
624+This will merge the changes since the last merge point and leave you with
625+changes to review. This may cause some conflicts. You can see all that
626+happened by running::
627+
628+ $ bzr status
629+ $ bzr diff
630+
631+If conflicts are reported then you need to edit those files to make them look
632+how they should, removing the *conflict markers*. Once you have done, run::
633+
634+ $ bzr resolve
635+ $ bzr conflicts
636+
637+This will resolve any conflicted files that you fixed, and then tell you what
638+else you have to deal with.
639+
640+Once any conflicts are resolved, and you have made any other changes that you
641+need, you will add a new changelog entry, and commit::
642+
643+ $ dch -i
644+ $ bzr commit
645+
646+as described earlier.
647+
648+However, before you commit, it is always a good thing to check all the Ubuntu
649+changes by running::
650+
651+ $ bzr diff -r tag:0.6.10-5
652+
653+which will show the diff between the new Debian (0.6.10-5) and Ubuntu versions
654+(0.6.10-5ubuntu1). In similar way you can compare to any other versions. To
655+see all available version run::
656+
657+ $ bzr tags
658+
659+After testing and committing the merge, you will need to seek sponsorship or
660+upload to the archive in the normal way.
661+
662+
663+Merging a new upstream version
664+==============================
665+
666+When upstream releases a new version (or you want to package a snapshot) then
667+you have to merge a tarball into your branch.
668+
669+This is done using the `bzr merge-upstream` command. From inside the branch
670+that you want to merge to you run something like::
671+
672+ $ bzr merge-upstream --version 1.2 http://example.org/releases/foobar-1.2.tar.gz
673+
674+This will download that tarball and merge it in to your branch, automatically
675+adding a `debian/changelog` entry for you.
676+
677+The `--version` option is used to specify the upstream version that is being
678+merged in, as the command isn't able to infer that yet.
679+
680+The last parameter is the location of the tarball that you are upgrading to;
681+this can either be a local filesystem path, or a http, ftp, sftp, etc. URI as
682+shown. The command will automatically download the tarball for you. If you
683+point to a `.tar.bz2` or similar tarball then it will recompress it as needed,
684+or convert it if you pass it a `.zip` or similar. If your package is v3
685+(quilt) format and so can support `.tar.bz2` upstream tarballs then pass a
686+`--v3` option to prevent the repacking (this should be `automatically
687+detected`_).
688+
689+The `merge-upstream` command will either tell you that it completed
690+successfully, or that there were conflicts. Either way you will be able to
691+review the changes before committing as normal.
692+
693+If you are merging an upstream release into an existing bzr branch that has
694+not previously used the UDD layout, `bzr merge-upstream` will fail with an
695+error that the tag for the previous upstream version is not available; the
696+merge can't be completed without knowing what base version to merge against.
697+To work around this, create a tag in your existing existing repo for the last
698+upstream version present there; e.g., if the last Ubuntu release was
699+*1.1-0ubuntu3*, create the tag *upstream-1.1* pointing to the bzr revision you
700+want to use as the tip of the upstream branch.
701+
702+
703+.. _`package importer`: http://package-import.ubuntu.com/status/
704+.. _Squeeze: http://wiki.debian.org/DebianSqueeze
705+.. _`automatically detected`: https://bugs.edge.launchpad.net/bzr-builddeb/+bug/627718
706
707=== added file 'docs/newpackage.rst'
708--- docs/newpackage.rst 1970-01-01 00:00:00 +0000
709+++ docs/newpackage.rst 2011-01-11 23:17:27 +0000
710@@ -0,0 +1,171 @@
711+======================
712+Building a new package
713+======================
714+
715+Let's say I have an upstream project that is not yet available for Ubuntu. I
716+want to create a package from this project and make it available as a PPA_ so
717+that other people can more easily use the code. This also makes a good first
718+step in contributing your package to universe_.
719+
720+
721+Example package
722+===============
723+
724+I started with a Python library called `flufl.enum`_, which is a fairly
725+typical setuptools-based Python package. Fortunately, it's also maintained in
726+Launchpad using Bazaar, so that makes bootstrapping much easier. (TBD: add
727+instructions for using other upstream VCSs.)
728+
729+Because we want to package the trunk branch, getting started is pretty
730+simple::
731+
732+ $ bzr init-repo flufl.enum
733+ $ cd flufl.enum
734+ $ bzr branch lp:flufl.enum trunk
735+ $ bzr branch trunk debianize
736+ $ cd debianize
737+
738+
739+Bootstrapping
740+=============
741+
742+You need to get the initial ``debian`` directory created somehow, along with
743+all the expected files inside that. There are many ways to bootstrap that,
744+and hopefully there will eventually be `some convergence`_ in the methods,
745+especially if you're building standard Python setuptools-based libraries and
746+applications.
747+
748+
749+The bzr-builddeb way
750+--------------------
751+
752+You could of course just use `dh_make(8)` to get things going, or you could
753+use `bzr dh-make`. The latter might provide some benefits, and can be run
754+like so from inside your branch::
755+
756+ $ bzr dh-make PKGNAME VERSION DOWNLOADURL
757+ $ bzr add debian
758+
759+If you don't have a URL to download a tarball from, you'll need to create the
760+tarball locally first. Use ``bzr dh-make --help`` for details on this command.
761+
762+After you've created the ``debian`` directory template, be sure to ``bzr rm``
763+any ``debian`` files you don't need (e.g. the ``*.ex`` files), and edit files
764+such as ``debian/control``, ``debian/watch``, ``debian/copyright`` and
765+``debian/changelog``. The following section may give you some hints about
766+that.
767+
768+
769+The stdeb way
770+-------------
771+
772+Another way I've found useful for initializing the ``debian`` directory for
773+Python setuptools-based packages, is to use the stdeb_ package. The full
774+documentation for this package is available on the `upstream home`_, but you
775+won't need all of the commands. stdeb has a command that is *exactly* what
776+we're looking for!
777+
778+In either case, start by putting this in your ``~/.pydistutils.cfg`` file::
779+
780+ [global]
781+ command.packages:stdeb.command
782+
783+
784+Modern stdeb
785+~~~~~~~~~~~~
786+
787+Here's how easy it is::
788+
789+ $ python setup.py debianize
790+ $ bzr add debian
791+ $ bzr commit -m'Debianize'
792+
793+
794+We also need a ``debian/copyright`` file. Normally, we'd use ``dh_make -c``
795+for that but again, that doesn't play nicely with UDD. ``dh_make`` expects a
796+particular file system layout that we don't have. No matter, we'll add the
797+copyright file manually::
798+
799+ $ cp /usr/share/debhelper/dh_make/licenses/lgpl3 debian/copyright
800+ $ edit debian/copyright
801+ $ bzr add debian/copyright
802+ $ bzr commit -m'Added copyright file'
803+
804+
805+stdeb <= 0.5.1
806+~~~~~~~~~~~~~~
807+
808+If you have an older version of stdeb, use this command to create the basic
809+``debian/`` directory layout::
810+
811+ $ python setup.py sdist_dsc
812+
813+This command leaves you with a ``deb_dist`` directory containing a
814+``flufl.enum_3.0.1`` directory. Inside that is your ``debian/`` directory.
815+Because we're using UDD we don't care about anything else that ``sdist_dsc``
816+produces, so we can shuffle things around and remove the cruft.
817+
818+ $ mv deb_dist/munepy-2.0.1/debian .
819+ $ rm -rf deb_dist
820+ $ bzr add debian
821+ $ bzr commit -m'Add debian directory'
822+
823+
824+pkgme
825+-----
826+
827+pkgme_ is a new tool that makes it easy to Debianize a new package. TBD:
828+describe how to use it.
829+
830+
831+debian/control file
832+===================
833+
834+You probably want to edit the ``debian/control`` file at this point, adding
835+any information that's missing, or fixing incorrect default information. For
836+example, I needed to modify the ``Maintainer`` and ``Description`` fields, and
837+add ``XS-Python-Version`` and ``Homepage`` fields.
838+
839+Now we want to build the source package. The easiest way to do that is with
840+the ``bzr-builddeb`` plugin, however this requires a valid ``debian/watch``
841+file so that builddeb can find the upstream tarball. This really should match
842+the version of the checkout you've made.
843+
844+
845+debian/watch file
846+=================
847+
848+Here for example is the ``debian/watch`` file I'm using::
849+
850+ version=3
851+ http://pypi.python.org/packages/source/f/flufl.enum/flufl.enum-(.*).tar.gz
852+
853+If your tarballs live on Launchpad, the ``debian/watch`` file is a little more
854+complicated (see `Question 21146`_ and `Bug 231797`_ for why this is). In
855+that case, use something like::
856+
857+ version=3
858+ https://launchpad.net/flufl.enum/+download http://launchpad.net/flufl.enum/.*/flufl.enum-(.+).tar.gz
859+
860+So, then it's a matter of...::
861+
862+ $ bzr add debian/watch
863+ $ bzr commit -m'added debian/watch file'
864+
865+
866+Building the source package
867+===========================
868+
869+Now we can build the source package and publish the package as we normally
870+would, with ``bzr bd -S`` and ``dput``.
871+
872+
873+.. _PPA: https://help.launchpad.net/Packaging/PPA
874+.. _universe: https://wiki.ubuntu.com/MOTU/GettingStarted
875+.. _`flufl.enum`: http://launchpad.net/flufl.enum
876+.. _`some convergence`: http://launchpad.net/bugs/545361
877+.. _stdeb: http://packages.ubuntu.com/lucid/python-stdeb
878+.. _`upstream home`: http://github.com/astraw/stdeb#the-commands
879+.. _pkgme: https://launchpad.net/pkgme
880+.. _`Question 21146`: https://answers.launchpad.net/launchpad/+question/21146
881+.. _`Bug 231797`: https://launchpad.net/bugs/231797
882
883=== added file 'docs/patchsys.rst'
884--- docs/patchsys.rst 1970-01-01 00:00:00 +0000
885+++ docs/patchsys.rst 2011-01-11 23:17:27 +0000
886@@ -0,0 +1,188 @@
887+===========================
888+Working with a patch system
889+===========================
890+
891+Many existing packages that have changes from upstream express those changes
892+using a `patch system`_, of which there are several to choose from. Usually,
893+when you make an additional change to a package, you'll want to add a patch
894+file to the patch system being used, rather than editing the source code in
895+place. Note however that it is considered bad practice to add a patch system
896+to a package that does not already have one. In that case, either coordinate
897+with the Debian maintainer, or edit the files in place. You can find out if
898+your package has a patch system by using the ``what-patch`` command (from the
899+``ubuntu-dev-tools`` package).
900+
901+Although UDD, and in particular `Bazaar looms`_ makes it pretty easy to keep
902+individual patches separated, if you're submitting changes to be uploaded,
903+you're currently better off playing along with the package's patch system.
904+*You will want at least bzr loom version 2.2.1dev, otherwise you'll have
905+problems pushing and pulling your threads to Launchpad.* Do ``bzr plugins`` to
906+find the version you're using.
907+
908+Here are some guidelines that I've found helpful. Clearly the existing tools
909+can be improved, but for now this seems to work well enough. This assumes
910+you're using looms to develop your patch, and that the package itself uses the
911+quilt_ patch system.
912+
913+One important thing to know: all source branches reflect the tree after a
914+``quilt push -a``. In other words, when you branch a source branch, you get
915+the tree with all patches applied, ready for you to jump right into hacking.
916+You do not need to ``quilt push -a`` manually, and in fact, you'll get a tree
917+with lots of distracting modifications if you push or pop all the changes. Or
918+to put it another way, once you have a branch, jump right in!
919+
920+
921+Develop your patch
922+==================
923+
924+Start as you normally would with UDD and looms::
925+
926+ $ bzr init-repo foobar
927+ $ cd foobar
928+ $ bzr branch ubuntu:foobar (or lp:ubuntu/foobar)
929+ $ bzr branch foobar myfix
930+ $ cd myfix
931+ $ bzr loomify --base trunk
932+ $ bzr create-thread sourcefix
933+
934+Now that you are in the ``sourcefix`` thread, just edit the source code,
935+making whatever changes you need to fix the bug. Don't worry about the patch
936+system at this point, at least until you are happy with your changes. If
937+someone else pushes changes to the package while you're working on it, just
938+``bzr down-thread`` to ``trunk``, pull the updates, and ``bzr up-thread
939+--auto`` back to the ``sourcefix`` thread, resolving any conflicts along the
940+way. You can periodically commit your changes, ``bzr record`` and push them
941+to Launchpad as you go, of course linking your branch to the bug in Launchpad.
942+So far, it's just normal development with looms.
943+
944+Once you're happy with your changes, you need to essentially import your
945+thread's changes into a quilt patch. This is fairly easy to do::
946+
947+ $ bzr create-thread quiltfix
948+ $ bzr diff -rthread:trunk..thread:sourcefix | quilt import -p0 -P myfix /dev/stdin
949+ $ bzr add debian/patches/myfix
950+ $ quilt push
951+ $ quilt pop
952+ $ bzr commit
953+
954+Why the last push/pop before the commit? The push gets the imported changes
955+into the quilt patch, but also leaves the tree modified, so you'll essentially
956+have the changes both in the ``debian/`` directory and in the tree. The pop
957+undoes the tree changes (which are also available in the ``sourcefix``
958+thread), but leaves the quilt change available. A ``bzr commit`` at this
959+point gives you a thread with just the changes to ``debian/``.
960+
961+
962+Problems
963+========
964+
965+The problem comes when you want to modify the patch, e.g.::
966+
967+ $ bzr down-thread
968+ <hack, commit>
969+
970+This does *not* work well::
971+
972+ $ bzr up-thread
973+
974+You'd expect at this point to be able to ``quilt fold`` your new changes to
975+update your ``myfix`` quilt patch, but in fact, this doesn't work. You can
976+end up with difficult to resolve conflicts, patch failures and rejections. My
977+recommendation is that when you make changes to your ``sourcefix`` thread,
978+blow away your ``quiltfix`` thread and regenerate it. Looms make this easy::
979+
980+ $ bzr up-thread
981+ $ bzr revert
982+ $ bzr combine-thread --force (throws away your quiltfix changes)
983+ $ bzr create-thread quiltfix
984+ $ bzr diff -rthread:trunk..thread:sourcefix | quilt import -p0 -P myfix /dev/stdin
985+ etc...
986+
987+So you've thrown away the ``quiltfix`` thread, and recreated it, with your
988+updated ``sourcefix`` changes.
989+
990+
991+Gotchas
992+=======
993+
994+One thing to keep in mind is that quilt uses a hidden ``.pc`` directory to
995+record its status. This directory is under version control in all source
996+branches. *Watch out* for changes to the ``.pc`` directory that are unrelated
997+(or more accurately, uninteresting) to your patch. This can happen because
998+the UDD source branch importer `currently includes any existing .pc
999+directory`_ in the imported branch. This can cause conflicts, or other
1000+unwanted or unknown changes because you've essentially got two conflicting
1001+version control systems competing for the same thing (i.e. bzr and quilt3).
1002+For now, the best recommendation is to revert any changes to the ``.pc``
1003+directory in your branch.
1004+
1005+
1006+Publishing your changes
1007+=======================
1008+
1009+It's actually easier at this point to generate a diff for attaching to the bug
1010+report. Just::
1011+
1012+ $ bzr up-thread -auto
1013+ $ bzr diff -rthread: > mypatch.diff
1014+
1015+The differences between the ``quiltfix`` thread and the ``sourcefix`` thread
1016+are the interesting bits, and totally appropriate for committing and upload.
1017+Because of the way looms interacts with Launchpad, you can still link your
1018+branch to the bug and request a merge proposal, but understand that the diff
1019+will include all changes between ``quiltfix`` (top) and ``trunk`` (bottom)
1020+threads. So the merge proposal will include the changes in the ``debian/``
1021+directory, *and* the changes in the source tree. As long as you and your
1022+reviewer understands this, you should be okay, but it can be confusing at
1023+first.
1024+
1025+If you need a sponsor to merge and upload your changes, one thing they *do
1026+not* want to do is::
1027+
1028+ $ bzr branch ubuntu:foobar
1029+ $ cd foobar
1030+ $ bzr merge lp:~you/ubuntu/natty/foobar/yourfix
1031+
1032+Much badness (in the form of infinite *maximum recursion depth* exceptions)
1033+ensues. Yes, we need to file a bug on that.
1034+
1035+
1036+edit-patch
1037+==========
1038+
1039+``edit-patch`` is a nice little wrapper script that comes as part of the
1040+``ubuntu-dev-tools`` package. It pretty much hides the nasty details of
1041+dealing with the patch system specifically. For example, while the above
1042+works well if your package is using quilt already, you'll have to adjust the
1043+workflow, perhaps significantly, to work with `a different patch system`_. In
1044+theory ``edit-patch`` should solve this, but there are currently two blockers.
1045+
1046+ * By default, ``bzr diff`` produces a ``-p0`` patch, but ``edit-patch``
1047+ defers to the underlying patch system's default. For quilt, this is
1048+ ``-p1``. ``quilt import`` takes a ``-p`` argument to specify the prefix
1049+ level, but this isn't yet exposed in ``edit-patch``. If you're
1050+ adventurous, try changing the ``bzr diff`` command above to specify the
1051+ proper prefixes using its ``-p`` option.
1052+ * By default, ``edit-patch`` requires a path to an existing patch file, but
1053+ it's more convenient to pipe the output of ``bzr diff`` to the stdin of
1054+ ``edit-patch``, as shown above. The alternative would be to save the diff
1055+ in a temporary file, and then point ``edit-patch`` to this temporary file.
1056+
1057+
1058+Future
1059+======
1060+
1061+Ideally, it would be nice to add a ``bzr edit-patch`` or some such command
1062+which does the whole loom -> patch system import. At least ``edit-patch``
1063+could grow a ``-p`` and ``-P`` option, as well as read from stdin. Stay
1064+tuned, or get involved!
1065+
1066+There's now `a bug` that tracks this.
1067+
1068+
1069+.. _`patch system`: https://wiki.ubuntu.com/DistributedDevelopment/Documentation/PatchSystem/PackagingGuide/PatchSystems
1070+.. _`Bazaar looms`: https://launchpad.net/bzr-loom
1071+.. _quilt: http://www.wzdftpd.net/blog/index.php?2008/02/05/3-quilt-a-patch-management-system-how-to-survive-with-many-patches
1072+.. _`currently includes any existing .pc directory`: https://bugs.launchpad.net/udd/+bug/672740
1073+.. _`a different patch system`: http://wiki.debian.org/debian/patches
1074+.. _`a bug`: https://launchpad.net/bugs/620721
1075
1076=== added file 'docs/setup.rst'
1077--- docs/setup.rst 1970-01-01 00:00:00 +0000
1078+++ docs/setup.rst 2011-01-11 23:17:27 +0000
1079@@ -0,0 +1,48 @@
1080+==========
1081+Setting up
1082+==========
1083+
1084+
1085+Installing Packages
1086+===================
1087+
1088+You will first need to install packages to make the tools available to you.
1089+The packages you need to install are `bzr` and `bzr-builddeb`::
1090+
1091+ $ sudo aptitude install bzr bzr-builddeb
1092+
1093+
1094+Introducing yourself to bzr
1095+===========================
1096+
1097+In order to properly attribute your work to you bzr needs to know your name
1098+and email address, which you can specify with the `bzr whoami` command::
1099+
1100+ $ bzr whoami "James Westby <james.westby@ubuntu.com>"
1101+
1102+You don't have to give your real name, and you don't have to give your
1103+email address, but doing so is a good idea for Ubuntu development.
1104+
1105+
1106+Telling bzr about your launchpad account
1107+========================================
1108+
1109+bzr can work better with Launchpad_ if you tell it what your Launchpad
1110+username is with the `bzr launchpad-login` command::
1111+
1112+ $ bzr launchpad-login james-w
1113+
1114+where you should substitute your own Launchpad id for `james-w`. If you don't
1115+have a Launchpad account you can easily `create one`_. If you don't know your
1116+Launchpad id, you can find out what this is by going to
1117+https://launchpad.net/people/+me and looking at the part after `~` in the URL.
1118+
1119+The `launchpad-login` command will fail if you haven't set up an SSH key in
1120+Launchpad yet, but it is `easy to do that`_.
1121+
1122+Now you are ready to use bzr to do Ubuntu development.
1123+
1124+
1125+.. _Launchpad: http://launchpad.net
1126+.. _`create one`: https://launchpad.net/+login
1127+.. _`easy to do that`: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair
1128
1129=== added file 'docs/sponsorship.rst'
1130--- docs/sponsorship.rst 1970-01-01 00:00:00 +0000
1131+++ docs/sponsorship.rst 2011-01-11 23:17:27 +0000
1132@@ -0,0 +1,110 @@
1133+===================
1134+Seeking Sponsorship
1135+===================
1136+
1137+If you have made a change to the package and you do not have rights to upload
1138+the package then you will need to seek a sponsor.
1139+
1140+Note that many sponsorships are still done via debdiffs, and some sponsors
1141+will prefer that, so you may wish to attach a diff to the bug as well.
1142+
1143+
1144+Linking to bugs
1145+===============
1146+
1147+You will need a bug report to seek sponsorship, and you should refer to this
1148+issue from your `debian/changelog`. Fill in the changelog entry by running
1149+`dch -i` and add the `LP: #12345` entry as normal. For example::
1150+
1151+ foobar (1.0-2ubuntu1) natty; urgency=low
1152+
1153+ * debian/control: Fixed a crash in the baz submodule (LP: #12345)
1154+
1155+ -- Barry Warsaw <barry@ubuntu.com> Mon, 04 Jan 2010 15:33:52 -0500
1156+
1157+The format of the bug reference must match exactly; if you leave out the space
1158+or the `#` then the issue will not be closed correctly once your change
1159+lands. You may also want to use the `--fixes` option on the `bzr commit`
1160+command to link your branch to the bug report::
1161+
1162+ $ bzr commit --fixes lp:12345
1163+
1164+Now, when you push the branch to Launchpad it will link the branch to the bug
1165+report.
1166+
1167+It is not critical to have a link to a bug for every change you make,
1168+but if you are fixing reported bugs then linking to them will be useful.
1169+
1170+
1171+Pushing to Launchpad
1172+====================
1173+
1174+Now you should push the branch to Launchpad so that it can be retrieved
1175+by others. You do this by pushing it to a branch under your user id::
1176+
1177+ $ bzr push lp:~james-w/ubuntu/natty/foobar/bug-12345
1178+
1179+where you substitute your Launchpad user id for *james-w*, and the Ubuntu
1180+release code name you're targeting for *natty*. If you linked a commit to a
1181+bug number as shown above, then the Launchpad page for the bug will include a
1182+link to your branch.
1183+
1184+However, this usually isn't enough to get Ubuntu developers to review your
1185+change. You should next submit a *merge proposal* so that the developers can
1186+find your fix and review it.
1187+
1188+To do this open your page in a browser, e.g.
1189+
1190+ $ bzr lp-open
1191+
1192+if that fails, then you can use
1193+
1194+ $ xdg-open https://code.launchpad.net/~james-w/ubuntu/natty/foobar/bug-12345
1195+
1196+where most of the URL matches what you used for `bzr push`. On this page,
1197+you'll see a link that says *Propose for merging into another branch*. Type
1198+in an explanation of your change in the *Initial Comment* box. Lastly, click
1199+*Propose Merge* to complete the process.
1200+
1201+Merge proposals to package source branches will automatically subscribe the
1202+`~ubuntu-branches` team, which should be enough to reach an Ubuntu developer
1203+who can review and sponsor your package change.
1204+
1205+
1206+Generating a debdiff
1207+====================
1208+
1209+As noted above, many sponsors still prefer reviewing a *debdiff* attached to
1210+bug reports instead of a merge proposal. If you're requested to include a
1211+debdiff, you can generate one like this (from inside your `bug-12345`
1212+branch)::
1213+
1214+ $ bzr diff -rbranch:../natty
1215+
1216+Another way is to is to open the merge proposal and download the diff.
1217+
1218+You should ensure that diff has the changes you expect, no more and no less.
1219+Name the diff appropriately e.g. foobar-12345.debdiff and attach it to the bug
1220+report.
1221+
1222+
1223+Dealing with feedback from sponsors
1224+===================================
1225+
1226+If a sponsor reviews your change and asks you to change something then you can
1227+do this fairly easily. Simply go to the branch that you were working in
1228+before and make the changes requested, and then commit::
1229+
1230+ $ bzr commit
1231+
1232+Now you can push your changes up to Launchpad as before, but bzr will have
1233+remembered where you pushed to, so you can simply run::
1234+
1235+ $ bzr push
1236+
1237+You can then reply to the request for changes explaining what you changed, and
1238+asking for re-review, or you can reply on the merge proposal page in
1239+Launchpad.
1240+
1241+Note if you are sponsored via debdiff attached to a bug report you need to
1242+manually update it as described above.
1243
1244=== added file 'docs/uploading.rst'
1245--- docs/uploading.rst 1970-01-01 00:00:00 +0000
1246+++ docs/uploading.rst 2011-01-11 23:17:27 +0000
1247@@ -0,0 +1,117 @@
1248+===================
1249+Uploading a package
1250+===================
1251+
1252+Once your merge proposal is reviewed and approved, you will want to upload
1253+your package, either to the archive (if you have permission) or to your
1254+*Personal Package Archive* (PPA). You might also want to do an upload if you
1255+are sponsoring someone else's changes.
1256+
1257+
1258+Uploading a change made by you
1259+==============================
1260+
1261+When you have a branch with a change that you would like to upload you need to
1262+get that change back on to the main branch and then upload it.
1263+
1264+First, you need to check that you have the latest version of the package in
1265+your checkout of the development package::
1266+
1267+ $ cd foobar/natty
1268+ $ bzr pull
1269+
1270+If this pulls in any changes that may have been committed while you were
1271+working on your fix. From here, you have several options. If the changes on
1272+the trunk are large, and it will take a while to merge them and test the
1273+package, then you can merge them back in to your work branch to do this. If
1274+not, then you can carry on merging your work branch in to the main one::
1275+
1276+ $ bzr merge-package ../bug-12345
1277+
1278+This will merge the two trees, possibly producing conflicts, which you'll need
1279+to resolve manually.
1280+
1281+Next you should make sure the `debian/changelog` is as you would like, with
1282+the correct distribution, version number, etc.
1283+
1284+Once that is done you should review the change you are about to commit
1285+with `bzr diff`. This should show you the same changes as a debdiff would
1286+before you upload the source package.
1287+
1288+The next step is to build and test the modified source package as you normally
1289+would. Once you are happy with the upload then you should `dput` the
1290+source package. For example, if you want to upload your changes to your PPA,
1291+then you'd do::
1292+
1293+ $ dput ppa:me/myppa foobar_1.0-2ubuntu1.dsc
1294+
1295+You might want to do one more `bzr commit` to make sure all your changes are
1296+committed in your working tree.
1297+
1298+The last step is to mark the change as being the same as the source package
1299+that was uploaded, so run::
1300+
1301+ $ bzr mark-uploaded
1302+
1303+This also tells the package importer that what is in bzr is the same as in the
1304+archive.
1305+
1306+Now you can push the changes back to Launchpad::
1307+
1308+ $ bzr push ubuntu:foobar
1309+
1310+(Change the destination if you are uploading an SRU or similar.)
1311+
1312+You are now free to delete your feature branch, as it is merged, and can
1313+be recovered if needed.
1314+
1315+
1316+Sponsoring a change
1317+===================
1318+
1319+Sponsoring a change is just like the above procedure, but instead of merging
1320+from a branch you created, you merge from the branch that the contributor asks
1321+you to.
1322+
1323+ $ bzr merge-package lp:~barry/ubuntu/natty/foobar/bug-12345
1324+
1325+The difference would be that if there are lots of merge conflicts then you
1326+would probably want to ask the contributor to fix them up. To do that see the
1327+next section.
1328+
1329+Cancelling an upload
1330+====================
1331+
1332+At any time before you `dput` the source package you can decide to cancel an
1333+upload.
1334+
1335+ $ bzr revert
1336+
1337+You can do this if you notice something needs more work, or if you would like
1338+to ask the contributor to fix up conflicts when sponsoring something.
1339+
1340+
1341+Sponsoring something and making your own changes
1342+================================================
1343+
1344+If you are going to sponsor someone's work, but you would like to roll it up
1345+with some changes of your own then you can merge their work in to a separate
1346+branch first.
1347+
1348+If you already have a branch where you are working on the package and you
1349+would like to include their changes, then simply run the `bzr merge-package`
1350+from that branch, instead of the checkout of the development package. You can
1351+then make the changes and commit, and then carry on with your changes to the
1352+package.
1353+
1354+If you don't have an existing branch, but you know you would like to make
1355+changes based on what the contributor provides then you should start by
1356+grabbing their branch.
1357+
1358+ $ bzr branch lp:~barry/ubuntu/natty/foobar/bug-12345
1359+
1360+then work in this new branch, and then merge it in to the main one and upload
1361+as if it was your own work. The contributor will still be mentioned in the
1362+changelog, and bzr will correctly attribute the changes they made to them.
1363+
1364+.. _`Personal Package Archive`: https://help.launchpad.net/Packaging/PPA
1365
1366=== added file 'docs/working.rst'
1367--- docs/working.rst 1970-01-01 00:00:00 +0000
1368+++ docs/working.rst 2011-01-11 23:17:27 +0000
1369@@ -0,0 +1,59 @@
1370+====================
1371+Working on a Package
1372+====================
1373+
1374+Once you have the package source you may wish to do more with it than just
1375+examine the source and the history.
1376+
1377+
1378+Branching for a change
1379+======================
1380+
1381+In order to work on a change to the package you should create a branch
1382+in which you work. You base this branch off the branch for the release
1383+that you plan to upload to, usually the development release.
1384+
1385+First check that you have latest code. Let's say I've already branched the
1386+`foobar` package from the latest Ubuntu development release, and I want to
1387+create a branch to fix bug 12345. I am in the shared repository directory
1388+that I created earlier for `foobar`::
1389+
1390+ $ bzr branch natty bug-12345
1391+ $ cd bug-12345
1392+
1393+Now you can do all my work in the `bug-12345` directory. You make changes
1394+there as necessary, committing as you go along. This is just like doing any
1395+kind of software development with Bazaar. You can make intermediate commits
1396+as often as you like, and when your changes are finished, you will use the
1397+standard `dch` command (from the `devscripts` package)::
1398+
1399+ $ dch -i
1400+
1401+This will drop you in an editor to add the `debian/changelog` entry. When you
1402+commit this change, the log message will be copied from that entry::
1403+
1404+ $ bzr commit
1405+
1406+
1407+Building the package
1408+====================
1409+
1410+In order to build the package you can use the `bzr builddeb` command from
1411+the `bzr-builddeb` package. You can build a source package with::
1412+
1413+ $ bzr bd -S
1414+
1415+(`bd` is an alias for `builddeb`.) You can leave the package unsigned by
1416+appending `-- -uc -us` to the command.
1417+
1418+It is also possible to use your normal tools, as long as they are able to
1419+strip the .bzr directories from the package, e.g.::
1420+
1421+ $ debuild -i -I
1422+
1423+If you ever see an error related to trying to build a native package without a
1424+tarball, check to see if there is a `.bzr-builddeb/default.conf` file
1425+erroneously specifying the package as native. If the changelog version has a
1426+dash in it, then it's not a native package, so remove the configuration file.
1427+Note that while `bzr bd` has a `--native` switch, it does not have a
1428+`--no-native` switch.

Subscribers

People subscribed via source and target branches