Patchwork [2,of,4] git: abort when attempting to set a branch

login
register
mail settings
Submitter Josef 'Jeff' Sipek
Date March 26, 2020, 10:07 p.m.
Message ID <c1b5ff87d07b7029f5df.1585260425@meili>
Download mbox | patch
Permalink /patch/45919/
State New
Headers show

Comments

Josef 'Jeff' Sipek - March 26, 2020, 10:07 p.m.
# HG changeset patch
# User Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
# Date 1585256974 14400
#      Thu Mar 26 17:09:34 2020 -0400
# Node ID c1b5ff87d07b7029f5df5345dbbc097a5f01d9b4
# Parent  6d0a988e6a5d4189f111a6dc2ce2c1fa5fd29422
git: abort when attempting to set a branch

Given the mapping we use (namely, a git head is a bookmark), it is better to
error out with a hint.

Patch

diff --git a/hgext/git/dirstate.py b/hgext/git/dirstate.py
--- a/hgext/git/dirstate.py
+++ b/hgext/git/dirstate.py
@@ -300,3 +300,6 @@  class gitdirstate(object):
     def clearbackup(self, tr, backupname):
         # TODO
         pass
+
+    def setbranch(self, branch):
+        raise error.Abort(b'git repos do not support branches. try using bookmarks')