From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#43464: 28.0.50; vc: Error calling vc-revert for repo root Date: Mon, 5 Oct 2020 01:32:10 +0300 Message-ID: <7b4d0bcf-c622-b2db-34d6-e587fe516f8d@yandex.ru> References: <0b1c72d0-f8fb-a256-1563-1c43296c8edb@yandex.ru> <11761d79-1893-fdf3-843d-bea4a026fc7f@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3021"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: 43464@debbugs.gnu.org To: Andrii Kolomoiets Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 05 00:33:27 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPCZK-0000eW-8y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 05 Oct 2020 00:33:26 +0200 Original-Received: from localhost ([::1]:55428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPCZI-00049L-Sy for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Oct 2020 18:33:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPCYx-000437-AT for bug-gnu-emacs@gnu.org; Sun, 04 Oct 2020 18:33:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35387) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPCYx-0003IB-19 for bug-gnu-emacs@gnu.org; Sun, 04 Oct 2020 18:33:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kPCYw-0008KA-Ud for bug-gnu-emacs@gnu.org; Sun, 04 Oct 2020 18:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Oct 2020 22:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43464 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 43464-submit@debbugs.gnu.org id=B43464.160185074131925 (code B ref 43464); Sun, 04 Oct 2020 22:33:02 +0000 Original-Received: (at 43464) by debbugs.gnu.org; 4 Oct 2020 22:32:21 +0000 Original-Received: from localhost ([127.0.0.1]:46927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPCYH-0008Iq-6u for submit@debbugs.gnu.org; Sun, 04 Oct 2020 18:32:21 -0400 Original-Received: from mail-ej1-f41.google.com ([209.85.218.41]:45376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPCYF-0008Ic-84 for 43464@debbugs.gnu.org; Sun, 04 Oct 2020 18:32:20 -0400 Original-Received: by mail-ej1-f41.google.com with SMTP id i26so9193242ejb.12 for <43464@debbugs.gnu.org>; Sun, 04 Oct 2020 15:32:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qeA82m5Gb++RIR+oXtmSNu/PJeKSWBs+x9b6atz1ty0=; b=PPqfFUBqB6bNJdIYoLs9BKu7BtmNeKDIbZeclSHKT0HkpDHf318F1RQxW0lTo0DPZH XdRq/mKmN/27M0LkG4mgPzsEs+IQEo91uKcv2mwwNUg9i99mGFemLDp+Wqr5yS5f+h2Q kN99qZQ225hOn4/tk2ckd/Nl0Cy0gC0MXYsetzeKm3h9dNcuhONJEqoRu/OLDZEbvrWL 1RXkTDr2yLgFtp7OL5LTg+XHgjZ6qV0EfSX1Mjtv8Yt+Eed04+WRCgPQtvkeJi3dJKm4 BIFesWuAuorib+arvAQPmntvE6fI0/3rLAarjSjHy4Hbabq1hsKaBJcViqNlnqDwhcJS ahww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qeA82m5Gb++RIR+oXtmSNu/PJeKSWBs+x9b6atz1ty0=; b=FJN4PT5HRr7PTP6Ill2h7mGIxC3WBSzAHGOx4Scg1i57uRRnxucYg0pRe5wkurmr/7 iJz8Ahw/hPS9QTpcGBWhw4VoDth0QjEqP87wQLK0YD+e0gfwEYPrUieGPe3afT7oAmt2 GMcvNmtgfs7O5LZNwWQj9TRWoAw66VYsd2xll7A8HAmS3fl8P52OpJ6wBPz9TkFZZxLJ IoRSh5KCH7/0ruvEHl+iy1W3DDjrn2DG+uXoe1Z3S/C3CbHE+QHSOtpPvqGw1xT4Gm1k uakA/gIb5tOvwT3Ka2zuU3ptIOsyO0zSUoVfcVTp/EKFVbxnnqPhxIYxA/gdyDbF54U1 7wLw== X-Gm-Message-State: AOAM533bTLgjzg3Wnt0009Nv5vDlN1YU644SBsRv/ZkihpGxB9Hw+C5w yvxuO0tVOIkDmkhDsKRB47oH2ZUYgusRvw== X-Google-Smtp-Source: ABdhPJyvN1Qtfa3wa3HVWUa4KIK6HCTh/XSdAvBpi8/v/yBNM7ypHQtOu82aCIVspCc2TFlIbajnXA== X-Received: by 2002:a17:907:9ef:: with SMTP id ce15mr8405870ejc.430.1601850732673; Sun, 04 Oct 2020 15:32:12 -0700 (PDT) Original-Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id dt8sm6275065ejc.113.2020.10.04.15.32.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Oct 2020 15:32:11 -0700 (PDT) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189771 Archived-At: On 24.09.2020 10:15, Andrii Kolomoiets wrote: >> On 18.09.2020 18:45, Andrii Kolomoiets wrote: >>> BTW vc-revert is also works fine in Git repo when point is on >>> subdirectory. So for the vc-git only reverting repo root is not >>> working. >> >> That's an interesting observation. > > And the most interest part of that observation is that I can't reproduce > it :) Oh well. :-) >>> Please see attached patch which make it possible for vc-hg to revert >>> directory. >> >> Could you explain both changes in that patch? > > The idea is to make the 'vc-backend' function to return backend for > directory. 'vc-backend' function uses the 'vc-registered' function. > The change for vc-hg.el makes 'vc-hg-registered' return t for directory. > The change to vc.el makes the 'vc-register' function called on directory > to not error with "already registered" message. Thanks. Where is that vc-backend called from, in our scenario? Could we make do with changing that code to use vc-responsible-backend instead of vc-backend instead? If it's not a function called frequently. I'm not 100% sure about the original design, but vc-responsible-backend *does* work on directories. Its downside is it doesn't cache the result to VC properties (hence it would be unwise to use it everywhere). But it's also an upside, because said properties are invalidated in a few strategic places like find-file-hook, and that never happens for directories (hence that cache will tend to get out of date, sooner or later). >> And also: how does it change, or not change, the behavior of vc-revert >> in backends that are not Git or Hg? > > Looks like everybody is ready for reverting dirs. > > bzr, mtn, svn - Should be fine reverting directory > dav - do nothing on vc-revert > rcs - reverting directory is added in c22b0a7da32360e34f6f0ff86a886c9028b3d863 > sccs - reverting directory is added in e7290559824406d111d306069b36dde8ced847f9 > src - reverting directory is supported initially 1e81f6769013e1a0df9e10d7c5d0a3e3ca131143 > cvs - passing directory to 'unedit' command should be fine Very good.