# See the License for the specific language governing permissions and
# limitations under the License.
'''Mercurial interface to codereview.appspot.com.
+Mercurial interface to codereview.appspot.com.
-To configure, set the following options in
-your repository's .hg/hgrc file.
+This extension requires evolve extension.
+To configure, set the following options in your repository's .hg/hgrc file.
codereview = /path/to/codereview.py
The server should be running Rietveld; see http://code.google.com/p/rietveld/.
-In addition to the new commands, this extension introduces
-the file pattern syntax @nnnnnn, where nnnnnn is a change list
-number, to mean the files included in that change list, which
-must be associated with the current client.
+Rietveld changelists (CLs) are mapped to Mercurial changesets.
-For example, if change 123456 contains the files x.go and y.go,
-"hg diff @123456" is equivalent to"hg diff x.go y.go".
+See :hg:`help clpush` to create or update changelists from local changesets.
-The extension registers a "clid" template keyword returning the changelist
-identifier of published changesets.
+See :hg:`help clmail` to update a changelist from a changeset and send a
+See :hg:`help clclose` to close and possibly delete a changelist.
+See :hg:`help climport` to turn changelists into regular local changesets.
+In addition to the new commands, this extension introduces the `clid` template
+keyword, returning the changelist identifier of a published changeset.
This command requires evolve extension.
If selected changeset was clpushed before and contains CLMETA- lines in
- it description, fetch metadata from remote changelist, merge them into
- the local changelist, then update the remote changelist with local content.
+ its description, fetch metadata from remote changelist, merge them into
+ the local changelist and update the remote changelist with local content.
- Otherwise, a new changelist is created on codereview server.
+ Otherwise, a new changelist is created on codereview server and CLMETA-
+ information is appended to the changeset description.
- In both cases, the local changeset cannot be public if changelist metadata
- is being created or updated.
+ In both cases, updating the description with CLMETA- lines requires the
+ changeset not to be public.
This command requires evolve extension.
- Uploads a patch to the code review server and then sends mail
- to the reviewer and CC list asking for a review.
- Since this can change changelist metadata, selected changeset may be
- rewritten and cannot be public.
+ Uploads a patch to the code review server and sends mail to the
+ reviewer and CC list asking for a review. Updating metadata before
+ uploading changes can require the changeset to be rewritten, and
+ therefore be non-public.
def clclose(ui, repo, rev, **opts):
- Non-public changesets description is stripped of any changelist metadata.
+ Before being closed, a termination message is added to the changelist
+ linked to specified changeset.
+ With --delete the changelist is permanently deleted from code review
+ If the local changeset is non-public, changelist metadata is removed from
+ its description. A warning is issued otherwise.
def climport(ui, repo, clname, **opts):
"""import a change list from code review server
- Retrieves the latest diff for specified changelist and import it on top
+ Retrieves the latest diff for specified changelist and import it on top
of the current changeset. If the patch fails to apply, rejected hunks may
be left as .rej files in the working directory.
+ Because climport first applies changes to the working directory, climport
+ will abort if there are outstanding changes.
+ Imported changesets contain no metadata related to their source changelist.
+ Calling :hg:`clpush` on them creates new changelists.
def code_login(ui, repo, **opts):
"""log in to code review server
- Logs in to the code review server, saving a cookie in
- a file in your home directory.
+ Logs in to the code review server, saving a cookie in a file in your home