Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 0D23A431FC3 for ; Sun, 20 Jul 2014 16:34:09 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.1 X-Spam-Level: X-Spam-Status: No, score=-0.1 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vCuJ-QNsLVki for ; Sun, 20 Jul 2014 16:34:05 -0700 (PDT) Received: from qmta08.emeryville.ca.mail.comcast.net (qmta08.emeryville.ca.mail.comcast.net [76.96.30.80]) by olra.theworths.org (Postfix) with ESMTP id F080C431FAE for ; Sun, 20 Jul 2014 16:34:04 -0700 (PDT) Received: from omta04.emeryville.ca.mail.comcast.net ([76.96.30.35]) by qmta08.emeryville.ca.mail.comcast.net with comcast id UnYP1o0040lTkoCA8na4Zo; Sun, 20 Jul 2014 23:34:04 +0000 Received: from odin.tremily.us ([24.18.63.50]) by omta04.emeryville.ca.mail.comcast.net with comcast id Una31o00A152l3L8Qna39o; Sun, 20 Jul 2014 23:34:04 +0000 Received: by odin.tremily.us (Postfix, from userid 1000) id 0EF6E12AB0D1; Sun, 20 Jul 2014 16:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tremily.us; s=odin; t=1405899243; bh=ZJ6FrWJErCCe/vlY8Il+/Fl01xBjSSh/r8JMqzRXmA0=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=hKW2UgH4d71DQFj5OpHxhu1TJj/gm/VWURKURX0rIinb8ourdnF7wMyvULiZrcSyV pOg4BKmJVfvPXEE/1HIL4Ub3jCSgjeL/+65yD6L3bND+9MLMDSuEx/Ql56pEkDLbfx 7fOqnHyij/qL9lqCe+P5TCg13m4wEhFcdWXSISM4= Date: Sun, 20 Jul 2014 16:34:02 -0700 From: "W. Trevor King" To: notmuch@notmuchmail.org Subject: Re: [PATCH v3] nmbug: Translate to Python Message-ID: <20140720233402.GU8744@odin> References: <84447a0ed48412e1587761d560d18cb5affd4f66.1405897133.git.wking@tremily.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EyuBRJR0MsVMWKTf" Content-Disposition: inline In-Reply-To: <84447a0ed48412e1587761d560d18cb5affd4f66.1405897133.git.wking@tremily.us> OpenPGP: id=39A2F3FA2AB17E5D8764F388FC29BDCDF15F5BE8; url=http://tremily.us/pubkey.txt User-Agent: Mutt/1.5.23 (2014-03-12) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1405899244; bh=rMMuk6dSK2dYfTx0qDsnAgXQ0++7O8xqUZ6ednmkggM=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=r0ssCPKZlKPZojh6cjNQT4k38WSUdOo0cf1YkDDV2MeuBrkEUFPOm7RYsDNOLgmJI 1UEH+bNRwu/JilIEYSN9S4H88/fZTWM9kGUQoueos3IwF6v/dUWpNQ4bM4MMljcDjk 6ssJgyCFXGMxla1T/YIpS9cwLwPniOxbcEclcJEhvoMiueCiSwkVJ5O7VNBECW70gt kwQjjRmd9otGchkwVuZdpvU1snU0+VuXHAoXfewDLC8Hhx0CZ9hK3MS4iKYz9S2XUV Bv8Ua1ZZq7iMHNVCNp6xTAhWFIIumohvObRwjy2pgImhGV3nUyNCA7IIWdSt4XGxMY ev7OGViclFWaQ== Cc: David Bremner X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2014 23:34:09 -0000 --EyuBRJR0MsVMWKTf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 20, 2014 at 03:59:49PM -0700, W. Trevor King wrote: > +def pull(repository=3DNone, refspecs=3DNone): > + """ > + Pull (merge) remote repository changes to notmuch. > + > + 'pull' is equivalent to 'fetch' followed by 'merge'. We use the > + Git-configured repository for your current branch > + (branch..repository, likely 'origin', and > + branch..merge, likely 'master'). > + """ > + _insist_committed() > + if refspecs and not repository: > + repository =3D _get_remote() > + args =3D ['pull'] > + if repository: > + args.append(repository) > + if refspecs: > + args.extend(refspecs) > + with _tempfile.TemporaryDirectory(prefix=3D'nmbug-merge.') as workdi= r: > + _git(args=3Dargs, additional_env=3D{'GIT_WORK_TREE': workdir}, w= ait=3DTrue) > + checkout() The TemporaryDirectory prefix should probably be 'nmbug-pull.'. Queued for v4. > +def log(args=3D()): > + """ > + A simple wrapper for 'git log'. > + > + After running 'nmbug fetch', you can inspect the changes with > + 'nmbug log HEAD..@{upstream}'. > + """ > + # we don't want output trapping here, because we want the pager. > + args =3D ['git', '--git-dir', NMBGIT, 'log', '--name-status'] + list= (args) > + _LOG.debug('exec {args}'.format(args=3Dargs)) > + _os.execvp('git', args) I don't exec any other commands. Maybe we want '_git(args=3Dargs, wait=3DTrue)' here (with the appropriate args adjustments)? > +def _diff_index(index, filter): > + """Get an {id: {tag, ...}} dict for a given filter. > + > + For example, use 'A' to find added tags, and 'D' to find deleted tag= s. > + """ I'll shift the summary onto the next line here to match the pattern set by the command functions (e.g. archive()). They *need* the summary to be on the line after the opening triple-quote to support the textwrap.dedent() help used for the argument parser. There were also a few docstrings missing the trailing period recommended by PEP 257 [1] (for _hex_quote, get_tags, _read_tree, fetch, _index_tags, and _unpack_diff_lines). I'll add those periods in v4. Cheers, Trevor [1]: http://legacy.python.org/dev/peps/pep-0257/#one-line-docstrings --=20 This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy --EyuBRJR0MsVMWKTf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTzFHoAAoJEG8/JgBt8ol8ojwQANRlzEOwwEk/7JDlujBTlkAI KvNZOgFOukk+znjPd2ui+cLKvvsdx+Ph2NRPPOLNL6tXVgYfNOVre4IuHmH/VSPt eQLR4jHS5TN46NsjbuqyvXY+O0mJ4h8HsXG50iPoS4WZ6hPCUMbWmtgMbkJ0APDQ uIVjsvoTs1QYjZsiERUOCwcwiFk/kiHxWuRAe5jfwSgtCcPiSXVv4Zx2g9MxS1tQ X+PU0wDRtmeI4Kj6z7jPe3uexb/775zwhfZj2dVBS/+rrMwZEGSJ6xRTQDTOZp/O RNSBjJLdiEeSOKDSLvo2p1syLp86o89W0FZoecqHsLiDUEbHCi0zk7zXmJAKyXno NsAxferOd8Tg70VCJHzqi7UqP3/T3S6PYQJnjZq+bJrTwzzonKYJmZqvuClvK/fn XEiioAR55ELxfLU5Cm9vOjci7l3TIhdH9OCvEULk7+tUc3zNJPk2Wv/wHF9nq63f wAoEfELG1+c4KRVXnB9u3EtjSy9OhATz60hZzDKD+8NggJf1N6EuCjGHPS5uY4Gu YCSogMpYboy18WFHFJlOjgdc/P/MU/NuzsBPo2VZ1Jn4UWdpPs3egrRD6uRJDZ6i 8GUcoHMtVx3U9U3Ba6OcMSMuHfBDFKFKY0KfeM+gRklJuTQH64Kd31z/kB98ULVq ZdokQXzxf7hlFDeBvEZG =ZCO6 -----END PGP SIGNATURE----- --EyuBRJR0MsVMWKTf--