[PATCH 7 of 9] hgk: remove gitism

Andrew Shadura bugzilla at tut.by
Wed Nov 7 09:15:15 CST 2012


# HG changeset patch
# User Andrew Shadura <bugzilla at tut.by>
# Date 1350420738 -7200
# Node ID 7e5331f11cd647b058f12a248aa16f088cbd5ba3
# Parent  a76e59138a38cf1bc5df4e944739fd71a0bf0f80
hgk: remove gitism

It's not HEAD, it's tip.

diff --git a/contrib/hgk b/contrib/hgk
--- a/contrib/hgk
+++ b/contrib/hgk
@@ -141,14 +141,14 @@ proc getcommits {rargs} {
 	}
     }
     if [catch {
-	set parse_args [concat --default HEAD $revargs]
+	set parse_args [concat --default tip $revargs]
 	set parse_temp [eval exec {$env(HG)} --config ui.report_untrusted=false debug-rev-parse $parse_args]
 	regsub -all "\r\n" $parse_temp "\n" parse_temp
 	set parsed_args [split $parse_temp "\n"]
     } err] {
 	# if git-rev-parse failed for some reason...
 	if {$rargs == {}} {
-	    set revargs HEAD
+	    set revargs tip
 	}
 	set parsed_args $revargs
     }
diff --git a/hgext/hgk.py b/hgext/hgk.py
--- a/hgext/hgk.py
+++ b/hgext/hgk.py
@@ -221,7 +221,7 @@ def revtree(ui, args, repo, full="tree",
             s = repo.lookup(arg[1:])
             stop_sha1.append(s)
             want_sha1.append(s)
-        elif arg != 'HEAD':
+        elif arg != 'tip':
             want_sha1.append(repo.lookup(arg))
 
     # calculate the graph for the supplied commits
@@ -279,8 +279,6 @@ def revtree(ui, args, repo, full="tree",
 def revparse(ui, repo, *revs, **opts):
     """parse given revisions"""
     def revstr(rev):
-        if rev == 'HEAD':
-            rev = 'tip'
         return revlog.hex(repo.lookup(rev))
 
     for r in revs:


More information about the Mercurial-devel mailing list