1053 escapes arguments appropriately. Aliases are intentionally ignored |
1053 escapes arguments appropriately. Aliases are intentionally ignored |
1054 so that intended expression behavior isn't accidentally subverted. |
1054 so that intended expression behavior isn't accidentally subverted. |
1055 |
1055 |
1056 Supported arguments: |
1056 Supported arguments: |
1057 |
1057 |
|
1058 %r = revset expression, parenthesized |
1058 %d = int(arg), no quoting |
1059 %d = int(arg), no quoting |
1059 %s = string(arg), escaped and single-quoted |
1060 %s = string(arg), escaped and single-quoted |
1060 %b = arg.branch(), escaped and single-quoted |
1061 %b = arg.branch(), escaped and single-quoted |
1061 %n = hex(arg), single-quoted |
1062 %n = hex(arg), single-quoted |
1062 %% = a literal '%' |
1063 %% = a literal '%' |
1063 |
1064 |
1064 Prefixing the type with 'l' specifies a list of that type. |
1065 Prefixing the type with 'l' specifies a parenthesized list of that type. |
1065 |
1066 |
|
1067 >>> formatspec('%d:: and %lr', 10, ("this()", "that()")) |
|
1068 '10:: and ((this()) or (that()))' |
1066 >>> formatspec('%d:: and not %d::', 10, 20) |
1069 >>> formatspec('%d:: and not %d::', 10, 20) |
1067 '10:: and not 20::' |
1070 '10:: and not 20::' |
1068 >>> formatspec('keyword(%s)', 'foo\\xe9') |
1071 >>> formatspec('keyword(%s)', 'foo\\xe9') |
1069 "keyword('foo\\\\xe9')" |
1072 "keyword('foo\\\\xe9')" |
1070 >>> b = lambda: 'default' |
1073 >>> b = lambda: 'default' |