From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.devel Subject: Re: "No safeguard against rewriting upstream bzr history" Date: Sun, 05 Jan 2014 19:38:18 +0100 Message-ID: <85sit29sp4.fsf@iznogoud.viz> References: <20140102095347.6834E381D0C@snark.thyrsus.com> <87k3eisirv.fsf@zigzag.favinet> <87a9faq4wv.fsf@zigzag.favinet> <87k3eecsoz.fsf_-_@slice.rozzin.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1388947332 11690 80.91.229.3 (5 Jan 2014 18:42:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Jan 2014 18:42:12 +0000 (UTC) Cc: Felipe Contreras Garza , emacs-devel@gnu.org To: Joshua Judson Rosen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 19:42:19 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 1VzseQ-0003pq-Hq for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2014 19:42:18 +0100 Original-Received: from localhost ([::1]:59045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzseQ-0006wJ-02 for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2014 13:42:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39017) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzseI-0006w5-9T for emacs-devel@gnu.org; Sun, 05 Jan 2014 13:42:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzseC-0007Ax-It for emacs-devel@gnu.org; Sun, 05 Jan 2014 13:42:10 -0500 Original-Received: from b2bfep16.mx.upcmail.net ([62.179.121.61]:34011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzseC-0007AY-7R for emacs-devel@gnu.org; Sun, 05 Jan 2014 13:42:04 -0500 Original-Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep16-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20140105184200.BHHM26955.b2bfep16-int.chello.at@edge11.upcmail.net>; Sun, 5 Jan 2014 19:42:00 +0100 Original-Received: from iznogoud.viz ([91.119.127.191]) by edge11.upcmail.net with edge id AJhz1n01347u4y30BJhzjl; Sun, 05 Jan 2014 19:42:00 +0100 X-SourceIP: 91.119.127.191 Original-Received: from wolfgang by iznogoud.viz with local (Exim 4.82 (FreeBSD)) (envelope-from ) id 1Vzse7-0000T2-Ag; Sun, 05 Jan 2014 19:41:59 +0100 Mail-Followup-To: Joshua Judson Rosen , Felipe Contreras Garza , emacs-devel@gnu.org User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (berkeley-unix) X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 62.179.121.61 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:167389 Archived-At: On Sun, Jan 05 2014, Joshua Judson Rosen wrote: > Thien-Thi Nguyen writes: >> >> - Investigate "no safeguard against rewriting upstream bzr repo history": >> . >> >> I'd like to determine if the "doesn't work" part lies in bzrlib or >> in git-remote-bzr. I suspect the latter, since there is no call >> to =E2=80=98die=E2=80=99 in that code. Hmmm, time to snapshot the (re= latively) >> svelte repo and see what damage a tweaked git-remote-bzr can do, >> i suppose... > > If it's true, one could also say that the upstream branches > are misconfigured: if you set "append_revisions_only =3D True" > in the branch's .bzr/branch/branch.conf, then the bzr > server will enforce that revisions are only ever added to > the left hand side (mainline edge) of the DAG and never > removed (either by uncommitting or by re-orienting the DAG). [...] > When creating new branches, there's an argument to "bzr init" > that sets this option; Thank you very much for this explanation! Indeed, with this switch, the local experiment in http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00094.html gives the following: [1 /tmp]$ bzr init --append-revisions-only trunk Created a standalone tree (format: 2a) [2 /tmp]$ cat trunk/.bzr/branch/branch.conf append_revisions_only =3D True [3 /tmp]$ (cd trunk && touch foo && bzr add $_ && bzr commit -m X && bzr lo= g --line) adding foo Committing to: /tmp/trunk/ added foo Committed revision 1. 1: Wolfgang Jenkner 2014-01-05 X [4 /tmp]$ git clone bzr::trunk local Cloning into 'local'... Checking connectivity... done. [5 /tmp]$ (cd trunk && echo "trunk change" >foo && bzr commit -m A && bzr l= og --line) Committing to: /tmp/trunk/ modified foo Committed revision 2. 2: Wolfgang Jenkner 2014-01-05 A 1: Wolfgang Jenkner 2014-01-05 X [6 /tmp]$ (cd local && echo "local change" >foo && git commit -a -m B && gi= t log --oneline && git push) [master d494366] B 1 file changed, 1 insertion(+) d494366 B 2fa9952 X Traceback (most recent call last): File "/home/wolfgang/bin/git-remote-bzr", line 947, in sys.exit(main(sys.argv)) File "/home/wolfgang/bin/git-remote-bzr", line 933, in main do_export(parser) File "/home/wolfgang/bin/git-remote-bzr", line 682, in do_export branch.generate_revision_history(revid, marks.get_tip(name)) File "", line 4, in generate_revision_history_write_locked File "/usr/local/lib/python2.7/site-packages/bzrlib/branch.py", line 816,= in generate_revision_history self.set_last_revision_info(revno, revision_id) File "", line 4, in set_last_revision_info_write_locked File "/usr/local/lib/python2.7/site-packages/bzrlib/branch.py", line 2524= , in set_last_revision_info self._check_history_violation(revision_id) File "/usr/local/lib/python2.7/site-packages/bzrlib/branch.py", line 2727= , in _check_history_violation raise errors.AppendRevisionsOnlyViolation(self.user_url) bzrlib.errors.AppendRevisionsOnlyViolation: Operation denied because it wou= ld change the main history, which is not permitted by the append_revisions_= only setting on branch "/tmp/trunk/". [7 /tmp]$ (cd trunk && bzr log --line) 2: Wolfgang Jenkner 2014-01-05 A 1: Wolfgang Jenkner 2014-01-05 X [8 /tmp]$ (cd trunk && bzr status) [9 /tmp]$ (cd trunk && bzr diff) [10 /tmp]$=20 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. Wolfgang