# HG changeset patch # User Franz Glasner # Date 1550703571 -3600 # Node ID 950a9bd55d7ea1178677a8ea6e7ffa325d694078 # Parent 103df4b7a0c8690c78605c792c71447f1ba15dfc Expand "HGrepoid" as Mercurial's repository id (id of the first commit) diff -r 103df4b7a0c8 -r 950a9bd55d7e extensions/kwarchive.py --- a/extensions/kwarchive.py Wed Feb 20 23:09:10 2019 +0100 +++ b/extensions/kwarchive.py Wed Feb 20 23:59:31 2019 +0100 @@ -538,7 +538,7 @@ # not whitelisted -> ignore kwds = [] else: - # Empty keyword_substitutions mean: expand built-in keywords + # Empty keyword_substitutions mean: expand built-in keywords kwds = [kw] for kw in kwds: if matcher_rcs(rel_name_in_subrepo): @@ -744,6 +744,7 @@ else: latesttags = templatekw.getlatesttags(ctx.repo(), ctx, {}) keywords = { + "HGrepoid": ctx.repo()[ctx.repo().lookup('0')].hex(), # repo id "HGpath": path_uri, # XXX FIXME: Should Archive an alias of this "HGbranch": ctx.branch(), "HGtags": " ".join([tag for tag in ctx.tags() if tag != "tip"]), diff -r 103df4b7a0c8 -r 950a9bd55d7e tests/test-kwarchive.t --- a/tests/test-kwarchive.t Wed Feb 20 23:09:10 2019 +0100 +++ b/tests/test-kwarchive.t Wed Feb 20 23:59:31 2019 +0100 @@ -17,6 +17,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: file://$TESTTMP/repo1 $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 54f2f8d67c3781f41d8bebd01cd19ddb86f41574 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -45,6 +46,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: file://$TESTTMP/repo1 $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 54f2f8d67c3781f41d8bebd01cd19ddb86f41574 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -73,6 +75,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: .../repo1 $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 54f2f8d67c3781f41d8bebd01cd19ddb86f41574 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -101,6 +104,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: file://$TESTTMP/repo1 $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 54f2f8d67c3781f41d8bebd01cd19ddb86f41574 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -129,6 +133,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: hg+https://hg/repo.hg $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 54f2f8d67c3781f41d8bebd01cd19ddb86f41574 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -158,6 +163,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: https://theuser:thepass@hg.example.com:4443/repo.hg $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 54f2f8d67c3781f41d8bebd01cd19ddb86f41574 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -186,6 +192,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: https://theuser:***@hg.example.com:4443/repo.hg $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 54f2f8d67c3781f41d8bebd01cd19ddb86f41574 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -214,6 +221,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: https://hg.example.com:4443/repo.hg $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 54f2f8d67c3781f41d8bebd01cd19ddb86f41574 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -242,6 +250,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: .../repo.hg $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 54f2f8d67c3781f41d8bebd01cd19ddb86f41574 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -394,6 +403,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: hg+https://hg/repo.hg $ + $HGrepoid: 32ee1d210af8d5434587ac0b0494e90d69bbfce8 $ $HGrevision: 959ffd1bae463906774177568fdf853416cb5ca2 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -420,6 +430,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: file:///subrepo1 $ + $HGrepoid: 934bf0defe66f2b1b5d46777f115e53f34a96016 $ $HGrevision: ea2a4310dad4d276467e2c342f8bc54d4e6a74a7 $ $HGshortdate: 1970-01-01 $ $HGtags: $ @@ -446,6 +457,7 @@ $HGlatesttagjustdate: 1970-01-01 $ $HGlatesttags: null $ $HGpath: file:///subrepo2 $ + $HGrepoid: 934bf0defe66f2b1b5d46777f115e53f34a96016 $ $HGrevision: fb36e107ea3bc98cfabecbed9f4292777533cdbf $ $HGshortdate: 1970-01-01 $ $HGtags: $