From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.emacs.devel Subject: Re: "No safeguard against rewriting upstream bzr history" Date: Mon, 06 Jan 2014 10:00:19 +0100 Message-ID: <87wqido57g.fsf@zigzag.favinet> References: <20140102095347.6834E381D0C@snark.thyrsus.com> <87k3eisirv.fsf@zigzag.favinet> <87a9faq4wv.fsf@zigzag.favinet> <87k3eecsoz.fsf_-_@slice.rozzin.com> <85sit29sp4.fsf@iznogoud.viz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1388998613 13012 80.91.229.3 (6 Jan 2014 08:56:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 Jan 2014 08:56:53 +0000 (UTC) Cc: Felipe Contreras Garza To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 06 09:56:59 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W05zV-0007GT-VV for ged-emacs-devel@m.gmane.org; Mon, 06 Jan 2014 09:56:58 +0100 Original-Received: from localhost ([::1]:33154 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W05zV-00035t-FJ for ged-emacs-devel@m.gmane.org; Mon, 06 Jan 2014 03:56:57 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W05zM-00035N-II for emacs-devel@gnu.org; Mon, 06 Jan 2014 03:56:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W05zG-0006Od-9d for emacs-devel@gnu.org; Mon, 06 Jan 2014 03:56:48 -0500 Original-Received: from smtp205.alice.it ([82.57.200.101]:64439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W05zF-0006OP-Uj for emacs-devel@gnu.org; Mon, 06 Jan 2014 03:56:42 -0500 Original-Received: from zigzag.favinet (79.21.139.117) by smtp205.alice.it (8.6.060.28) id 529A59310877042F; Mon, 6 Jan 2014 09:56:40 +0100 Original-Received: from ttn by zigzag.favinet with local (Exim 4.80) (envelope-from ) id 1W062w-000346-CC; Mon, 06 Jan 2014 10:00:30 +0100 Mail-Followup-To: emacs-devel@gnu.org In-Reply-To: <85sit29sp4.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Sun, 05 Jan 2014 19:38:18 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 82.57.200.101 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:167454 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain () Wolfgang Jenkner () Sun, 05 Jan 2014 19:38:18 +0100 So part of the bzrlib safeguard against rewriting history is actually in one of the callees of generate_revision_history, while git-remote-bzr seems to assume that it is all in push_branch. Given that the Emacs repo does indeed have that configuration variable set, sounds like the situation is not actually critical. Cool. Nobody has confirmed the sanity check, but w/ this safeguard in place, i suppose that won't be necessary. Full speed ahead... BTW, here is a small patch that makes git-remote-bzr better-behaved: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=git-remote-bzr.diff Content-Transfer-Encoding: quoted-printable diff -u /etc/alternatives/ /tmp/git-remote-bzr =2D-- /etc/alternatives/git-remote-bzr 2013-12-07 00:20:48.000000000 +0100 +++ /tmp/git-remote-bzr 2014-01-06 09:18:59.000000000 +0100 @@ -679,7 +679,21 @@ if ref.startswith('refs/heads/'): name =3D ref[len('refs/heads/'):] branch =3D get_remote_branch(name) =2D branch.generate_revision_history(revid, marks.get_tip(name)) + + # This alone is not sufficient: + #- branch.generate_revision_history(revid, marks.get_tip(name)) + # + # Instead, we need to also handle the situation + # where the remote branch is configured with: + # append_revisions_only =3D True + # + # TODO: Refactor the "error message and continue". + + try: + branch.generate_revision_history(revid, marks.get_tip(name= )) + except bzrlib.errors.AppendRevisionsOnlyViolation: + print "error %s non-fast forward" % ref + continue =20 if name in peers: peer =3D bzrlib.branch.Branch.open(peers[name], --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I haven't tested it (yet), but anyway hope it, or its essence, can be incorporated into the next git-remote-bzr release. =2D-=20 Thien-Thi Nguyen GPG key: 4C807502 (if you're human and you know it) read my lisp: (responsep (questions 'technical) (not (via 'mailing-list))) =3D> nil --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlLKcKcACgkQZwMiJEyAdQJWaQCg2aWye9Ux2aKVLEU9YDBN7rt7 DLYAn16MYFy87KsWp9iIdak2aN67KWGq =xx1J -----END PGP SIGNATURE----- --==-=-=--